Esempio n. 1
0
void Globals::synchronize(Serializer &s) {
	if (s.getVersion() >= 2)
		SavedObject::synchronize(s);
	assert(_gfxManagers.size() == 1);

	_sceneItems.synchronize(s);
	SYNC_POINTER(_sceneObjects);
	_sceneObjects_queue.synchronize(s);
	s.syncAsSint32LE(_gfxFontNumber);
	s.syncAsSint32LE(_gfxColors.background);
	s.syncAsSint32LE(_gfxColors.foreground);
	s.syncAsSint32LE(_fontColors.background);
	s.syncAsSint32LE(_fontColors.foreground);

	if (s.getVersion() >= 4) {
		s.syncAsByte(_color1);
		s.syncAsByte(_color2);
		s.syncAsByte(_color3);
	}

	s.syncAsSint16LE(_dialogCenter.x); s.syncAsSint16LE(_dialogCenter.y);
	_sounds.synchronize(s);
	for (int i = 0; i < 256; ++i)
		s.syncAsByte(_flags[i]);

	s.syncAsSint16LE(_sceneOffset.x); s.syncAsSint16LE(_sceneOffset.y);
	s.syncAsSint16LE(_prevSceneOffset.x); s.syncAsSint16LE(_prevSceneOffset.y);
	SYNC_POINTER(_scrollFollower);
	s.syncAsSint32LE(_stripNum);

	if (s.getVersion() >= 8)
		_walkRegions.synchronize(s);
}
Esempio n. 2
0
void SceneManager::listenerSynchronize(Serializer &s) {
	s.validate("SceneManager");

	if (s.isLoading() && !_globals->_sceneManager._scene)
		// Loading a savegame straight from the launcher, so instantiate a blank placeholder scene
		// in order for the savegame loading to work correctly
		_globals->_sceneManager._scene = new Scene();

	_altSceneObjects.synchronize(s);
	s.syncAsSint32LE(_sceneNumber);
	s.syncAsUint16LE(_globals->_sceneManager._scene->_activeScreenNumber);

	if (s.isLoading()) {
		changeScene(_sceneNumber);
		
		if (_nextSceneNumber != -1) {
			sceneChange();
			_nextSceneNumber = -1;
		}
	}

	_globals->_sceneManager._scrollerRect.synchronize(s);
	SYNC_POINTER(_globals->_scrollFollower);
	s.syncAsSint16LE(_loadMode);
}
Esempio n. 3
0
void SequenceManager::synchronize(Serializer &s) {
	if (s.getVersion() >= 2)
		Action::synchronize(s);

	s.syncAsSint32LE(_resNum);
	s.syncAsSint32LE(_sequenceOffset);
	s.syncAsByte(_keepActive);
	s.syncAsSint32LE(_fontNum);
	s.syncAsSint32LE(_field26);

	s.syncAsSint32LE(_objectIndex);
	SYNC_POINTER(_sceneObject);
	for (int i = 0; i < 6; ++i)
		SYNC_POINTER(_objectList[i]);

	int seqSize = _sequenceData.size();
	s.syncAsUint32LE(seqSize);
	if (s.isLoading())
		_sequenceData.resize(seqSize);
	if (seqSize > 0)
		s.syncBytes(&_sequenceData[0], seqSize);
}
Esempio n. 4
0
void SceneManager::listenerSynchronize(Serializer &s) {
	s.validate("SceneManager");

	_altSceneObjects.synchronize(s);
	s.syncAsSint32LE(_sceneNumber);
	s.syncAsUint16LE(_globals->_sceneManager._scene->_activeScreenNumber);

	if (s.isLoading()) {
		changeScene(_sceneNumber);
		checkScene();
	}

	_globals->_sceneManager._scrollerRect.synchronize(s);
	SYNC_POINTER(_globals->_scrollFollower);
	s.syncAsSint16LE(_loadMode);
}
Esempio n. 5
0
void SceneManager::listenerSynchronize(Serializer &s) {
	s.validate("SceneManager");

	if (s.isLoading() && !g_globals->_sceneManager._scene)
		// Loading a savegame straight from the launcher, so instantiate a blank placeholder scene
		// in order for the savegame loading to work correctly
		g_globals->_sceneManager._scene = new Scene();

	// Depreciated: the background scene objects used to be located here
	uint32 unused = 0;
	s.syncAsUint32LE(unused);

	s.syncAsSint32LE(_sceneNumber);
	s.syncAsUint16LE(g_globals->_sceneManager._scene->_activeScreenNumber);

	if (s.isLoading()) {
		changeScene(_sceneNumber);

		if (_nextSceneNumber != -1) {
			sceneChange();
			_nextSceneNumber = -1;
		}
	}

	// Walk regions loading
	if (g_vm->getGameID() == GType_Ringworld2) {
		int walkRegionsId = GLOBALS._walkRegions._resNum;
		s.syncAsSint16LE(walkRegionsId);
		if (s.isLoading())
			GLOBALS._walkRegions.load(walkRegionsId);
	}

	g_globals->_sceneManager._scrollerRect.synchronize(s);
	SYNC_POINTER(g_globals->_scrollFollower);
	s.syncAsSint16LE(_loadMode);
}
Esempio n. 6
0
void UIInventorySlot::synchronize(Serializer &s) {
	UIElement::synchronize(s);
	s.syncAsSint16LE(_objIndex);
	SYNC_POINTER(_object);
}
Esempio n. 7
0
void TimerExt::synchronize(Serializer &s) {
	EventHandler::synchronize(s);
	SYNC_POINTER(_action);
}
Esempio n. 8
0
void Timer::synchronize(Serializer &s) {
	EventHandler::synchronize(s);
	SYNC_POINTER(_tickAction);
	SYNC_POINTER(_endHandler);
	s.syncAsUint32LE(_endFrame);
}
Esempio n. 9
0
void AObjectArray::synchronize(Serializer &s) {
	EventHandler::synchronize(s);
	for (int i = 0; i < OBJ_ARRAY_SIZE; ++i)
		SYNC_POINTER(_objList[i]);
}
Esempio n. 10
0
void ActionObject::synchronize(Serializer &s) {
	EventHandler::synchronize(s);

	SYNC_POINTER(_endAction);
}