SCI: Added a new console command "window_list" or "wl"

This can be used to see a list of the currently open windows. Also, added
a sanity check for the "al" command and performed some minor cleanup
This commit is contained in:
md5 2011-03-20 14:56:13 +02:00
parent a43689550e
commit 4df049f4d7
4 changed files with 31 additions and 6 deletions

View file

@ -48,6 +48,7 @@
#include "sci/graphics/paint16.h"
#include "sci/graphics/paint32.h"
#include "sci/graphics/palette.h"
#include "sci/graphics/ports.h"
#include "sci/graphics/view.h"
#include "sci/parser/vocabulary.h"
@ -128,6 +129,8 @@ Console::Console(SciEngine *engine) : GUI::Debugger(),
DCmd_Register("play_video", WRAP_METHOD(Console, cmdPlayVideo));
DCmd_Register("animate_list", WRAP_METHOD(Console, cmdAnimateList));
DCmd_Register("al", WRAP_METHOD(Console, cmdAnimateList)); // alias
DCmd_Register("window_list", WRAP_METHOD(Console, cmdWindowList));
DCmd_Register("wl", WRAP_METHOD(Console, cmdWindowList)); // alias
// Segments
DCmd_Register("segment_table", WRAP_METHOD(Console, cmdPrintSegmentTable));
DCmd_Register("segtable", WRAP_METHOD(Console, cmdPrintSegmentTable)); // alias
@ -1582,11 +1585,21 @@ bool Console::cmdPlayVideo(int argc, const char **argv) {
}
bool Console::cmdAnimateList(int argc, const char **argv) {
DebugPrintf("Animate list:\n");
_engine->_gfxAnimate->printAnimateList(this);
if (_engine->_gfxAnimate) {
DebugPrintf("Animate list:\n");
_engine->_gfxAnimate->printAnimateList(this);
}
return true;
}
bool Console::cmdWindowList(int argc, const char **argv) {
if (_engine->_gfxPorts) {
DebugPrintf("Window list:\n");
_engine->_gfxPorts->printWindowList(this);
}
return true;
}
bool Console::cmdParseGrammar(int argc, const char **argv) {
DebugPrintf("Parse grammar, in strict GNF:\n");
@ -1721,9 +1734,7 @@ bool Console::segmentInfo(int nr) {
for (uint i = 0; i < ct->_table.size(); i++)
if (ct->isValidEntry(i)) {
reg_t objpos;
objpos.offset = i;
objpos.segment = nr;
reg_t objpos = make_reg(nr, i);
DebugPrintf(" [%04x] %s; copy of ", i, _engine->_gamestate->_segMan->getObjectName(objpos));
// Object header
const Object *obj = _engine->_gamestate->_segMan->getObject(ct->_table[i].getPos());