aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/debug.cpp
diff options
context:
space:
mode:
authorDavid Corrales2007-05-26 20:23:24 +0000
committerDavid Corrales2007-05-26 20:23:24 +0000
commit3646c968c9578c2a94d65ebd5fb06ec835f8c51d (patch)
tree8b57b339ebb31a1d7a67f1678aa5dc5c7759070a /engines/parallaction/debug.cpp
parentd1f56d93f934150f4b579c2e90564e2bf035f113 (diff)
parentac45c5b33d834acbc9718f89be76e49d403a4d2c (diff)
downloadscummvm-rg350-3646c968c9578c2a94d65ebd5fb06ec835f8c51d.tar.gz
scummvm-rg350-3646c968c9578c2a94d65ebd5fb06ec835f8c51d.tar.bz2
scummvm-rg350-3646c968c9578c2a94d65ebd5fb06ec835f8c51d.zip
Merged the fs branch with trunk. r26472:26948
svn-id: r26949
Diffstat (limited to 'engines/parallaction/debug.cpp')
-rw-r--r--engines/parallaction/debug.cpp168
1 files changed, 140 insertions, 28 deletions
diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp
index 9b4b0e8932..9b48a187cc 100644
--- a/engines/parallaction/debug.cpp
+++ b/engines/parallaction/debug.cpp
@@ -23,45 +23,157 @@
#include "common/stdafx.h"
#include "common/system.h"
+
#include "parallaction/parallaction.h"
-#include "parallaction/graphics.h"
+#include "parallaction/debug.h"
namespace Parallaction {
const char *_jobDescriptions[] = {
- "0 - draw label",
- "1 - draw mouse",
- "2 - delay remove Job (erase label) || show inventory",
- "3 - draw animations",
- "4 - NONE",
- "5 - NONE",
- "6 - NONE",
- "7 - NONE",
- "8 - NONE",
- "9 - NONE",
- "10 - NONE",
- "11 - NONE",
- "12 - NONE",
- "13 - NONE",
- "14 - NONE",
- "15 - delay remove Job (erase label) || run scripts || erase animations",
- "16 - NONE",
- "17 - job_12d4 (put item on screen) || jobRemovePickedItem (remove item from screen)",
- "18 - toggle door",
- "19 - walk",
- "20 - erase label || hide inventory",
- "21 - erase mouse"
+ "draw label",
+ "draw mouse",
+ "delayed label deletion || show inventory",
+ "draw animations",
+ "NONE",
+ "NONE",
+ "NONE",
+ "NONE",
+ "NONE",
+ "NONE",
+ "NONE",
+ "NONE",
+ "NONE",
+ "NONE",
+ "NONE",
+ "delayed label deletion || run scripts || erase animations",
+ "NONE",
+ "put item || pickup item",
+ "toggle door",
+ "walk",
+ "erase label || hide inventory",
+ "erase mouse"
};
-void beep() {
-// sound(1500);
-// delay(100);
-// nosound();
- return;
+Debugger::Debugger(Parallaction *vm)
+ : GUI::Debugger() {
+ _vm = vm;
+
+ DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit));
+ DCmd_Register("location", WRAP_METHOD(Debugger, Cmd_Location));
+ DCmd_Register("give", WRAP_METHOD(Debugger, Cmd_Give));
+ DCmd_Register("jobs", WRAP_METHOD(Debugger, Cmd_Jobs));
+ DCmd_Register("zones", WRAP_METHOD(Debugger, Cmd_Zones));
+ DCmd_Register("animations", WRAP_METHOD(Debugger, Cmd_Animations));
+
+
+}
+
+
+void Debugger::preEnter() {
+}
+
+
+void Debugger::postEnter() {
}
+bool Debugger::Cmd_Location(int argc, const char **argv) {
+ char *character = _vm->_characterName;
+ char *location = _vm->_location._name;
+ switch (argc) {
+ case 3:
+ character = const_cast<char*>(argv[2]);
+ location = const_cast<char*>(argv[1]);
+ sprintf(_vm->_location._name, "%s.%s", location, character);
+ // TODO: check if location exists
+ _engineFlags |= kEngineChangeLocation;
+ break;
+
+ case 2:
+ location = const_cast<char*>(argv[1]);
+ sprintf(_vm->_location._name, "%s", location);
+ // TODO: check if location exists
+ _engineFlags |= kEngineChangeLocation;
+ break;
+
+ case 1:
+ DebugPrintf("location <location name> [character name]\n");
+
+ }
+
+ return true;
+}
+
+
+bool Debugger::Cmd_Give(int argc, const char **argv) {
+
+ if (argc == 1) {
+ DebugPrintf("give <item name>\n");
+ } else {
+ int index = _vm->_objectsNames->lookup(argv[1]);
+ if (index != -1)
+ _vm->addInventoryItem(index + 4);
+ else
+ DebugPrintf("invalid item name '%s'\n", argv[1]);
+ }
+
+ return true;
+}
+
+
+bool Debugger::Cmd_Jobs(int argc, const char **argv) {
+
+ JobList::iterator b = _vm->_jobs.begin();
+ JobList::iterator e = _vm->_jobs.end();
+
+ DebugPrintf("+---+-------------------------------------------------------------+\n"
+ "|tag| description |\n"
+ "+---+-------------------------------------------------------------+\n");
+ for ( ; b != e; b++) {
+ DebugPrintf("|%3i| %-60s|\n", (*b)->_tag, _jobDescriptions[(*b)->_tag] );
+ }
+ DebugPrintf("+---+-------------------------------------------------------------+\n");
+
+
+ return true;
+}
+
+bool Debugger::Cmd_Zones(int argc, const char **argv) {
+
+ ZoneList::iterator b = _vm->_zones.begin();
+ ZoneList::iterator e = _vm->_zones.end();
+
+ DebugPrintf("+--------------------+---+---+---+---+--------+--------+\n"
+ "| name | l | t | r | b | type | flag |\n"
+ "+--------------------+---+---+---+---+--------+--------+\n");
+ for ( ; b != e; b++) {
+ Zone *z = *b;
+ DebugPrintf("|%-20s|%3i|%3i|%3i|%3i|%8x|%8x|\n", z->_label._text, z->_left, z->_top, z->_right, z->_bottom, z->_type, z->_flags );
+ }
+ DebugPrintf("+--------------------+---+---+---+---+--------+--------+\n");
+
+
+ return true;
+}
+
+bool Debugger::Cmd_Animations(int argc, const char **argv) {
+
+ AnimationList::iterator b = _vm->_animations.begin();
+ AnimationList::iterator e = _vm->_animations.end();
+
+ DebugPrintf("+--------------------+---+---+---+---+--------+--------+\n"
+ "| name | x | y | z | f | type | flag | \n"
+ "+--------------------+---+---+---+---+--------+--------+\n");
+ for ( ; b != e; b++) {
+ Animation *a = *b;
+ DebugPrintf("|%-20s|%3i|%3i|%3i|%3i|%8x|%8x|\n", a->_label._text, a->_left, a->_top, a->_z, a->_frame, a->_type, a->_flags );
+ }
+ DebugPrintf("+--------------------+---+---+---+---+--------+--------+\n");
+
+
+ return true;
+}
} // namespace Parallaction