diff options
-rw-r--r-- | engines/hopkins/debugger.cpp | 7 | ||||
-rw-r--r-- | engines/hopkins/debugger.h | 1 | ||||
-rw-r--r-- | engines/hopkins/globals.cpp | 1 | ||||
-rw-r--r-- | engines/hopkins/globals.h | 2 | ||||
-rw-r--r-- | engines/hopkins/hopkins.cpp | 12 | ||||
-rw-r--r-- | engines/hopkins/hopkins.h | 2 |
6 files changed, 21 insertions, 4 deletions
diff --git a/engines/hopkins/debugger.cpp b/engines/hopkins/debugger.cpp index 2e69c23318..d012f54e9c 100644 --- a/engines/hopkins/debugger.cpp +++ b/engines/hopkins/debugger.cpp @@ -33,6 +33,7 @@ Debugger::Debugger(HopkinsEngine *vm) : GUI::Debugger() { DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit)); DCmd_Register("rects", WRAP_METHOD(Debugger, cmd_DirtyRects)); DCmd_Register("teleport", WRAP_METHOD(Debugger, cmd_Teleport)); + DCmd_Register("show_room", WRAP_METHOD(Debugger, cmd_ShowCurrentRoom)); } // Turns dirty rects on or off @@ -57,4 +58,10 @@ bool Debugger::cmd_Teleport(int argc, const char **argv) { } } +// Display room number +bool Debugger::cmd_ShowCurrentRoom(int argc, const char **argv) { + DebugPrintf("Current room: %d\n", _vm->_globals->_curRoomNum); + return true; +} + } // End of namespace Hopkins diff --git a/engines/hopkins/debugger.h b/engines/hopkins/debugger.h index e7e8c7a270..7f7bffd755 100644 --- a/engines/hopkins/debugger.h +++ b/engines/hopkins/debugger.h @@ -40,6 +40,7 @@ public: bool cmd_DirtyRects(int argc, const char **argv); bool cmd_Teleport(int argc, const char **argv); + bool cmd_ShowCurrentRoom(int argc, const char **argv); }; } // End of namespace Hopkins diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp index 802c56e172..c63c875710 100644 --- a/engines/hopkins/globals.cpp +++ b/engines/hopkins/globals.cpp @@ -128,6 +128,7 @@ Globals::Globals(HopkinsEngine *vm) { _cityMapEnabledFl = false; _baseMapColor = 50; + _curRoomNum = 0; } Globals::~Globals() { diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h index 476ce5c62d..19845c7859 100644 --- a/engines/hopkins/globals.h +++ b/engines/hopkins/globals.h @@ -210,6 +210,8 @@ public: void setConfig(); void clearAll(); void loadCharacterData(); + + int _curRoomNum; }; // Global null pointer diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index 4072111bc7..ca76cf8ed8 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -202,6 +202,8 @@ bool HopkinsEngine::runWin95Demo() { if (shouldQuit()) return false; + _globals->_curRoomNum = _globals->_exitId; + switch (_globals->_exitId) { case 1: _linesManager->setMaxLineIdx(40); @@ -494,6 +496,8 @@ bool HopkinsEngine::runLinuxDemo() { if (shouldQuit()) return false; + _globals->_curRoomNum = _globals->_exitId; + switch (_globals->_exitId) { case 17: case 18: @@ -865,6 +869,8 @@ bool HopkinsEngine::runFull() { if (shouldQuit()) return false; + _globals->_curRoomNum = _globals->_exitId; + switch (_globals->_exitId) { case 1: _linesManager->setMaxLineIdx(40); @@ -1876,11 +1882,11 @@ void HopkinsEngine::displayNotAvailable() { _globals->_exitId = 4; } -void HopkinsEngine::handleNotAvailable(int sortie) { - // Use the code of the linux demo instead of the code of the Windows demo. +void HopkinsEngine::handleNotAvailable(int nextScreen) { + // Use the code of the Linux demo instead of the code of the Windows demo. // The behavior is somewhat better, and common code is easier to maintain. displayNotAvailable(); - _globals->_exitId = sortie; + _globals->_exitId = nextScreen; } void HopkinsEngine::displayEndDemo() { diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h index 629633e99f..37ea59e942 100644 --- a/engines/hopkins/hopkins.h +++ b/engines/hopkins/hopkins.h @@ -126,7 +126,7 @@ private: void loadCredits(); void displayCredits(int startPosY, byte *buffer, char color); void displayCredits(); - void handleNotAvailable(int sortie); + void handleNotAvailable(int nextScreen); bool runWin95Demo(); bool runLinuxDemo(); |