[Scummvm-cvs-logs] scummvm master -> 4df049f4d7fccb794db45c932e5188296907dbc8

bluegr md5 at scummvm.org
Sun Mar 20 13:58:15 CET 2011


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a43689550e SCI: Removed forward references to obsolete classes
4df049f4d7 SCI: Added a new console command "window_list" or "wl"


Commit: a43689550e46b0d2299de48c777848adaca9f189
    https://github.com/scummvm/scummvm/commit/a43689550e46b0d2299de48c777848adaca9f189
Author: md5 (md5 at scummvm.org)
Date: 2011-03-20T05:54:36-07:00

Commit Message:
SCI: Removed forward references to obsolete classes

Changed paths:
    engines/sci/graphics/paint16.h
    engines/sci/sci.h



diff --git a/engines/sci/graphics/paint16.h b/engines/sci/graphics/paint16.h
index 4f709fd..69ddf09 100644
--- a/engines/sci/graphics/paint16.h
+++ b/engines/sci/graphics/paint16.h
@@ -36,7 +36,6 @@ class GfxPorts;
 class GfxScreen;
 class GfxPalette;
 class Font;
-class SciGuiPicture;
 class GfxView;
 
 /**
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index 26ddb00..cd50b24 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -77,7 +77,6 @@ class GfxText16;
 class GfxTransitions;
 
 #ifdef ENABLE_SCI32
-class SciGui32;
 class RobotDecoder;
 class GfxFrameout;
 #endif


Commit: 4df049f4d7fccb794db45c932e5188296907dbc8
    https://github.com/scummvm/scummvm/commit/4df049f4d7fccb794db45c932e5188296907dbc8
Author: md5 (md5 at scummvm.org)
Date: 2011-03-20T05:56:13-07:00

Commit Message:
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

Changed paths:
    engines/sci/console.cpp
    engines/sci/console.h
    engines/sci/graphics/ports.cpp
    engines/sci/graphics/ports.h



diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 1174bf8..93d21c3 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());
diff --git a/engines/sci/console.h b/engines/sci/console.h
index 9247339..93ccc45 100644
--- a/engines/sci/console.h
+++ b/engines/sci/console.h
@@ -96,6 +96,7 @@ private:
 	bool cmdPicVisualize(int argc, const char **argv);
 	bool cmdPlayVideo(int argc, const char **argv);
 	bool cmdAnimateList(int argc, const char **argv);
+	bool cmdWindowList(int argc, const char **argv);
 	// Segments
 	bool cmdPrintSegmentTable(int argc, const char **argv);
 	bool cmdSegmentInfo(int argc, const char **argv);
diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp
index 9ac8d10..aca278f 100644
--- a/engines/sci/graphics/ports.cpp
+++ b/engines/sci/graphics/ports.cpp
@@ -25,6 +25,7 @@
 
 #include "common/util.h"
 
+#include "sci/console.h"
 #include "sci/sci.h"
 #include "sci/engine/features.h"
 #include "sci/engine/kernel.h"
@@ -707,4 +708,16 @@ int16 GfxPorts::kernelPriorityToCoordinate(byte priority) {
 	return _priorityBottom;
 }
 
+void GfxPorts::printWindowList(Console *con) {
+	for (PortList::const_iterator it = _windowList.begin(); it != _windowList.end(); ++it) {
+		if ((*it)->isWindow()) {
+			Window *wnd = ((Window *)*it);
+			con->DebugPrintf("%d: '%s' at %d, %d, (%d, %d, %d, %d), drawn: %d, style: %d\n",
+					wnd->id, wnd->title.c_str(), wnd->left, wnd->top, 
+					wnd->rect.left, wnd->rect.top, wnd->rect.right, wnd->rect.bottom,
+					wnd->bDrawn, wnd->wndStyle);
+		}
+	}
+}
+
 } // End of namespace Sci
diff --git a/engines/sci/graphics/ports.h b/engines/sci/graphics/ports.h
index 9faee2b..d142727 100644
--- a/engines/sci/graphics/ports.h
+++ b/engines/sci/graphics/ports.h
@@ -32,7 +32,6 @@
 
 namespace Sci {
 
-class SciGui;
 class GfxPaint16;
 class GfxScreen;
 class GfxText16;
@@ -103,6 +102,7 @@ public:
 	void kernelGraphAdjustPriority(int top, int bottom);
 	byte kernelCoordinateToPriority(int16 y);
 	int16 kernelPriorityToCoordinate(byte priority);
+	void printWindowList(Console *con);
 
 	Port *_wmgrPort;
 	Window *_picWind;






More information about the Scummvm-git-logs mailing list