diff options
-rw-r--r-- | engines/tony/mpal/mpal.cpp | 11 | ||||
-rw-r--r-- | engines/tony/tony.cpp | 5 | ||||
-rw-r--r-- | engines/tony/tony.h | 4 |
3 files changed, 13 insertions, 7 deletions
diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp index a173b707f2..854372cdda 100644 --- a/engines/tony/mpal/mpal.cpp +++ b/engines/tony/mpal/mpal.cpp @@ -767,8 +767,6 @@ void ActionThread(CORO_PARAM, const void *param) { debugC(DEBUG_DETAILED, kTonyDebugActions, "Action Process %d ended", CoroScheduler.getCurrentPID()); - CORO_KILL_SELF(); - CORO_END_CODE; } @@ -780,6 +778,7 @@ void ActionThread(CORO_PARAM, const void *param) { void ShutUpActionThread(CORO_PARAM, const void *param) { // COROUTINE CORO_BEGIN_CONTEXT; + int slotNumber; CORO_END_CONTEXT(_ctx); uint32 pid = *(const uint32 *)param; @@ -790,7 +789,13 @@ void ShutUpActionThread(CORO_PARAM, const void *param) { GLOBALS.bExecutingAction = false; - CORO_KILL_SELF(); + if (_vm->_initialLoadSlotNumber != -1) { + _ctx->slotNumber = _vm->_initialLoadSlotNumber; + _vm->_initialLoadSlotNumber = -1; + + CORO_INVOKE_1(_vm->LoadState, _ctx->slotNumber); + } + CORO_END_CODE; } diff --git a/engines/tony/tony.cpp b/engines/tony/tony.cpp index c7056cb88d..2dbe102424 100644 --- a/engines/tony/tony.cpp +++ b/engines/tony/tony.cpp @@ -38,6 +38,7 @@ TonyEngine *_vm; TonyEngine::TonyEngine(OSystem *syst, const TonyGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc), _randomSource("tony") { _vm = this; + _loadSlotNumber = -1; DebugMan.addDebugChannel(kTonyDebugAnimations, "animations", "Animations debugging"); DebugMan.addDebugChannel(kTonyDebugActions, "actions", "Actions debugging"); @@ -45,11 +46,11 @@ TonyEngine::TonyEngine(OSystem *syst, const TonyGameDescription *gameDesc) : Eng DebugMan.addDebugChannel(kTonyDebugMusic, "music", "Music debugging"); // Set up load slot number - _loadSlotNumber = -1; + _initialLoadSlotNumber = -1; if (ConfMan.hasKey("save_slot")) { int slotNumber = ConfMan.getInt("save_slot"); if (slotNumber >= 0 && slotNumber <= 99) - _loadSlotNumber = slotNumber; + _initialLoadSlotNumber = slotNumber; } } diff --git a/engines/tony/tony.h b/engines/tony/tony.h index f40eb1325d..18d4a37067 100644 --- a/engines/tony/tony.h +++ b/engines/tony/tony.h @@ -78,8 +78,6 @@ struct VoiceHeader { class TonyEngine : public Engine { private: - int _loadSlotNumber; - Common::ErrorCode Init(); void InitMusic(); void CloseMusic(); @@ -122,6 +120,8 @@ public: bool m_bDrawLocation; int m_startTime; uint16 *m_curThumbnail; + int _initialLoadSlotNumber; + int _loadSlotNumber; // Bounding box list manager RMGameBoxes _theBoxes; |