diff options
author | Paul Gilbert | 2011-09-25 09:59:24 +1000 |
---|---|---|
committer | Paul Gilbert | 2011-09-25 09:59:24 +1000 |
commit | 546eeb2c43895706edbba211c57a70fcd64c2da6 (patch) | |
tree | 2ab5833046e2ffbff06ca3a6d462800223938196 /engines/tsage | |
parent | 23729c206396e336cc83198f67b108dc3b315b21 (diff) | |
download | scummvm-rg350-546eeb2c43895706edbba211c57a70fcd64c2da6.tar.gz scummvm-rg350-546eeb2c43895706edbba211c57a70fcd64c2da6.tar.bz2 scummvm-rg350-546eeb2c43895706edbba211c57a70fcd64c2da6.zip |
TSAGE: Moved the _bgSceneObjects list from SceneManager to Scene.
This fixes a problem with Blue Force savegames in that they were being
loaded too early, and being destroyed as the game scene was then loaded.
Diffstat (limited to 'engines/tsage')
-rw-r--r-- | engines/tsage/core.cpp | 6 | ||||
-rw-r--r-- | engines/tsage/saveload.h | 2 | ||||
-rw-r--r-- | engines/tsage/scenes.cpp | 16 | ||||
-rw-r--r-- | engines/tsage/scenes.h | 2 |
4 files changed, 16 insertions, 10 deletions
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index a625bdf78d..deea4f25f7 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2529,7 +2529,11 @@ void SceneObject::setup(int visage, int stripFrameNum, int frameNum, int posX, i /*--------------------------------------------------------------------------*/ void BackgroundSceneObject::postInit(SceneObjectList *OwnerList) { - SceneObject::postInit(&_globals->_sceneManager._bgSceneObjects); + SceneObjectList dummyList; + SceneObjectList *pList = !_globals->_sceneManager._scene ? &dummyList : + &_globals->_sceneManager._scene->_bgSceneObjects; + + SceneObject::postInit(pList); } void BackgroundSceneObject::draw() { diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h index f81454d5e9..d0876d1cb6 100644 --- a/engines/tsage/saveload.h +++ b/engines/tsage/saveload.h @@ -33,7 +33,7 @@ namespace TsAGE { typedef void (*SaveNotifierFn)(bool postFlag); -#define TSAGE_SAVEGAME_VERSION 6 +#define TSAGE_SAVEGAME_VERSION 7 class SavedObject; diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index c2c35c46a6..69985382bd 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -80,9 +80,6 @@ void SceneManager::sceneChange() { sceneObj->removeObject(); } - // Clear the secondary scene object list - _bgSceneObjects.clear(); - // Clear the hotspot list SynchronizedList<SceneItem *>::iterator ii = _globals->_sceneItems.begin(); while (ii != _globals->_sceneItems.end()) { @@ -234,7 +231,10 @@ void SceneManager::listenerSynchronize(Serializer &s) { // in order for the savegame loading to work correctly _globals->_sceneManager._scene = new Scene(); - _bgSceneObjects.synchronize(s); + // Depreciated: the background scene objects used to be located here + uint32 unused = 0; + s.syncAsUint32LE(unused); + s.syncAsSint32LE(_sceneNumber); s.syncAsUint16LE(_globals->_sceneManager._scene->_activeScreenNumber); @@ -283,6 +283,9 @@ void Scene::synchronize(Serializer &s) { s.syncAsUint16LE(_enabledSections[i]); for (int i = 0; i < 256; ++i) s.syncAsSint16LE(_zoomPercents[i]); + + if (s.getVersion() >= 7) + _bgSceneObjects.synchronize(s); } void Scene::postInit(SceneObjectList *OwnerList) { @@ -450,8 +453,7 @@ void Scene::drawBackgroundObjects() { Common::Array<SceneObject *> objList; // Initial loop to set the priority for entries in the list - for (SynchronizedList<SceneObject *>::iterator i = _globals->_sceneManager._bgSceneObjects.begin(); - i != _globals->_sceneManager._bgSceneObjects.end(); ++i) { + for (SynchronizedList<SceneObject *>::iterator i = _bgSceneObjects.begin(); i != _bgSceneObjects.end(); ++i) { SceneObject *obj = *i; objList.push_back(obj); @@ -463,7 +465,7 @@ void Scene::drawBackgroundObjects() { } // Sort the list by priority - _globals->_sceneManager._bgSceneObjects.sortList(objList); + _bgSceneObjects.sortList(objList); // Drawing loop for (uint objIndex = 0; objIndex < objList.size(); ++objIndex) { diff --git a/engines/tsage/scenes.h b/engines/tsage/scenes.h index c0cdb9efdd..a1677906aa 100644 --- a/engines/tsage/scenes.h +++ b/engines/tsage/scenes.h @@ -48,6 +48,7 @@ public: int _enabledSections[256]; int _zoomPercents[256]; ScenePriorities _priorities; + SceneObjectList _bgSceneObjects; int _fieldA; int _fieldE; @@ -86,7 +87,6 @@ public: Common::Point _sceneBgOffset; int _sceneLoadCount; Rect _scrollerRect; - SceneObjectList _bgSceneObjects; int _objectCount; public: SceneManager(); |