diff options
Diffstat (limited to 'engines/tsage/ringworld')
-rw-r--r-- | engines/tsage/ringworld/ringworld_dialogs.cpp | 8 | ||||
-rw-r--r-- | engines/tsage/ringworld/ringworld_logic.cpp | 61 | ||||
-rw-r--r-- | engines/tsage/ringworld/ringworld_logic.h | 4 | ||||
-rw-r--r-- | engines/tsage/ringworld/ringworld_scenes3.cpp | 6 | ||||
-rw-r--r-- | engines/tsage/ringworld/ringworld_scenes5.cpp | 4 |
5 files changed, 15 insertions, 68 deletions
diff --git a/engines/tsage/ringworld/ringworld_dialogs.cpp b/engines/tsage/ringworld/ringworld_dialogs.cpp index 37101c9c58..0e451b8429 100644 --- a/engines/tsage/ringworld/ringworld_dialogs.cpp +++ b/engines/tsage/ringworld/ringworld_dialogs.cpp @@ -183,9 +183,11 @@ void RightClickDialog::execute() { } g_system->delayMillis(10); - g_system->updateScreen(); + GLOBALS._screenSurface.updateScreen(); } + _gfxManager.deactivate(); + // Execute the specified action switch (_selectedAction) { case 1: @@ -213,8 +215,6 @@ void RightClickDialog::execute() { Ringworld::OptionsDialog::show(); break; } - - _gfxManager.deactivate(); } /*--------------------------------------------------------------------------*/ @@ -394,7 +394,7 @@ void InventoryDialog::execute() { Event event; while (!g_globals->_events.getEvent(event) && !g_vm->shouldQuit()) { g_system->delayMillis(10); - g_system->updateScreen(); + GLOBALS._screenSurface.updateScreen(); } if (g_vm->shouldQuit()) break; diff --git a/engines/tsage/ringworld/ringworld_logic.cpp b/engines/tsage/ringworld/ringworld_logic.cpp index ad67b66f69..00c219f2ee 100644 --- a/engines/tsage/ringworld/ringworld_logic.cpp +++ b/engines/tsage/ringworld/ringworld_logic.cpp @@ -196,14 +196,17 @@ Scene *RingworldGame::createScene(int sceneNumber) { * Returns true if it is currently okay to restore a game */ bool RingworldGame::canLoadGameStateCurrently() { - return !g_globals->getFlag(50); + // Don't allow a game to be loaded if a dialog is active + return !g_globals->getFlag(50) && (g_globals->_gfxManagers.size() == 1); + } /** * Returns true if it is currently okay to save the game */ bool RingworldGame::canSaveGameStateCurrently() { - return !g_globals->getFlag(50); + // Don't allow a game to be saved if a dialog is active + return !g_globals->getFlag(50) && (g_globals->_gfxManagers.size() == 1); } /*--------------------------------------------------------------------------*/ @@ -312,7 +315,7 @@ void SceneArea::wait() { // Wait until a mouse or keypress Event event; while (!g_vm->shouldQuit() && !g_globals->_events.getEvent(event)) { - g_system->updateScreen(); + GLOBALS._screenSurface.updateScreen(); g_system->delayMillis(10); } @@ -623,58 +626,6 @@ void NamedHotspot::doAction(int action) { SceneHotspot::doAction(action); } -void NamedHotspot::setDetails(int ys, int xs, int ye, int xe, const int resnum, const int lookLineNum, const int useLineNum) { - setBounds(ys, xe, ye, xs); - _resNum = resnum; - _lookLineNum = lookLineNum; - _useLineNum = useLineNum; - _talkLineNum = -1; - g_globals->_sceneItems.addItems(this, NULL); -} - -void NamedHotspot::setDetails(const Rect &bounds, int resNum, int lookLineNum, int talkLineNum, int useLineNum, int mode, SceneItem *item) { - setBounds(bounds); - _resNum = resNum; - _lookLineNum = lookLineNum; - _talkLineNum = talkLineNum; - _useLineNum = useLineNum; - - switch (mode) { - case 2: - g_globals->_sceneItems.push_front(this); - break; - case 4: - g_globals->_sceneItems.addBefore(item, this); - break; - case 5: - g_globals->_sceneItems.addAfter(item, this); - break; - default: - g_globals->_sceneItems.push_back(this); - break; - } -} - -void NamedHotspot::setDetails(int sceneRegionId, int resNum, int lookLineNum, int talkLineNum, int useLineNum, int mode) { - _sceneRegionId = sceneRegionId; - _resNum = resNum; - _lookLineNum = lookLineNum; - _talkLineNum = talkLineNum; - _useLineNum = useLineNum; - - // Handle adding hotspot to scene items list as necessary - switch (mode) { - case 2: - GLOBALS._sceneItems.push_front(this); - break; - case 3: - break; - default: - GLOBALS._sceneItems.push_back(this); - break; - } -} - void NamedHotspot::synchronize(Serializer &s) { SceneHotspot::synchronize(s); s.syncAsSint16LE(_resNum); diff --git a/engines/tsage/ringworld/ringworld_logic.h b/engines/tsage/ringworld/ringworld_logic.h index 6f6a66cc26..e902ac127f 100644 --- a/engines/tsage/ringworld/ringworld_logic.h +++ b/engines/tsage/ringworld/ringworld_logic.h @@ -161,15 +161,11 @@ public: class NamedHotspot : public SceneHotspot { public: - int _resNum, _lookLineNum, _useLineNum, _talkLineNum; NamedHotspot(); virtual void doAction(int action); virtual Common::String getClassName() { return "NamedHotspot"; } virtual void synchronize(Serializer &s); - virtual void setDetails(int ys, int xs, int ye, int xe, const int resnum, const int lookLineNum, const int useLineNum); - virtual void setDetails(const Rect &bounds, int resNum, int lookLineNum, int talkLineNum, int useLineNum, int mode, SceneItem *item); - virtual void setDetails(int sceneRegionId, int resNum, int lookLineNum, int talkLineNum, int useLineNum, int mode); }; class NamedHotspotExt : public NamedHotspot { diff --git a/engines/tsage/ringworld/ringworld_scenes3.cpp b/engines/tsage/ringworld/ringworld_scenes3.cpp index 81190aea7b..0e4ccd1269 100644 --- a/engines/tsage/ringworld/ringworld_scenes3.cpp +++ b/engines/tsage/ringworld/ringworld_scenes3.cpp @@ -532,7 +532,7 @@ void Scene2100::Action1::signal() { // Wait for an event Event event; if (!g_globals->_events.getEvent(event)) { - g_system->updateScreen(); + GLOBALS._screenSurface.updateScreen(); g_system->delayMillis(10); continue; } @@ -2263,7 +2263,7 @@ void Scene2150::Action1::signal() { // Wait for an event Event event; if (!g_globals->_events.getEvent(event)) { - g_system->updateScreen(); + GLOBALS._screenSurface.updateScreen(); g_system->delayMillis(10); continue; } @@ -5118,7 +5118,7 @@ void Scene2320::Action3::signal() { // Wait for an event Event event; if (!g_globals->_events.getEvent(event)) { - g_system->updateScreen(); + GLOBALS._screenSurface.updateScreen(); g_system->delayMillis(10); continue; } diff --git a/engines/tsage/ringworld/ringworld_scenes5.cpp b/engines/tsage/ringworld/ringworld_scenes5.cpp index 49726eba2e..3b415bdb6a 100644 --- a/engines/tsage/ringworld/ringworld_scenes5.cpp +++ b/engines/tsage/ringworld/ringworld_scenes5.cpp @@ -2810,7 +2810,7 @@ void Scene4150::Action1::signal() { case 4: { for (int idx = 100; idx >= 0; idx -= 5) { g_globals->_scenePalette.fade(adjustData, false, idx); - g_system->updateScreen(); + GLOBALS._screenSurface.updateScreen(); g_system->delayMillis(10); } @@ -2838,7 +2838,7 @@ void Scene4150::Action1::signal() { case 7: for (int idx = 100; idx >= 0; idx -= 5) { g_globals->_scenePalette.fade(adjustData, false, idx); - g_system->updateScreen(); + GLOBALS._screenSurface.updateScreen(); g_system->delayMillis(10); } |