[Scummvm-cvs-logs] scummvm master -> 566ec81d8db163f2a1671d98b509e8ae08acfef9
Strangerke
Strangerke at scummvm.org
Fri Mar 29 19:48:34 CET 2013
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
566ec81d8d HOPKINS: Add a debug function to display current scene number
Commit: 566ec81d8db163f2a1671d98b509e8ae08acfef9
https://github.com/scummvm/scummvm/commit/566ec81d8db163f2a1671d98b509e8ae08acfef9
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-03-29T11:47:40-07:00
Commit Message:
HOPKINS: Add a debug function to display current scene number
Changed paths:
engines/hopkins/debugger.cpp
engines/hopkins/debugger.h
engines/hopkins/globals.cpp
engines/hopkins/globals.h
engines/hopkins/hopkins.cpp
engines/hopkins/hopkins.h
diff --git a/engines/hopkins/debugger.cpp b/engines/hopkins/debugger.cpp
index 2e69c23..d012f54 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 e7e8c7a..7f7bffd 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 802c56e..c63c875 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 476ce5c..19845c7 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 4072111..ca76cf8 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 629633e..37ea59e 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();
More information about the Scummvm-git-logs
mailing list