From 53eee91c3f8acc41d54719d5f46ddffcf48fa60b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 30 Jun 2014 20:23:00 -0400 Subject: TSAGE: Fix for loading savegames in the R2R Flub tube maze --- engines/tsage/ringworld2/ringworld2_logic.h | 2 +- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h index 31d801fa55..d95f279e27 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.h +++ b/engines/tsage/ringworld2/ringworld2_logic.h @@ -320,7 +320,7 @@ public: int pixelToCellXY(Common::Point &pt); virtual Common::String getClassName() { return "MazeUI"; } - void synchronize(Serializer &s); + virtual void synchronize(Serializer &s); virtual void reposition(); virtual void draw(); }; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 3f32503fdf..0898cfd0b4 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -3668,11 +3668,12 @@ void Scene3500::postInit(SceneObjectList *OwnerList) { _horizontalSpeedDisplay.setPosition(Common::Point(126, 108)); _horizontalSpeedDisplay.fixPriority(200); + _action1._turningFl = false; + + _mazeUI.postInit(); _mazeUI.setDisplayBounds(Rect(160, 89, 299, 182)); _mazeUI.load(2); _mazeUI.setMazePosition(_mazePosition); - - _action1._turningFl = false; _mazeUI.draw(); _directionChangesEnabled = true; @@ -3876,6 +3877,11 @@ void Scene3500::dispatch() { Rect tmpRect; Scene::dispatch(); + // WORKAROUND: The _mazeUI wasn't originally added to the scene in postInit. + // This is only needed to fix old savegames + if (!R2_GLOBALS._sceneObjects->contains(&_mazeUI)) + _mazeUI.draw(); + if (((_shuttle._frame % 2) == 0) && (!_action1._turningFl)) { _shuttle.setFrame(_shuttle.changeFrame()); _mazeDirection = _shuttle._frame; @@ -4215,7 +4221,6 @@ void Scene3500::dispatch() { _rotation->_idxChange = 0; } - _mazeUI.draw(); if (_exitCounter != 0) ++_exitCounter; } -- cgit v1.2.3