示例#1
0
void MADSAction::synchronize(Common::Serializer &s) {
	_action.synchronize(s);
	_activeAction.synchronize(s);
	s.syncAsSint16LE(_articleNumber);
	s.syncAsByte(_lookFlag);
	s.syncAsByte(_textChanged);
	s.syncAsSint16LE(_selectedRow);
	s.syncAsSint16LE(_selectedAction);
	s.syncAsSint16LE(_statusTextIndex);
	s.syncAsSint16LE(_hotspotId);
	_savedFields.synchronize(s);

	// TODO: When saving in Rex Village Hut, _senetence size() doesn't match
	// string length. Find out why not
	_sentence = Common::String(_sentence.c_str());
	s.syncString(_sentence);

	s.syncAsSint16LE(_verbType);
	s.syncAsSint16LE(_prepType);
	s.syncAsSint16LE(_commandSource);
	s.syncAsSint16LE(_mainObjectSource);
	s.syncAsSint16LE(_secondObject);
	s.syncAsSint16LE(_secondObjectSource);
	s.syncAsSint16LE(_recentCommandSource);
	s.syncAsSint16LE(_recentCommand);
	s.syncAsSint16LE(_interAwaiting);
	s.syncAsSint16LE(_pickedWord);
	s.syncAsByte(_pointEstablished);
	s.syncAsByte(_inProgress);
}
示例#2
0
void Game::synchronize(Common::Serializer &s, bool phase1) {
	if (phase1) {
		s.syncAsSint16LE(_fx);
		s.syncAsSint16LE(_trigger);
		s.syncAsUint16LE(_triggerSetupMode);
		s.syncAsUint16LE(_triggerMode);
		s.syncString(_aaName);
		s.syncAsSint16LE(_lastSave);

		_scene.synchronize(s);
		_objects.synchronize(s);
		_visitedScenes.synchronize(s, _scene._nextSceneId);
		_player.synchronize(s);
		_screenObjects.synchronize(s);
	} else {
		// Load scene specific data for the loaded scene
		_scene._sceneLogic->synchronize(s);
	}
}
示例#3
0
void Sprite::saveLoadWithSerializer(Common::Serializer &ser) {
	ser.syncAsSint16LE(pos.x);
	ser.syncAsSint16LE(pos.y);
	ser.syncAsUint16LE(drawPriority);
	ser.syncAsUint16LE(drawPriority2);
	ser.syncString(field8);
	// Note: bitmap must be reloaded
	ser.syncAsUint16LE(drawMode);
	ser.syncAsUint16LE(textColor);
	ser.syncAsUint16LE(bitmapChanged);
	ser.syncAsUint16LE(rect2Valid);
	ser.syncAsUint16LE(isOnScreen);
	ser.syncAsUint16LE(field16);
	serializeRect(lastDrawRect, ser);
	serializeRect(drawRect, ser);
	serializeRect(rectangle2, ser);
	ser.syncAsSint16LE(drawX);
	ser.syncAsSint16LE(drawY);
}
示例#4
0
bool SaveHeader::sync(Common::Serializer &sz) {
	const uint32 SAVE_MAGIC_NUMBER = MKTAG('M', 'O', 'J', 'B');
	const uint32 SAVE_FILE_VERSION = 1;

	if (sz.isLoading()) {
		uint32 magic = 0;
		sz.syncAsUint32BE(magic);
		if (magic != SAVE_MAGIC_NUMBER) {
			warning("Invalid save");
			return false;
		}
	} else {
		uint32 magic = SAVE_MAGIC_NUMBER;
		sz.syncAsUint32BE(magic);
	}

	sz.syncVersion(SAVE_FILE_VERSION);
	sz.syncString(_description);

	return true;
}
示例#5
0
文件: player.cpp 项目: Cruel/scummvm
void Player::synchronize(Common::Serializer &s) {
	s.syncAsByte(_moving);
	s.syncAsSint16LE(_playerPos.x);
	s.syncAsSint16LE(_playerPos.y);
	s.syncAsSint16LE(_targetPos.x);
	s.syncAsSint16LE(_targetPos.y);
	s.syncAsSint16LE(_xDirection);
	s.syncAsSint16LE(_yDirection);
	s.syncAsSint16LE(_posDiff.x);
	s.syncAsSint16LE(_posDiff.y);
	s.syncAsSint16LE(_posChange.x);
	s.syncAsSint16LE(_posChange.y);
	s.syncAsUint16LE(_targetFacing);
	s.syncAsSint16LE(_special);
	s.syncAsByte(_forceRefresh);
	s.syncAsSint16LE(_ticksAmount);
	s.syncAsByte(_walkAnywhere);
	s.syncAsUint16LE(_walkOffScreenSceneId);
	s.syncAsByte(_walkOffScreen);
	s.syncAsByte(_needToWalk);
	s.syncAsByte(_readyToWalk);
	s.syncAsUint16LE(_prepareWalkFacing);
	s.syncAsSint16LE(_prepareWalkPos.x);
	s.syncAsSint16LE(_prepareWalkPos.y);
	s.syncAsByte(_stepEnabled);
	s.syncAsByte(_visible);
	s.syncAsByte(_priorVisible);

	for (int i = 0; i < 8; ++i)
		s.syncAsByte(_spriteSetsPresent[i]);

	s.syncAsByte(_facing);
	s.syncAsByte(_turnToFacing);
	s.syncAsSint16LE(_spritesIdx);
	s.syncAsSint16LE(_frameNumber);
	s.syncAsSint16LE(_currentDepth);
	s.syncAsSint16LE(_currentScale);
	s.syncAsSint16LE(_frameListIndex);
	_stopWalkers.synchronize(s);
	_walkTriggerAction.synchronize(s);
	s.syncAsUint16LE(_walkTriggerDest);

	s.syncAsSint16LE(_upcomingTrigger);
	s.syncAsSint16LE(_trigger);
	s.syncAsSint16LE(_scalingVelocity);
	s.syncAsSint16LE(_pixelAccum);
	s.syncAsSint16LE(_distAccum);
	s.syncAsSint16LE(_deltaDistance);
	s.syncAsSint16LE(_totalDistance);
	s.syncAsSint16LE(_velocity);
	s.syncAsUint16LE(_frameCount);
	s.syncString(_spritesPrefix);
	s.syncAsUint32LE(_priorTimer);
	s.syncAsByte(_loadsFirst);
	s.syncAsByte(_loadedFirst);
	s.syncAsByte(_spritesLoaded);
	s.syncAsByte(_spritesChanged);
	s.syncAsByte(_beenVisible);
	s.syncAsSint16LE(_centerOfGravity);
	s.syncAsByte(_mirror);
}