aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/console.cpp
diff options
context:
space:
mode:
authormd52011-03-20 14:56:13 +0200
committermd52011-03-20 14:56:13 +0200
commit4df049f4d7fccb794db45c932e5188296907dbc8 (patch)
treeb1bc62e43c1bf9b489fd6d24ce3ee04f87dd04a3 /engines/sci/console.cpp
parenta43689550e46b0d2299de48c777848adaca9f189 (diff)
downloadscummvm-rg350-4df049f4d7fccb794db45c932e5188296907dbc8.tar.gz
scummvm-rg350-4df049f4d7fccb794db45c932e5188296907dbc8.tar.bz2
scummvm-rg350-4df049f4d7fccb794db45c932e5188296907dbc8.zip
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
Diffstat (limited to 'engines/sci/console.cpp')
-rw-r--r--engines/sci/console.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 1174bf8528..93d21c32e0 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -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());