Skip to content

Commit

Permalink
SCUMM: Add actor/object names to debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
salty-horse committed Jul 2, 2016
1 parent 948e448 commit cfeae98
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions engines/scumm/debugger.cpp
Expand Up @@ -411,14 +411,15 @@ bool ScummDebugger::Cmd_PrintActor(int argc, const char **argv) {
int i;
Actor *a;

debugPrintf("+---------------------------------------------------------------+\n");
debugPrintf("|# | x | y | w | h |elev|cos|box|mov| zp|frm|scl|dir| cls |\n");
debugPrintf("+--+----+----+---+---+----+---+---+---+---+---+---+---+---------+\n");
debugPrintf("+----------------------------------------------------------------------------+\n");
debugPrintf("|# | name | x | y | w | h |elev|cos|box|mov| zp|frm|scl|dir| cls |\n");
debugPrintf("+--+------------+----+----+---+---+----+---+---+---+---+---+---+---+---------+\n");
for (i = 1; i < _vm->_numActors; i++) {
a = _vm->_actors[i];
const byte *name = _vm->getObjOrActorName(_vm->actorToObj(a->_number));
if (a->_visible)
debugPrintf("|%2d|%4d|%4d|%3d|%3d|%4d|%3d|%3d|%3d|%3d|%3d|%3d|%3d|$%08x|\n",
a->_number, a->getRealPos().x, a->getRealPos().y, a->_width, a->_bottom - a->_top,
debugPrintf("|%2d|%-12.12s|%4d|%4d|%3d|%3d|%4d|%3d|%3d|%3d|%3d|%3d|%3d|%3d|$%08x|\n",
a->_number, name, a->getRealPos().x, a->getRealPos().y, a->_width, a->_bottom - a->_top,
a->getElevation(),
a->_costume, a->_walkbox, a->_moving, a->_forceClip, a->_frame,
a->_scalex, a->getFacing(), _vm->_classData[a->_number]);
Expand All @@ -431,17 +432,18 @@ bool ScummDebugger::Cmd_PrintObjects(int argc, const char **argv) {
int i;
ObjectData *o;
debugPrintf("Objects in current room\n");
debugPrintf("+---------------------------------+------------+\n");
debugPrintf("|num | x | y |width|height|state|fl| cls |\n");
debugPrintf("+----+----+----+-----+------+-----+--+---------+\n");
debugPrintf("+-----------------------------------------------------------+\n");
debugPrintf("|num | name | x | y |width|height|state|fl| cls |\n");
debugPrintf("+----+------------+----+----+-----+------+-----+--+---------+\n");

for (i = 1; i < _vm->_numLocalObjects; i++) {
o = &(_vm->_objs[i]);
if (o->obj_nr == 0)
continue;
int classData = (_vm->_game.version != 0 ? _vm->_classData[o->obj_nr] : 0);
debugPrintf("|%4d|%4d|%4d|%5d|%6d|%5d|%2d|$%08x|\n",
o->obj_nr, o->x_pos, o->y_pos, o->width, o->height, o->state,
const byte *name = _vm->getObjOrActorName(o->obj_nr);
debugPrintf("|%4d|%-12.12s|%4d|%4d|%5d|%6d|%5d|%2d|$%08x|\n",
o->obj_nr, name, o->x_pos, o->y_pos, o->width, o->height, o->state,
o->fl_object_index, classData);
}
debugPrintf("\n");
Expand Down

0 comments on commit cfeae98

Please sign in to comment.