aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2016-03-29 23:08:37 -0400
committerPaul Gilbert2016-03-29 23:08:37 -0400
commitfee937c6ef5a47d3fdb3dd33af16fee1928c2691 (patch)
tree090ea4a5949ed658d34cb09ea136e09676395834 /engines
parentfe79317bdefe9594561cf45afe2ad476b1ac06ff (diff)
downloadscummvm-rg350-fee937c6ef5a47d3fdb3dd33af16fee1928c2691.tar.gz
scummvm-rg350-fee937c6ef5a47d3fdb3dd33af16fee1928c2691.tar.bz2
scummvm-rg350-fee937c6ef5a47d3fdb3dd33af16fee1928c2691.zip
TITANIC: Debugger command to turn PET on or off
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/debugger.cpp32
-rw-r--r--engines/titanic/debugger.h5
2 files changed, 34 insertions, 3 deletions
diff --git a/engines/titanic/debugger.cpp b/engines/titanic/debugger.cpp
index 3bd2d0f134..84f961e607 100644
--- a/engines/titanic/debugger.cpp
+++ b/engines/titanic/debugger.cpp
@@ -27,9 +27,10 @@
namespace Titanic {
Debugger::Debugger(TitanicEngine *vm) : GUI::Debugger(), _vm(vm) {
- registerCmd("continue", WRAP_METHOD(Debugger, cmdExit));
- registerCmd("dump", WRAP_METHOD(Debugger, cmdDump));
- registerCmd("room", WRAP_METHOD(Debugger, cmdRoom));
+ registerCmd("continue", WRAP_METHOD(Debugger, cmdExit));
+ registerCmd("dump", WRAP_METHOD(Debugger, cmdDump));
+ registerCmd("room", WRAP_METHOD(Debugger, cmdRoom));
+ registerCmd("pet", WRAP_METHOD(Debugger, cmdPET));
}
int Debugger::strToInt(const char *s) {
@@ -181,4 +182,29 @@ bool Debugger::cmdRoom(int argc, const char **argv) {
return true;
}
+bool Debugger::cmdPET(int argc, const char **argv) {
+ CGameManager &gameManager = *g_vm->_window->_gameManager;
+ CGameState &gameState = gameManager._gameState;
+
+ if (argc == 2) {
+ CString s(argv[1]);
+ s.toLowercase();
+
+ if (s == "on") {
+ gameState._petActive = true;
+ gameManager.update();
+ debugPrintf("PET is now on\n");
+ return true;
+ } else if (s == "off") {
+ gameState._petActive = false;
+ gameManager.update();
+ debugPrintf("PET is now off\n");
+ return true;
+ }
+ }
+
+ debugPrintf("%s [on | off]\n", argv[0]);
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/debugger.h b/engines/titanic/debugger.h
index 2f3bb91a46..29e82d699f 100644
--- a/engines/titanic/debugger.h
+++ b/engines/titanic/debugger.h
@@ -79,6 +79,11 @@ private:
* List room details, or jump to a specific view
*/
bool cmdRoom(int argc, const char **argv);
+
+ /**
+ * Turn the PET on or off
+ */
+ bool cmdPET(int argc, const char **argv);
protected:
TitanicEngine *_vm;
public: