[Scummvm-cvs-logs] SF.net SVN: scummvm:[41032] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat May 30 16:30:39 CEST 2009


Revision: 41032
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41032&view=rev
Author:   thebluegr
Date:     2009-05-30 14:30:39 +0000 (Sat, 30 May 2009)

Log Message:
-----------
Moved 3 more debug commands to console.cpp ("simkey", "segment_table" and "show_map") and removed the GFXWC macro. Some cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/sci/console.cpp
    scummvm/trunk/engines/sci/console.h
    scummvm/trunk/engines/sci/engine/game.cpp
    scummvm/trunk/engines/sci/engine/gc.cpp
    scummvm/trunk/engines/sci/engine/kernel.h
    scummvm/trunk/engines/sci/engine/kevent.cpp
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/kmenu.cpp
    scummvm/trunk/engines/sci/engine/scriptdebug.cpp
    scummvm/trunk/engines/sci/gfx/gfx_gui.cpp
    scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp
    scummvm/trunk/engines/sci/gfx/gfx_widgets.h

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2009-05-30 14:13:27 UTC (rev 41031)
+++ scummvm/trunk/engines/sci/console.cpp	2009-05-30 14:30:39 UTC (rev 41032)
@@ -41,6 +41,8 @@
 
 extern EngineState *g_EngineState;
 
+int _kdebug_cheap_event_hack = 0;
+
 Console::Console(SciEngine *vm) : GUI::Debugger() {
 	_vm = vm;
 
@@ -71,6 +73,9 @@
 	DCmd_Register("visual_state",		WRAP_METHOD(Console, cmdVisualState));
 	DCmd_Register("dynamic_views",		WRAP_METHOD(Console, cmdDynamicViews));
 	DCmd_Register("dropped_views",		WRAP_METHOD(Console, cmdDroppedViews));
+	DCmd_Register("simkey",				WRAP_METHOD(Console, cmdSimulateKey));
+	DCmd_Register("segment_table",		WRAP_METHOD(Console, cmdPrintSegmentTable));
+	DCmd_Register("show_map",			WRAP_METHOD(Console, cmdShowMap));
 	DCmd_Register("gc",					WRAP_METHOD(Console, cmdInvokeGC));
 	DCmd_Register("gc_objects",			WRAP_METHOD(Console, cmdGCObjects));
 	DCmd_Register("exit",				WRAP_METHOD(Console, cmdExit));
@@ -607,6 +612,121 @@
 	return true;
 }
 
+bool Console::cmdSimulateKey(int argc, const char **argv) {
+	if (argc != 2) {
+		DebugPrintf("Simulate a keypress with the specified scancode\n");
+		DebugPrintf("Usage: %s <key scan code>\n", argv[0]);
+		return true;
+	}
+
+	_kdebug_cheap_event_hack = atoi(argv[1]);
+
+	return true;
+}
+
+bool Console::cmdPrintSegmentTable(int argc, const char **argv) {
+	DebugPrintf("Segment table:\n");
+
+	for (uint i = 0; i < g_EngineState->seg_manager->_heap.size(); i++) {
+		MemObject *mobj = g_EngineState->seg_manager->_heap[i];
+		if (mobj && mobj->getType()) {
+			DebugPrintf(" [%04x] ", i);
+
+			switch (mobj->getType()) {
+			case MEM_OBJ_SCRIPT:
+				DebugPrintf("S  script.%03d l:%d ", (*(Script *)mobj).nr, (*(Script *)mobj).lockers);
+				break;
+
+			case MEM_OBJ_CLONES:
+				DebugPrintf("C  clones (%d allocd)", (*(CloneTable *)mobj).entries_used);
+				break;
+
+			case MEM_OBJ_LOCALS:
+				DebugPrintf("V  locals %03d", (*(LocalVariables *)mobj).script_id);
+				break;
+
+			case MEM_OBJ_STACK:
+				DebugPrintf("D  data stack (%d)", (*(DataStack *)mobj).nr);
+				break;
+
+			case MEM_OBJ_SYS_STRINGS:
+				DebugPrintf("Y  system string table");
+				break;
+
+			case MEM_OBJ_LISTS:
+				DebugPrintf("L  lists (%d)", (*(ListTable *)mobj).entries_used);
+				break;
+
+			case MEM_OBJ_NODES:
+				DebugPrintf("N  nodes (%d)", (*(NodeTable *)mobj).entries_used);
+				break;
+
+			case MEM_OBJ_HUNK:
+				DebugPrintf("H  hunk (%d)", (*(HunkTable *)mobj).entries_used);
+				break;
+
+			case MEM_OBJ_DYNMEM:
+				DebugPrintf("M  dynmem: %d bytes", (*(DynMem *)mobj)._size);
+				break;
+
+			case MEM_OBJ_STRING_FRAG:
+				DebugPrintf("F  string fragments");
+				break;
+
+			default:
+				DebugPrintf("I  Invalid (type = %x)", mobj->getType());
+				break;
+			}
+
+			DebugPrintf("  seg_ID = %d \n", mobj->getSegMgrId());
+		}
+	}
+	DebugPrintf("\n");
+
+	return true;
+}
+
+bool Console::cmdShowMap(int argc, const char **argv) {
+	if (argc != 2) {
+		DebugPrintf("Shows one of the screen maps\n");
+		DebugPrintf("Usage: %s <screen map>\n", argv[0]);
+		DebugPrintf("Screen maps:\n");
+		DebugPrintf("- 0: visual map (back buffer)\n");
+		DebugPrintf("- 1: priority map (back buffer)\n");
+		DebugPrintf("- 2: control map (static buffer)\n");
+		return true;
+	}
+
+	gfxop_set_clip_zone(g_EngineState->gfx_state, gfx_rect_fullscreen);
+
+	int map = atoi(argv[1]);
+
+	switch (map) {
+	case 0:
+		g_EngineState->visual->add_dirty_abs((GfxContainer *)g_EngineState->visual, gfx_rect(0, 0, 320, 200), 0);
+		g_EngineState->visual->draw(Common::Point(0, 0));
+		break;
+
+	case 1:
+		gfx_xlate_pixmap(g_EngineState->gfx_state->pic->priority_map, g_EngineState->gfx_state->driver->mode, GFX_XLATE_FILTER_NONE);
+		gfxop_draw_pixmap(g_EngineState->gfx_state, g_EngineState->gfx_state->pic->priority_map, gfx_rect(0, 0, 320, 200), Common::Point(0, 0));
+		break;
+
+	case 2:
+		gfx_xlate_pixmap(g_EngineState->gfx_state->control_map, g_EngineState->gfx_state->driver->mode, GFX_XLATE_FILTER_NONE);
+		gfxop_draw_pixmap(g_EngineState->gfx_state, g_EngineState->gfx_state->control_map, gfx_rect(0, 0, 320, 200), Common::Point(0, 0));
+		break;
+
+	default:
+		DebugPrintf("Map %d is not available.\n", map);
+		return true;
+	}
+
+	gfxop_update(g_EngineState->gfx_state);
+
+	return false;
+}
+
 bool Console::cmdInvokeGC(int argc, const char **argv) {
 	DebugPrintf("Performing garbage collection...\n");
 	run_gc(g_EngineState);

Modified: scummvm/trunk/engines/sci/console.h
===================================================================
--- scummvm/trunk/engines/sci/console.h	2009-05-30 14:13:27 UTC (rev 41031)
+++ scummvm/trunk/engines/sci/console.h	2009-05-30 14:30:39 UTC (rev 41032)
@@ -67,6 +67,9 @@
 	bool cmdVisualState(int argc, const char **argv);
 	bool cmdDynamicViews(int argc, const char **argv);
 	bool cmdDroppedViews(int argc, const char **argv);
+	bool cmdSimulateKey(int argc, const char **argv);
+	bool cmdPrintSegmentTable(int argc, const char **argv);
+	bool cmdShowMap(int argc, const char **argv);
 	bool cmdInvokeGC(int argc, const char **argv);
 	bool cmdGCObjects(int argc, const char **argv);
 	bool cmdExit(int argc, const char **argv);

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2009-05-30 14:13:27 UTC (rev 41031)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2009-05-30 14:30:39 UTC (rev 41032)
@@ -168,10 +168,10 @@
 
 	s->_pics.clear();
 
-	s->visual->add(GFXWC(s->visual), s->wm_port);
-	s->visual->add(GFXWC(s->visual), s->titlebar_port);
-	s->visual->add(GFXWC(s->visual), s->picture_port);
-	s->visual->add(GFXWC(s->visual), s->iconbar_port);
+	s->visual->add((GfxContainer *)s->visual, s->wm_port);
+	s->visual->add((GfxContainer *)s->visual, s->titlebar_port);
+	s->visual->add((GfxContainer *)s->visual, s->picture_port);
+	s->visual->add((GfxContainer *)s->visual, s->iconbar_port);
 	// Add ports to visual
 
 	s->port = s->picture_port; // Currently using the picture port

Modified: scummvm/trunk/engines/sci/engine/gc.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/gc.cpp	2009-05-30 14:13:27 UTC (rev 41031)
+++ scummvm/trunk/engines/sci/engine/gc.cpp	2009-05-30 14:30:39 UTC (rev 41032)
@@ -183,8 +183,6 @@
 	SegManager *sm = s->seg_manager;
 
 #ifdef DEBUG_GC
-	extern int c_segtable(EngineState *s);
-	c_segtable(s);
 	sciprintf("[GC] Running...\n");
 	memset(&(deallocator.segcount), 0, sizeof(int) * (MEM_OBJ_MAX + 1));
 #endif

Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h	2009-05-30 14:13:27 UTC (rev 41031)
+++ scummvm/trunk/engines/sci/engine/kernel.h	2009-05-30 14:30:39 UTC (rev 41032)
@@ -38,8 +38,6 @@
 struct Node;	// from vm.h
 struct List;	// from vm.h
 
-extern int _kdebug_cheap_event_hack;
-extern int _kdebug_cheap_soundcue_hack;
 extern int stop_on_event;
 
 extern int _debug_seeking;

Modified: scummvm/trunk/engines/sci/engine/kevent.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kevent.cpp	2009-05-30 14:13:27 UTC (rev 41031)
+++ scummvm/trunk/engines/sci/engine/kevent.cpp	2009-05-30 14:30:39 UTC (rev 41032)
@@ -28,10 +28,12 @@
 #include "sci/engine/kernel.h"
 #include "sci/gfx/gfx_widgets.h"
 #include "sci/gfx/gfx_state_internal.h"	// required for GfxPort, GfxVisual
+#include "sci/console.h"	// for _kdebug_cheap_event_hack
 
 namespace Sci {
 
 int stop_on_event = 0;
+extern int _kdebug_cheap_event_hack;
 
 #define SCI_VARIABLE_GAME_SPEED 3
 

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-05-30 14:13:27 UTC (rev 41031)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-05-30 14:30:39 UTC (rev 41032)
@@ -69,18 +69,18 @@
 
 #define ADD_TO_CURRENT_PORT(widget) \
 	{if (s->port)				   \
-		s->port->add(GFXWC(s->port), widget); \
+		s->port->add((GfxContainer *)s->port, widget); \
 	else \
-		s->picture_port->add(GFXWC(s->visual), widget);}
+		s->picture_port->add((GfxContainer *)s->visual, widget);}
 
 #define ADD_TO_CURRENT_PICTURE_PORT(widget) \
 	{if (s->port)				   \
-		s->port->add(GFXWC(s->port), widget); \
+		s->port->add((GfxContainer *)s->port, widget); \
 	else \
-		s->picture_port->add(GFXWC(s->picture_port), widget);}
+		s->picture_port->add((GfxContainer *)s->picture_port, widget);}
 
 #define ADD_TO_WINDOW_PORT(widget) \
-	s->wm_port->add(GFXWC(s->wm_port), widget);
+	s->wm_port->add((GfxContainer *)s->wm_port, widget);
 
 #define FULL_REDRAW()\
 	if (s->visual) \
@@ -147,7 +147,7 @@
 	if (s->dyn_views) {
 		gfxw_remove_widget_from_container(s->dyn_views->_parent, s->dyn_views);
 
-		newport->add(GFXWC(newport), s->dyn_views);
+		newport->add((GfxContainer *)newport, s->dyn_views);
 	}
 }
 
@@ -476,7 +476,7 @@
 		s->dyn_views = NULL;
 	}
 
-	port->_parent->add(GFXWC(port->_parent), newport);
+	port->_parent->add((GfxContainer *)port->_parent, newport);
 	delete port;
 }
 
@@ -562,7 +562,7 @@
 
 		// FIXME/TODO: this is not right, as some of the dialogs are drawn *behind* some widgets. But at least it works for now
 		//ADD_TO_CURRENT_PICTURE_PORT(gfxw_new_box(s->gfx_state, area, color, color, GFX_BOX_SHADE_FLAT));	// old code
-		s->picture_port->add(GFXWC(s->picture_port), gfxw_new_box(s->gfx_state, area, color, color, GFX_BOX_SHADE_FLAT));
+		s->picture_port->add((GfxContainer *)s->picture_port, gfxw_new_box(s->gfx_state, area, color, color, GFX_BOX_SHADE_FLAT));
 
 	}
 	break;
@@ -587,7 +587,7 @@
 		area.x += s->port->zone.x;
 		area.y += s->port->zone.y;
 
-		if (s->dyn_views && s->dyn_views->_parent == GFXWC(s->port))
+		if (s->dyn_views && s->dyn_views->_parent == (GfxContainer *)s->port)
 			s->dyn_views->draw(Common::Point(0, 0));
 
 		gfxop_update_box(s->gfx_state, area);
@@ -1039,9 +1039,9 @@
 	s->iconbar_port = gfxw_new_port(s->visual, NULL, gfx_rect(0, 0, 320, 200), s->ega_colors[0], transparent);
 	s->iconbar_port->_flags |= GFXW_FLAG_NO_IMPLICIT_SWITCH;
 
-	s->visual->add(GFXWC(s->visual), s->picture_port);
-	s->visual->add(GFXWC(s->visual), s->wm_port);
-	s->visual->add(GFXWC(s->visual), s->iconbar_port);
+	s->visual->add((GfxContainer *)s->visual, s->picture_port);
+	s->visual->add((GfxContainer *)s->visual, s->wm_port);
+	s->visual->add((GfxContainer *)s->visual, s->iconbar_port);
 
 	s->port = s->picture_port;
 
@@ -1843,7 +1843,7 @@
 							error("Attempt to remove view with ID %x:%x from list failed!\n", widget->_ID, widget->_subID);
 						}
 
-						s->drop_views->add(GFXWC(s->drop_views), gfxw_picviewize_dynview(widget));
+						s->drop_views->add((GfxContainer *)s->drop_views, gfxw_picviewize_dynview(widget));
 
 						draw_obj_to_control_map(s, widget);
 						widget->draw_bounds.y += s->dyn_views->_bounds.y - widget->_parent->_bounds.y;
@@ -1992,7 +1992,7 @@
 
 		tempWidget = _k_make_dynview_obj(s, obj, options, sequence_nr--, funct_nr, argc, argv);
 		if (tempWidget)
-			GFX_ASSERT((*widget_list)->add(GFXWC(*widget_list), tempWidget));
+			GFX_ASSERT((*widget_list)->add((GfxContainer *)(*widget_list), tempWidget));
 
 		node = lookup_node(s, next_node); // Next node
 	}
@@ -2158,7 +2158,7 @@
 		else
 			gfxw_show_widget(view);
 
-		list->add(GFXWC(list), view);
+		list->add((GfxContainer *)list, view);
 
 		_k_raise_topmost_in_view_list(s, list, next);
 	}
@@ -2219,7 +2219,7 @@
 	// Draws list_nr members of list to s->pic.
 	GfxDynView *widget = (GfxDynView *) list->_contents;
 
-	if (GFXWC(s->port) != GFXWC(s->dyn_views->_parent))
+	if ((GfxContainer *)s->port != (GfxContainer *)s->dyn_views->_parent)
 		return; // Return if the pictures are meant for a different port
 
 	while (widget) {
@@ -2434,11 +2434,11 @@
 		return s->r_acc;
 	}
 
-	if (s->dyn_views && GFXWC(s->dyn_views->_parent) == GFXWC(goner)) {
+	if (s->dyn_views && (GfxContainer *)s->dyn_views->_parent == (GfxContainer *)goner) {
 		reparentize_primary_widget_lists(s, (GfxPort *) goner->_parent);
 	}
 
-	if (s->drop_views && GFXWC(s->drop_views->_parent) == GFXWC(goner))
+	if (s->drop_views && (GfxContainer *)s->drop_views->_parent == (GfxContainer *)goner)
 		s->drop_views = NULL; // Kill it
 
 	pred = gfxw_remove_port(s->visual, goner);
@@ -2982,7 +2982,7 @@
 	assert_primary_widget_lists(s);
 
 	if (!s->dyn_views->_contents // Only reparentize empty dynview list
-	        && ((GFXWC(s->port) != GFXWC(s->dyn_views->_parent)) // If dynviews are on other port...
+	        && (((GfxContainer *)s->port != (GfxContainer *)s->dyn_views->_parent) // If dynviews are on other port...
 	            || (s->dyn_views->_next))) // ... or not on top of the view list
 		reparentize_primary_widget_lists(s, s->port);
 
@@ -2996,7 +2996,7 @@
 		assert_primary_widget_lists(s);
 
 		if (!s->dyn_views->_contents // Only reparentize empty dynview list
-		        && ((GFXWC(s->port) != GFXWC(s->dyn_views->_parent)) // If dynviews are on other port...
+		        && (((GfxContainer *)s->port != (GfxContainer *)s->dyn_views->_parent) // If dynviews are on other port...
 		            || (s->dyn_views->_next))) // ... or not on top of the view list
 			reparentize_primary_widget_lists(s, s->port);
 		// End of doit() recovery code
@@ -3020,12 +3020,12 @@
 		_k_raise_topmost_in_view_list(s, s->dyn_views, (GfxDynView *)templist->_contents);
 
 		delete templist;
-		s->dyn_views->free_tagged(GFXWC(s->dyn_views)); // Free obsolete dynviews
+		s->dyn_views->free_tagged((GfxContainer *)s->dyn_views); // Free obsolete dynviews
 	} // if (cast_list)
 
 	if (open_animation) {
 		gfxop_clear_box(s->gfx_state, gfx_rect(0, 10, 320, 190)); // Propagate pic
-		s->visual->add_dirty_abs(GFXWC(s->visual), gfx_rect_fullscreen, 0);
+		s->visual->add_dirty_abs((GfxContainer *)s->visual, gfx_rect_fullscreen, 0);
 		// Mark screen as dirty so picviews will be drawn correctly
 		FULL_REDRAW();
 
@@ -3055,7 +3055,7 @@
 		}
 
 		if ((reparentize | retval)
-		        && (GFXWC(s->port) == GFXWC(s->dyn_views->_parent)) // If dynviews are on the same port...
+		        && ((GfxContainer *)s->port == (GfxContainer *)s->dyn_views->_parent) // If dynviews are on the same port...
 		        && (s->dyn_views->_next)) // ... and not on top of the view list...
 			reparentize_primary_widget_lists(s, s->port); // ...then reparentize.
 

Modified: scummvm/trunk/engines/sci/engine/kmenu.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmenu.cpp	2009-05-30 14:13:27 UTC (rev 41031)
+++ scummvm/trunk/engines/sci/engine/kmenu.cpp	2009-05-30 14:30:39 UTC (rev 41032)
@@ -288,7 +288,7 @@
 				delete port;
 
 				port = sciw_new_menu(s, s->titlebar_port, s->_menubar, menu_nr);
-				s->wm_port->add(GFXWC(s->wm_port), port);
+				s->wm_port->add((GfxContainer *)s->wm_port, port);
 
 				if (item_nr > -1)
 					old_item = -42; /* Enforce redraw in next step */

Modified: scummvm/trunk/engines/sci/engine/scriptdebug.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-05-30 14:13:27 UTC (rev 41031)
+++ scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-05-30 14:30:39 UTC (rev 41032)
@@ -76,9 +76,6 @@
 
 static const int MIDI_cmdlen[16] = {0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 2, 0};
 
-int _kdebug_cheap_event_hack = 0;
-int _kdebug_cheap_soundcue_hack = -1;
-
 char inputbuf[256] = "";
 
 union cmd_param_t {
@@ -300,69 +297,6 @@
 	return 0;
 }
 
-int c_segtable(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) {
-	uint i;
-
-	sciprintf("  ---- segment table ----\n");
-	for (i = 0; i < s->seg_manager->_heap.size(); i++) {
-		MemObject *mobj = s->seg_manager->_heap[i];
-		if (mobj && mobj->getType()) {
-			sciprintf(" [%04x] ", i);
-
-			switch (mobj->getType()) {
-			case MEM_OBJ_SCRIPT:
-				sciprintf("S  script.%03d l:%d ", (*(Script *)mobj).nr, (*(Script *)mobj).lockers);
-				break;
-
-			case MEM_OBJ_CLONES:
-				sciprintf("C  clones (%d allocd)", (*(CloneTable *)mobj).entries_used);
-				break;
-
-			case MEM_OBJ_LOCALS:
-				sciprintf("V  locals %03d", (*(LocalVariables *)mobj).script_id);
-				break;
-
-			case MEM_OBJ_STACK:
-				sciprintf("D  data stack (%d)", (*(DataStack *)mobj).nr);
-				break;
-
-			case MEM_OBJ_SYS_STRINGS:
-				sciprintf("Y  system string table");
-				break;
-
-			case MEM_OBJ_LISTS:
-				sciprintf("L  lists (%d)", (*(ListTable *)mobj).entries_used);
-				break;
-
-			case MEM_OBJ_NODES:
-				sciprintf("N  nodes (%d)", (*(NodeTable *)mobj).entries_used);
-				break;
-
-			case MEM_OBJ_HUNK:
-				sciprintf("H  hunk (%d)", (*(HunkTable *)mobj).entries_used);
-				break;
-
-			case MEM_OBJ_DYNMEM:
-				sciprintf("M  dynmem: %d bytes", (*(DynMem *)mobj)._size);
-				break;
-
-			case MEM_OBJ_STRING_FRAG:
-				sciprintf("F  string fragments");
-				break;
-
-			default:
-				sciprintf("I  Invalid (type = %x)", mobj->getType());
-				break;
-			}
-
-			sciprintf("  seg_ID = %d \n", mobj->getSegMgrId());
-		}
-	}
-	sciprintf("\n");
-
-	return 0;
-}
-
 static void print_obj_head(EngineState *s, reg_t pos) {
 	Object *obj = obj_get(s, pos);
 
@@ -1636,41 +1570,6 @@
 }
 #endif
 
-static int c_gfx_show_map(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) {
-	int map = cmdParams[0].val;
-	if (!_debugstate_valid) {
-		sciprintf("Not in debug state\n");
-		return 1;
-	}
-
-	gfxop_set_clip_zone(s->gfx_state, gfx_rect_fullscreen);
-
-	switch (map) {
-	case 0:
-		s->visual->add_dirty_abs(GFXWC(s->visual), gfx_rect(0, 0, 320, 200), 0);
-		s->visual->draw(Common::Point(0, 0));
-		break;
-
-	case 1:
-		gfx_xlate_pixmap(s->gfx_state->pic->priority_map, s->gfx_state->driver->mode, GFX_XLATE_FILTER_NONE);
-		gfxop_draw_pixmap(s->gfx_state, s->gfx_state->pic->priority_map, gfx_rect(0, 0, 320, 200), Common::Point(0, 0));
-		break;
-
-	case 2:
-		gfx_xlate_pixmap(s->gfx_state->control_map, s->gfx_state->driver->mode, GFX_XLATE_FILTER_NONE);
-		gfxop_draw_pixmap(s->gfx_state, s->gfx_state->control_map, gfx_rect(0, 0, 320, 200), Common::Point(0, 0));
-		break;
-
-	default:
-		sciprintf("Map %d is not available.\n", map);
-		return 1;
-	}
-
-	gfxop_update(s->gfx_state);
-
-	return 0;
-}
-
 static int c_gfx_draw_cel(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) {
 	int view = cmdParams[0].val;
 	int loop = cmdParams[1].val;
@@ -2178,12 +2077,6 @@
 	return c_handle_config_update(gfx_debug_modes, GFX_DEBUG_MODES, "graphics subsystem", (int *)&(drv->debug_flags), cmdParams);
 }
 
-int c_simkey(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) {
-	_kdebug_cheap_event_hack = cmdParams[0].val;
-
-	return 0;
-}
-
 static int c_is_sample(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) {
 	Resource *song = s->resmgr->findResource(kResourceTypeSound, cmdParams[0].val, 0);
 	SongIterator *songit;
@@ -2215,12 +2108,6 @@
 	return 0;
 }
 
-int c_simsoundcue(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) {
-	_kdebug_cheap_soundcue_hack = cmdParams[0].val;
-
-	return 0;
-}
-
 #define GETRECT(ll, rr, tt, bb) \
 	ll = GET_SELECTOR(pos, ll); \
 	rr = GET_SELECTOR(pos, rr); \
@@ -2739,7 +2626,6 @@
 			                 "  gfx_debuglog.1, sfx_debuglog.1\n");
 			con_hook_command(c_visible_map, "set_vismap", "i", "Sets the visible map.\n  Default is 0 (visual).\n"
 			                 "  Other useful values are:\n  1: Priority\n  2: Control\n  3: Auxiliary\n");
-			con_hook_command(c_simkey, "simkey", "i", "Simulates a keypress with the\n  specified scancode.\n");
 			con_hook_command(c_statusbar, "statusbar", "ii", "Sets the colors of the status bar. Also controllable from the script.\n");
 			con_hook_command(c_bpx, "bpx", "s", "Sets a breakpoint on the execution of\n  the specified method.\n\n  EXAMPLE:\n"
 			                 "  bpx ego::doit\n\n  May also be used to set a breakpoint\n  that applies whenever an object\n"
@@ -2802,8 +2688,6 @@
 			con_hook_command(c_gfx_drawpic, "gfx_drawpic", "ii*", "Draws a pic resource\n\nUSAGE\n  gfx_drawpic <nr> [<pal> [<fl>]]\n"
 			                 "  where <nr> is the number of the pic resource\n  to draw\n  <pal> is the optional default\n  palette for the pic (0 is"
 			                 "\n  assumed if not specified)\n  <fl> are any pic draw flags (default\n  is 1)");
-			con_hook_command(c_gfx_show_map, "gfx_show_map", "i", "Shows one of the screen maps\n  Semantics of the int parameter:\n"
-			                 "    0: visual map (back buffer)\n    1: priority map (back buf.)\n    2: control map (static buf.)");
 			con_hook_command(c_gfx_fill_screen, "gfx_fill_screen", "i", "Fills the screen with one\n  of the EGA colors\n");
 			con_hook_command(c_gfx_draw_rect, "gfx_draw_rect", "iiiii", "Draws a rectangle to the screen\n  with one of the EGA colors\n\nUSAGE\n\n"
 			                 "  gfx_draw_rect <x> <y> <xl> <yl> <color>");
@@ -2826,10 +2710,6 @@
 			con_hook_command(c_gfx_priority, "gfx_priority", "i*", "Prints information about priority\n  bands\nUSAGE\n\n  gfx_priority\n\n"
 			                 "  will print the min and max values\n  for the priority bands\n\n  gfx_priority <val>\n\n  Print start of the priority\n"
 			                 "  band for the specified\n  priority\n");
-			con_hook_command(c_segtable, "segtable", "!",
-			                 "Gives a short listing of all segments\n\n"
-			                 "SEE ALSO\n\n"
-			                 "  seginfo.1");
 			con_hook_command(c_segkill, "segkill", "!i*",
 			                 "Deletes the specified segment\n\n"
 			                 "USAGE\n\n"

Modified: scummvm/trunk/engines/sci/gfx/gfx_gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_gui.cpp	2009-05-30 14:13:27 UTC (rev 41031)
+++ scummvm/trunk/engines/sci/gfx/gfx_gui.cpp	2009-05-30 14:30:39 UTC (rev 41032)
@@ -112,7 +112,7 @@
 		list->add((GfxContainer *)list, (GfxWidget *)bgbox);
 	}
 
-	list->add(GFXWC(status_bar), list);
+	list->add((GfxContainer *)status_bar, list);
 	finish_titlebar_list(s, list, status_bar);
 
 	status_bar->draw(gfxw_point_zero);
@@ -255,7 +255,7 @@
 	}
 
 	win->_decorations = decorations;
-	decorations->_parent = GFXWC(win);
+	decorations->_parent = (GfxContainer *)win;
 
 	return win;
 }
@@ -281,14 +281,14 @@
 		bgcolor = &(port->_bgcolor);
 	}
 
-	list->add(GFXWC(list), gfxw_new_text(port->_visual->_gfxState, zone, font, text, align, ALIGN_TOP,
+	list->add((GfxContainer *)list, gfxw_new_text(port->_visual->_gfxState, zone, font, text, align, ALIGN_TOP,
 	                            *color1, *color2, *bgcolor, flags));
 
 	zone.width--;
 	zone.height -= 2;
 
 	if (framed) {
-		list->add(GFXWC(list), gfxw_new_rect(zone, *color2, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_STIPPLED));
+		list->add((GfxContainer *)list, gfxw_new_rect(zone, *color2, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_STIPPLED));
 	}
 
 	return list;
@@ -314,10 +314,10 @@
 		list = _sciw_add_text_to_list(list, port, gfx_rect(zone.x + 1, zone.y + 2, zone.width - 1, zone.height),
 		                              text, font, ALIGN_CENTER, 0, inverse, kFontIgnoreLF, grayed_out);
 
-		list->add(GFXWC(list),
+		list->add((GfxContainer *)list,
 		          gfxw_new_rect(zone, *frame_col, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_NORMAL));
 	} else {
-		list->add(GFXWC(list), gfxw_new_box(NULL, gfx_rect(zone.x, zone.y, zone.width + 1, zone.height + 1),
+		list->add((GfxContainer *)list, gfxw_new_box(NULL, gfx_rect(zone.x, zone.y, zone.width + 1, zone.height + 1),
 		                            port->_color, port->_color, GFX_BOX_SHADE_FLAT));
 
 		list = _sciw_add_text_to_list(list, port, gfx_rect(zone.x + 1, zone.y + 2, zone.width - 1, zone.height),
@@ -325,7 +325,7 @@
 	}
 
 	if (selected)
-		list->add(GFXWC(list),
+		list->add((GfxContainer *)list,
 		          gfxw_new_rect(gfx_rect(zone.x + 1, zone.y + 1, zone.width - 2, zone.height - 2),
 		                             *frame_col, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_NORMAL));
 
@@ -365,7 +365,7 @@
 		text_handle = gfxw_new_text(port->_visual->_gfxState, zone, font, text, ALIGN_LEFT, ALIGN_TOP,
 		                            port->_color, port->_color, port->_bgcolor, kFontNoNewlines);
 
-		list->add(GFXWC(list), text_handle);
+		list->add((GfxContainer *)list, text_handle);
 	} else {
 		char *textdup = (char *)malloc(strlen(text) + 1);
 
@@ -378,7 +378,7 @@
 			text_handle = gfxw_new_text(port->_visual->_gfxState, zone, font, textdup, ALIGN_LEFT, ALIGN_TOP,
 			                            port->_color, port->_color, port->_bgcolor, kFontNoNewlines);
 
-			list->add(GFXWC(list), text_handle);
+			list->add((GfxContainer *)list, text_handle);
 			zone.x += text_handle->width;
 		}
 
@@ -387,26 +387,26 @@
 			textdup[1] = 0;
 			text_handle =  gfxw_new_text(port->_visual->_gfxState, zone, font, textdup, ALIGN_LEFT, ALIGN_TOP,
 			                             port->_bgcolor, port->_bgcolor, port->_color, kFontNoNewlines);
-			list->add(GFXWC(list), text_handle);
+			list->add((GfxContainer *)list, text_handle);
 			zone.x += text_handle->width;
 		};
 
 		if (cursor + 1 < strlen(text)) {
 			text_handle = gfxw_new_text(port->_visual->_gfxState, zone, font, text + cursor + 1, ALIGN_LEFT, ALIGN_TOP,
 			                            port->_color, port->_color, port->_bgcolor, kFontNoNewlines);
-			list->add(GFXWC(list), text_handle);
+			list->add((GfxContainer *)list, text_handle);
 			zone.x += text_handle->width;
 		};
 
 		if (cursor == strlen(text))
-			list->add(GFXWC(list), gfxw_new_line(Common::Point(zone.x, zone.y), Common::Point(zone.x, zone.y + cursor_height - 1),
+			list->add((GfxContainer *)list, gfxw_new_line(Common::Point(zone.x, zone.y), Common::Point(zone.x, zone.y + cursor_height - 1),
 			                            port->_color, GFX_LINE_MODE_FAST, GFX_LINE_STYLE_NORMAL));
 		free(textdup);
 	}
 
 	zone.x = zone.y = 0;
 
-	list->add(GFXWC(list), gfxw_new_rect(zone, port->_color, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_NORMAL));
+	list->add((GfxContainer *)list, gfxw_new_rect(zone, port->_color, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_NORMAL));
 
 	return list;
 }
@@ -435,7 +435,7 @@
 
 	list->_flags |= GFXW_FLAG_MULTI_ID;
 
-	list->add(GFXWC(list), icon);
+	list->add((GfxContainer *)list, icon);
 
 	return list;
 }
@@ -481,14 +481,14 @@
 
 	for (i = list_top; columns-- && i < entries_nr; i++) {
 		if (i != selection)
-			list->add(GFXWC(list),
+			list->add((GfxContainer *)list,
 			          gfxw_new_text(port->_visual->_gfxState, gfx_rect(zone.x, zone.y, zone.width - 2, font_height),
 			                             font_nr, entries_list[i], ALIGN_LEFT, ALIGN_TOP,
 			                             port->_color, port->_color, port->_bgcolor, kFontNoNewlines));
 		else {
-			list->add(GFXWC(list), gfxw_new_box(port->_visual->_gfxState, gfx_rect(zone.x, zone.y, zone.width - 1, font_height),
+			list->add((GfxContainer *)list, gfxw_new_box(port->_visual->_gfxState, gfx_rect(zone.x, zone.y, zone.width - 1, font_height),
 			                            port->_color, port->_color, GFX_BOX_SHADE_FLAT));
-			list->add(GFXWC(list), gfxw_new_text(port->_visual->_gfxState, gfx_rect(zone.x, zone.y, zone.width - 2, font_height),
+			list->add((GfxContainer *)list, gfxw_new_text(port->_visual->_gfxState, gfx_rect(zone.x, zone.y, zone.width - 2, font_height),
 			                             font_nr, entries_list[i], ALIGN_LEFT, ALIGN_TOP,
 			                             port->_bgcolor, port->_bgcolor, port->_color, kFontNoNewlines));
 		}
@@ -502,24 +502,24 @@
 	zone.y = 0;
 
 	// Add up arrow
-	list->add(GFXWC(list), gfxw_new_text(port->_visual->_gfxState, gfx_rect(1, 0, zone.width - 2, 8),
+	list->add((GfxContainer *)list, gfxw_new_text(port->_visual->_gfxState, gfx_rect(1, 0, zone.width - 2, 8),
 	                             port->_font, arr_up, ALIGN_CENTER, ALIGN_CENTER,
 	                             port->_color, port->_color, port->_bgcolor, 0));
 
 	// Add down arrow
-	list->add(GFXWC(list), gfxw_new_text(port->_visual->_gfxState, gfx_rect(1, zone.height - 9, zone.width - 2, 8),
+	list->add((GfxContainer *)list, gfxw_new_text(port->_visual->_gfxState, gfx_rect(1, zone.height - 9, zone.width - 2, 8),
 	                             port->_font, arr_down, ALIGN_CENTER, ALIGN_CENTER,
 	                             port->_color, port->_color, port->_bgcolor, 0));
 
 	if (list_top & 1) { // Hack to work around aggressive caching
-		list->add(GFXWC(list), gfxw_new_rect(zone, port->_color, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_NORMAL));
-		list->add(GFXWC(list), gfxw_new_rect(gfx_rect(zone.x, zone.y + 10, zone.width, zone.height - 20),
+		list->add((GfxContainer *)list, gfxw_new_rect(zone, port->_color, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_NORMAL));
+		list->add((GfxContainer *)list, gfxw_new_rect(gfx_rect(zone.x, zone.y + 10, zone.width, zone.height - 20),
 		                             port->_color, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_NORMAL));
 	} else {
-		list->add(GFXWC(list),
+		list->add((GfxContainer *)list,
 		          gfxw_new_rect(gfx_rect(zone.x, zone.y, zone.width, zone.height - 10),
 		                             port->_color, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_NORMAL));
-		list->add(GFXWC(list),
+		list->add((GfxContainer *)list,
 		          gfxw_new_rect(gfx_rect(zone.x, zone.y + 10, zone.width, zone.height - 10),
 		                             port->_color, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_NORMAL));
 	}
@@ -539,19 +539,19 @@
 		int width = menu->_titleWidth + (MENU_BORDER_SIZE * 2);
 
 		if (i == selection) {
-			list->add(GFXWC(list), gfxw_new_box(status_bar->_visual->_gfxState, gfx_rect(offset, 0, width, MENU_BAR_HEIGHT),
+			list->add((GfxContainer *)list, gfxw_new_box(status_bar->_visual->_gfxState, gfx_rect(offset, 0, width, MENU_BAR_HEIGHT),
 			                            status_bar->_color, status_bar->_color, GFX_BOX_SHADE_FLAT));
-			list->add(GFXWC(list), gfxw_new_text(s->gfx_state, gfx_rect(offset, 0, width, MENU_BAR_HEIGHT),
+			list->add((GfxContainer *)list, gfxw_new_text(s->gfx_state, gfx_rect(offset, 0, width, MENU_BAR_HEIGHT),
 			                             status_bar->_font, menu->_title.c_str(), ALIGN_CENTER, ALIGN_CENTER,
 			                             status_bar->_bgcolor, status_bar->_bgcolor, status_bar->_color, kFontNoNewlines));
 		} else
-			list->add(GFXWC(list), gfxw_new_text(s->gfx_state, gfx_rect(offset, 0, width, MENU_BAR_HEIGHT),
+			list->add((GfxContainer *)list, gfxw_new_text(s->gfx_state, gfx_rect(offset, 0, width, MENU_BAR_HEIGHT),
 			                             status_bar->_font, menu->_title.c_str(), ALIGN_CENTER, ALIGN_CENTER,
 			                             status_bar->_color, status_bar->_color, status_bar->_bgcolor, kFontNoNewlines));
 		offset += width;
 	}
 
-	status_bar->add(GFXWC(status_bar), list);
+	status_bar->add((GfxContainer *)status_bar, list);
 	finish_titlebar_list(s, list, status_bar);
 }
 
@@ -606,13 +606,13 @@
 
 	xcolor = gray ? color : bgcolor;
 
-	list->add(GFXWC(list), gfxw_new_box(port->_visual->_gfxState, area, bgcolor, bgcolor, GFX_BOX_SHADE_FLAT));
-	list->add(GFXWC(list), gfxw_new_text(port->_visual->_gfxState, area, port->_font, item->_text.c_str(), ALIGN_LEFT, ALIGN_CENTER,
+	list->add((GfxContainer *)list, gfxw_new_box(port->_visual->_gfxState, area, bgcolor, bgcolor, GFX_BOX_SHADE_FLAT));
+	list->add((GfxContainer *)list, gfxw_new_text(port->_visual->_gfxState, area, port->_font, item->_text.c_str(), ALIGN_LEFT, ALIGN_CENTER,
 	                            color, xcolor, bgcolor, kFontNoNewlines));
 
 	if (!item->_keytext.empty()) {
 		area.width -= MENU_BOX_RIGHT_PADDING;
-		list->add(GFXWC(list), gfxw_new_text(port->_visual->_gfxState, area, port->_font, item->_keytext.c_str(), ALIGN_RIGHT, ALIGN_CENTER,
+		list->add((GfxContainer *)list, gfxw_new_text(port->_visual->_gfxState, area, port->_font, item->_keytext.c_str(), ALIGN_RIGHT, ALIGN_CENTER,
 		                            color, xcolor, bgcolor, kFontNoNewlines));
 	}
 
@@ -627,8 +627,8 @@
 	color = un_prioritize(color);
 	bgcolor = un_prioritize(bgcolor);
 
-	list->add(GFXWC(list), gfxw_new_box(port->_visual->_gfxState, area, bgcolor, bgcolor, GFX_BOX_SHADE_FLAT));
-	list->add(GFXWC(list), gfxw_new_line(Common::Point(0, 5), Common::Point(width, 5), color,
+	list->add((GfxContainer *)list, gfxw_new_box(port->_visual->_gfxState, area, bgcolor, bgcolor, GFX_BOX_SHADE_FLAT));
+	list->add((GfxContainer *)list, gfxw_new_line(Common::Point(0, 5), Common::Point(width, 5), color,
 	                            GFX_LINE_MODE_FAST, GFX_LINE_STYLE_STIPPLED));
 
 	return list;
@@ -644,10 +644,10 @@
 	MenuItem *item = &menu->_items[selection];
 
 	if (item->_type == MENU_TYPE_NORMAL)
-		menu_port->add(GFXWC(menu_port), _make_menu_entry(item, selection * 10, menu_port->zone.width + 1,
+		menu_port->add((GfxContainer *)menu_port, _make_menu_entry(item, selection * 10, menu_port->zone.width + 1,
 		                                      menu_port, fgColor, bgColor, selection + MAGIC_ID_OFFSET, item->_enabled));
 	else
-		menu_port->add(GFXWC(menu_port), _make_menu_hbar(selection * 10, menu_port->zone.width + 1,
+		menu_port->add((GfxContainer *)menu_port, _make_menu_hbar(selection * 10, menu_port->zone.width + 1,
 		                                      menu_port, fgColor, bgColor, selection + MAGIC_ID_OFFSET));
 
 	return menu_port;

Modified: scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp	2009-05-30 14:13:27 UTC (rev 41031)
+++ scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp	2009-05-30 14:30:39 UTC (rev 41032)
@@ -1229,7 +1229,7 @@
 	if (_parentize_widget(container, widget))
 		return 1;
 
-	if (!(GFXW_IS_LIST(widget) && (!GFXWC(widget)->_contents))) { // Don't dirtify self on empty lists
+	if (!(GFXW_IS_LIST(widget) && (!((GfxContainer *)widget)->_contents))) { // Don't dirtify self on empty lists
 		DDIRTY(stderr, "container_add: dirtify DOWNWARDS (%d,%d,%d,%d, 1)\n", GFX_PRINT_RECT(widget->_bounds));
 		_gfxw_dirtify_container(container, widget);
 	}
@@ -1797,7 +1797,7 @@
 			delete widget;
 		} else {
 			if (GFXW_IS_CONTAINER(widget))
-				_gfxw_free_contents_appropriately(GFXWC(widget), snapshot, priority);
+				_gfxw_free_contents_appropriately((GfxContainer *)widget, snapshot, priority);
 		}
 
 		widget = next;
@@ -1805,7 +1805,7 @@
 }
 
 gfxw_snapshot_t *gfxw_restore_snapshot(GfxVisual *visual, gfxw_snapshot_t *snapshot) {
-	_gfxw_free_contents_appropriately(GFXWC(visual), snapshot, MAGIC_FREE_NUMBER);
+	_gfxw_free_contents_appropriately((GfxContainer *)visual, snapshot, MAGIC_FREE_NUMBER);
 
 	return snapshot;
 }
@@ -1828,7 +1828,7 @@
 	delete widget;
 
 	if (free_overdrawn)
-		_gfxw_free_contents_appropriately(GFXWC(visual), &snapshot, widget_priority);
+		_gfxw_free_contents_appropriately((GfxContainer *)visual, &snapshot, widget_priority);
 }
 
 GfxDynView *gfxw_picviewize_dynview(GfxDynView *dynview) {

Modified: scummvm/trunk/engines/sci/gfx/gfx_widgets.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_widgets.h	2009-05-30 14:13:27 UTC (rev 41031)
+++ scummvm/trunk/engines/sci/gfx/gfx_widgets.h	2009-05-30 14:30:39 UTC (rev 41032)
@@ -82,9 +82,6 @@
 /*********************************/
 
 
-#define GFXWC(foo) ((GfxContainer *) foo)
-/* Typecasts a container widget to gfxw_container_widget_t *. */
-
 /* gfxw_point_zero is declared in gfx/widgets.cpp */
 extern Common::Point gfxw_point_zero;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list