aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBendegúz Nagy2016-08-10 17:09:37 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commit6279c566152203fd761cae9b7333f27320730261 (patch)
treef3065d2895a28f8c37b0ab2219f7c6eff58dd30a
parent5955b8d9ca3a6daa05945a7c93517f0ece7b8afe (diff)
downloadscummvm-rg350-6279c566152203fd761cae9b7333f27320730261.tar.gz
scummvm-rg350-6279c566152203fd761cae9b7333f27320730261.tar.bz2
scummvm-rg350-6279c566152203fd761cae9b7333f27320730261.zip
DM: Add debug command 'items', add option 'list'
-rw-r--r--engines/dm/console.cpp22
-rw-r--r--engines/dm/console.h4
-rw-r--r--engines/dm/objectman.h1
3 files changed, 23 insertions, 4 deletions
diff --git a/engines/dm/console.cpp b/engines/dm/console.cpp
index 703bd23e34..1145165612 100644
--- a/engines/dm/console.cpp
+++ b/engines/dm/console.cpp
@@ -30,6 +30,7 @@
#include "champion.h"
#include "dungeonman.h"
#include "movesens.h"
+#include "objectman.h"
namespace DM {
@@ -58,6 +59,7 @@ Console::Console(DM::DMEngine* vm) : _vm(vm) {
registerCmd("noclip", WRAP_METHOD(Console, Cmd_noclip));
registerCmd("pos", WRAP_METHOD(Console, Cmd_pos));
registerCmd("map", WRAP_METHOD(Console, Cmd_map));
+ registerCmd("items", WRAP_METHOD(Console, Cmd_items));
}
bool Console::Cmd_godmode(int argc, const char** argv) {
@@ -188,4 +190,24 @@ argumentError:
debugPrintf("Usage: %s get\nUsage: %s set <#>\n", argv[0], argv[0]);
return true;
}
+
+bool Console::Cmd_items(int argc, const char** argv) {
+ if (argc == 2 && cstrEquals("list", argv[1])) {
+ debugPrintf("| %s", _vm->_objectMan->_g352_objectNames[0]);
+ for (uint16 i = 1; i < k199_ObjectNameCount; ++i) {
+ const char *name = _vm->_objectMan->_g352_objectNames[i - 1];
+ const char *prevName = _vm->_objectMan->_g352_objectNames[i];
+ if (!cstrEquals(prevName, name))
+ debugPrintf(" | %s", name);
+ if (i % 5 == 0)
+ debugPrintf("\n");
+ }
+ debugPrintf("\n");
+ } else {
+ debugPrintf("Usage: %s list\n", argv[0]);
+ return true;
+ }
+ return true;
+}
+
}
diff --git a/engines/dm/console.h b/engines/dm/console.h
index 9493b353a4..461c89f2bc 100644
--- a/engines/dm/console.h
+++ b/engines/dm/console.h
@@ -51,11 +51,9 @@ public:
bool _debugNoclip;
bool Cmd_noclip(int argc, const char **argv);
- // Cmd_pos
bool Cmd_pos(int argc, const char **argv);
-
- // Cmd_map
bool Cmd_map(int argc, const char **argv);
+ bool Cmd_items(int argc, const char **argv);
};
}
diff --git a/engines/dm/objectman.h b/engines/dm/objectman.h
index 3b55e194f9..1aa4c54637 100644
--- a/engines/dm/objectman.h
+++ b/engines/dm/objectman.h
@@ -66,7 +66,6 @@ public:
IconIndice f39_getIconIndexInSlotBox(uint16 slotBoxIndex); // @ F0039_OBJECT_GetIconIndexInSlotBox
void f35_clearLeaderObjectName(); // @ F0035_OBJECT_ClearLeaderHandObjectName
void f37_drawIconToScreen(int16 iconIndex, int16 posX, int16 posY); // @ F0037_OBJECT_DrawIconToScreen
-
};
}