aboutsummaryrefslogtreecommitdiff
path: root/debug.cpp
diff options
context:
space:
mode:
authorLudvig Strigeus2001-11-07 18:10:52 +0000
committerLudvig Strigeus2001-11-07 18:10:52 +0000
commit6cd4b9d71fef40444e0b6fc47dab0c5c9fe46a5f (patch)
treeb38aef7acef2a740bf4599fd8c0a07107002f418 /debug.cpp
parente55d303f22e9de21261fea6577df901550083a58 (diff)
downloadscummvm-rg350-6cd4b9d71fef40444e0b6fc47dab0c5c9fe46a5f.tar.gz
scummvm-rg350-6cd4b9d71fef40444e0b6fc47dab0c5c9fe46a5f.tar.bz2
scummvm-rg350-6cd4b9d71fef40444e0b6fc47dab0c5c9fe46a5f.zip
debugger fix,
removed hardcoded constants, resouce lock state is now saved in the savegame, fixed bug with MI1 svn-id: r3470
Diffstat (limited to 'debug.cpp')
-rw-r--r--debug.cpp31
1 files changed, 19 insertions, 12 deletions
diff --git a/debug.cpp b/debug.cpp
index b5e1dd2aa1..a5688ba6a8 100644
--- a/debug.cpp
+++ b/debug.cpp
@@ -30,6 +30,7 @@ enum {
CMD_GO,
CMD_ACTOR,
CMD_SCRIPTS,
+ CMD_EXIT
};
void ScummDebugger::attach(Scumm *s) {
@@ -48,12 +49,14 @@ bool ScummDebugger::do_command() {
switch(get_command()) {
case CMD_HELP:
- printf("Debugger commands:\n"
- "help -> display this help text\n"
- "quit -> quit the debugger\n"
- "go [numframes] -> increase frame\n"
- "actor [actornum] -> show actor information\n"
- "scripts -> show running scripts\n"
+ printf(
+ "Debugger commands:\n"
+ "(h)elp -> display this help text\n"
+ "(q)uit -> quit the debugger\n"
+ "(g)o [numframes] -> increase frame\n"
+ "(a)ctor [actornum] -> show actor information\n"
+ "(s)cripts -> show running scripts\n"
+ "(e)xit -> exit game\n"
);
return true;
@@ -76,7 +79,10 @@ bool ScummDebugger::do_command() {
case CMD_SCRIPTS:
printScripts();
return true;
+ case CMD_EXIT:
+ exit(1);
}
+ /* this line is never reached */
}
void ScummDebugger::enter() {
@@ -114,6 +120,7 @@ static const DebuggerCommands debugger_commands[] = {
{ "g", 1, CMD_GO },
{ "a", 1, CMD_ACTOR },
{ "s", 1, CMD_SCRIPTS },
+ { "e", 1, CMD_EXIT },
{ 0, 0, 0 },
};
@@ -155,18 +162,18 @@ void ScummDebugger::printActors(int act) {
int i;
Actor *a;
- if (act==-1) {
- printf("+--------------------------------------------------------------+\n");
- printf("|# |room| x y |elev|cos|width|box|mov|zp|frame|scale|spd|dir|\n");
- printf("+--+----+--------+----+---+-----+---+---+--+-----+-----+---+---+\n");
- for(i=1; i<13; i++) {
+ printf("+--------------------------------------------------------------+\n");
+ printf("|# |room| x y |elev|cos|width|box|mov|zp|frame|scale|spd|dir|\n");
+ printf("+--+----+--------+----+---+-----+---+---+--+-----+-----+---+---+\n");
+ for(i=1; i<13; i++) {
+ if (act==-1 || act==i) {
a = &_s->actor[i];
if (a->visible)
printf("|%2d|%4d|%3d %3d|%4d|%3d|%5d|%3d|%3d|%2d|%5d|%5d|%3d|%3d|\n",
i,a->room,a->x,a->y,a->elevation,a->costume,a->width,a->walkbox,a->moving,a->neverZClip,a->animIndex,a->scalex,a->speedx,a->facing);
}
- printf("+--------------------------------------------------------------+\n");
}
+ printf("+--------------------------------------------------------------+\n");
}
void ScummDebugger::printScripts() {