[Scummvm-cvs-logs] CVS: scummvm/scumm debugger.cpp,1.64,1.65
James Brown
ender at users.sourceforge.net
Wed Jul 9 06:24:03 CEST 2003
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv24895/scumm
Modified Files:
debugger.cpp
Log Message:
Patch #768217: Apply Mankeli's 'object state' debugger command
Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- debugger.cpp 3 Jul 2003 22:06:10 -0000 1.64
+++ debugger.cpp 9 Jul 2003 13:23:16 -0000 1.65
@@ -53,7 +53,7 @@
if (entry)
errStr = strdup(entry);
-
+
_s = s;
s->_debugger = this;
_frame_countdown = 1;
@@ -113,7 +113,7 @@
_s->_debuggerDialog->setCompletionCallback(0, 0);
}
#endif
-
+
_s->_debugger = NULL;
_s = NULL;
_detach_now = false;
@@ -124,17 +124,17 @@
if (_frame_countdown == 0)
return;
--_frame_countdown;
-
+
if (!_frame_countdown) {
// Pause sound output
bool old_soundsPaused = _s->_sound->_soundsPaused;
_s->_sound->pauseSounds(true);
-
+
// Enter debugger
enter();
-
+
_s->_sound->pauseSounds(old_soundsPaused); // Resume previous sound state
-
+
if (_detach_now) // Detach if we're finished with the debugger
detach();
}
@@ -144,7 +144,7 @@
#if USE_CONSOLE
bool ScummDebugger::debuggerInputCallback(ConsoleDialog *console, const char *input, void *refCon) {
ScummDebugger *debugger = (ScummDebugger *)refCon;
-
+
return debugger->RunCommand(input);
}
@@ -167,7 +167,7 @@
_dvars[_dvar_count].type = type;
_dvars[_dvar_count].variable = pointer;
_dvars[_dvar_count].optional = optional;
-
+
_dvar_count++;
}
@@ -175,11 +175,11 @@
assert(_dcmd_count < (int)sizeof(_dcmds));
strcpy(_dcmds[_dcmd_count].name, cmdname);
_dcmds[_dcmd_count].function = pointer;
-
+
_dcmd_count++;
}
-// Main Debugger Loop
+// Main Debugger Loop
void ScummDebugger::enter() {
#if USE_CONSOLE
if (!_s->_debuggerDialog) {
@@ -194,7 +194,7 @@
free(errStr);
errStr = NULL;
}
-
+
_s->_debuggerDialog->setInputeCallback(debuggerInputCallback, this);
_s->_debuggerDialog->setCompletionCallback(debuggerCompletionCallback,
this);
@@ -206,7 +206,7 @@
// Or maybe instead of choosing between a console dialog and stdio,
// we should move that choice into the ConsoleDialog class - that is,
// the console dialog code could be #ifdef'ed to not print to the dialog
- // but rather to stdio. This way, we could also reuse the command history
+ // but rather to stdio. This way, we could also reuse the command history
// and tab completion of the console. It would still require a lot of
// work, but at least no dependency on a 3rd party library...
@@ -236,7 +236,7 @@
int i = 0, num_params = 0;
const char *param[256];
char *input = strdup(inputOrig); // One of the rare occasions using strdup is OK (although avoiding strtok might be more elegant here).
-
+
// Parse out any params
char *tok = strtok(input, " ");
if (tok) {
@@ -280,10 +280,10 @@
} else {
var[element] = atoi(param[1]);
Debug_Printf("(int)%s = %d\n", param[0], var[element]);
-
+
}
}
- }
+ }
break;
default:
@@ -310,7 +310,7 @@
Debug_Printf("%s is out of range (array is %d elements big)\n", param[0], _dvars[i].optional);
} else {
Debug_Printf("(int)%s = %d\n", param[0], var[element]);
-
+
}
}
}
@@ -650,8 +650,13 @@
_s->removeObjectFromRoom(obj);
_s->clearDrawObjectQueue();
_s->runInventoryScript(obj);
+
+ } else if (!strcmp(argv[2], "state")) {
+ _s->putState(obj, atoi(argv[3]));
+ //is BgNeedsRedraw enough?
+ _s->_BgNeedsRedraw = TRUE;
} else {
- Debug_Printf("Unknown object command '%s'\nRight now the only command is pickup", argv[2]); //change when adding commands
+ Debug_Printf("Unknown object command '%s'\nUse <pickup | state> as command\n", argv[2]);
}
return true;
@@ -765,7 +770,7 @@
coords.ul.x, coords.ul.y, coords.ll.x, coords.ll.y,
coords.ur.x, coords.ur.y, coords.lr.x, coords.lr.y,
flags, mask, scale);
-
+
// Draw the box
drawBox(box);
}
@@ -787,7 +792,7 @@
if (x2 < x1)
SWAP(x2, x1);
-
+
// Clip x1 / x2
const int left = scumm->_screenStartStrip * 8;
const int right = scumm->_screenEndStrip * 8;
@@ -795,7 +800,7 @@
x1 = left;
if (x2 >= right)
x2 = right - 1;
-
+
ptr = vs->screenPtr + x1 + y * scumm->_screenWidth;
@@ -912,7 +917,7 @@
15162, 15676, 16190, 64, 16961, 17475, 17989, 18503,
73, 19274, 76, 77, 20302, 20816, 21330, 84
};
-
+
const char *notes = "cdefgabC";
int i, base, draft;
More information about the Scummvm-git-logs
mailing list