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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Oct 30 15:39:26 CET 2009


Revision: 45538
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45538&view=rev
Author:   thebluegr
Date:     2009-10-30 14:39:26 +0000 (Fri, 30 Oct 2009)

Log Message:
-----------
- Removed status_bar_foreground and status_bar_background variables from the engine state
- Implemented clearMenuBar() in the new graphics code
- Removed the "status_bar" command, which was used to set custom colors for the status bar

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/kmenu.cpp
    scummvm/trunk/engines/sci/engine/savegame.cpp
    scummvm/trunk/engines/sci/engine/state.cpp
    scummvm/trunk/engines/sci/engine/state.h
    scummvm/trunk/engines/sci/gui/gui.cpp
    scummvm/trunk/engines/sci/gui32/gui32.cpp

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2009-10-30 14:22:22 UTC (rev 45537)
+++ scummvm/trunk/engines/sci/console.cpp	2009-10-30 14:39:26 UTC (rev 45538)
@@ -124,7 +124,6 @@
 	DCmd_Register("flush_visual",		WRAP_METHOD(Console, cmdFlushPorts));
 	DCmd_Register("dynamic_views",		WRAP_METHOD(Console, cmdDynamicViews));
 	DCmd_Register("dropped_views",		WRAP_METHOD(Console, cmdDroppedViews));
-	DCmd_Register("status_bar",			WRAP_METHOD(Console, cmdStatusBarColors));
 #ifdef GFXW_DEBUG_WIDGETS
 	DCmd_Register("print_widget",		WRAP_METHOD(Console, cmdPrintWidget));
 #endif
@@ -329,7 +328,6 @@
 	DebugPrintf(" flush_visual - Flushes dynamically allocated ports (for memory profiling)\n");
 	DebugPrintf(" dynamic_views - Lists active dynamic views\n");
 	DebugPrintf(" dropped_views - Lists dropped dynamic views\n");
-	DebugPrintf(" status_bar - Sets the colors of the status bar\n");
 #ifdef GFXW_DEBUG_WIDGETS
 	DebugPrintf(" print_widget - Shows active widgets (no params) or information on the specified widget indices\n");
 #endif
@@ -1335,28 +1333,6 @@
 	return true;
 }
 
-bool Console::cmdStatusBarColors(int argc, const char **argv) {
-	if (argc != 3) {
-		DebugPrintf("Sets the colors of the status bar\n");
-		DebugPrintf("Usage: %s <foreground color> <background color>\n", argv[0]);
-		return true;
-	}
-
-#ifdef INCLUDE_OLDGFX
-	_vm->_gamestate->titlebar_port->_color = _vm->_gamestate->ega_colors[atoi(argv[1])];
-	_vm->_gamestate->titlebar_port->_bgcolor = _vm->_gamestate->ega_colors[atoi(argv[2])];
-
-	_vm->_gamestate->status_bar_foreground = atoi(argv[1]);
-	_vm->_gamestate->status_bar_background = atoi(argv[2]);
-
-	sciw_set_status_bar(_vm->_gamestate, _vm->_gamestate->titlebar_port, _vm->_gamestate->_statusBarText,
-							_vm->_gamestate->status_bar_foreground, _vm->_gamestate->status_bar_background);
-	gfxop_update(_vm->_gamestate->gfx_state);
-#endif
-
-	return false;
-}
-
 bool Console::cmdPrintSegmentTable(int argc, const char **argv) {
 	DebugPrintf("Segment table:\n");
 

Modified: scummvm/trunk/engines/sci/console.h
===================================================================
--- scummvm/trunk/engines/sci/console.h	2009-10-30 14:22:22 UTC (rev 45537)
+++ scummvm/trunk/engines/sci/console.h	2009-10-30 14:39:26 UTC (rev 45538)
@@ -102,7 +102,6 @@
 	bool cmdFlushPorts(int argc, const char **argv);
 	bool cmdDynamicViews(int argc, const char **argv);
 	bool cmdDroppedViews(int argc, const char **argv);
-	bool cmdStatusBarColors(int argc, const char **argv);
 	bool cmdPrintWidget(int argc, const char **argv);
 	// Segments
 	bool cmdPrintSegmentTable(int argc, const char **argv);

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2009-10-30 14:22:22 UTC (rev 45537)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2009-10-30 14:39:26 UTC (rev 45538)
@@ -413,8 +413,6 @@
 
 	s->successor = NULL; // No successor
 	s->_statusBarText.clear(); // Status bar is blank
-	s->status_bar_foreground = 0;
-	s->status_bar_background = !s->resMan->isVGA() ? 15 : 255;
 
 	SystemString *str = &s->sys_strings->_strings[SYS_STRING_PARSER_BASE];
 	str->_name = "parser-base";

Modified: scummvm/trunk/engines/sci/engine/kmenu.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmenu.cpp	2009-10-30 14:22:22 UTC (rev 45537)
+++ scummvm/trunk/engines/sci/engine/kmenu.cpp	2009-10-30 14:39:26 UTC (rev 45538)
@@ -79,8 +79,8 @@
 reg_t kDrawStatus(EngineState *s, int argc, reg_t *argv) {
 	reg_t textReference = argv[0];
 	Common::String text;
-	int16 colorPen = (argc > 1) ? argv[1].toSint16() : 0; // old code was: s->status_bar_foreground;
-	int16 colorBack = (argc > 2) ? argv[2].toSint16() : s->resMan->isVGA() ? 255 : 15; // s->status_bar_background;
+	int16 colorPen = (argc > 1) ? argv[1].toSint16() : 0;
+	int16 colorBack = (argc > 2) ? argv[2].toSint16() : s->resMan->isVGA() ? 255 : 15;
 
 	if (!textReference.isNull()) {
 		// Sometimes this is called without giving text, if thats the case dont process it
@@ -215,9 +215,10 @@
 
 #ifdef INCLUDE_OLDGFX
 		sciw_set_menubar(s, s->titlebar_port, s->_menubar, menu_nr);
-		FULL_REDRAW;
 #endif
 
+		FULL_REDRAW;
+
 		old_item = -1;
 		old_menu = -1;
 
@@ -234,13 +235,6 @@
 			case SCI_EVT_KEYBOARD:
 				switch (ev.data) {
 
-				case '`':
-#ifdef INCLUDE_OLDGFX
-					if (ev.buckybits & SCI_EVM_CTRL)
-						s->visual->print(0);
-#endif
-					break;
-
 				case SCI_K_ESC:
 					menu_mode = 0;
 					break;
@@ -338,15 +332,16 @@
 
 		} /* while (menu_mode) */
 
+		// Clear the menu
 #ifdef INCLUDE_OLDGFX
 		if (port) {
 			delete port;
 			port = NULL;
-
-			sciw_set_status_bar(s, s->titlebar_port, s->_statusBarText, s->status_bar_foreground, s->status_bar_background);
-			gfxop_update(s->gfx_state);
 		}
 #endif
+
+		s->_gui->clearMenuBar();
+
 		FULL_REDRAW;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp	2009-10-30 14:22:22 UTC (rev 45537)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp	2009-10-30 14:39:26 UTC (rev 45538)
@@ -305,8 +305,8 @@
 		assert(_menubar);
 	_menubar->saveLoadWithSerializer(s);
 
-	s.syncAsSint32LE(status_bar_foreground);
-	s.syncAsSint32LE(status_bar_background);
+	s.skip(4, VER(12), VER(12));	// obsolete: used to be status_bar_foreground
+	s.skip(4, VER(12), VER(12));	// obsolete: used to be status_bar_background
 
 	sync_SegManagerPtr(s, resMan, _segMan);
 

Modified: scummvm/trunk/engines/sci/engine/state.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/state.cpp	2009-10-30 14:22:22 UTC (rev 45537)
+++ scummvm/trunk/engines/sci/engine/state.cpp	2009-10-30 14:39:26 UTC (rev 45538)
@@ -43,9 +43,6 @@
 
 	restarting_flags = 0;
 
-	status_bar_foreground = 0;
-	status_bar_background = 0;
-
 #ifdef INCLUDE_OLDGFX
 	pic_priority_table = 0;
 	pic_not_valid = 0;

Modified: scummvm/trunk/engines/sci/engine/state.h
===================================================================
--- scummvm/trunk/engines/sci/engine/state.h	2009-10-30 14:22:22 UTC (rev 45537)
+++ scummvm/trunk/engines/sci/engine/state.h	2009-10-30 14:39:26 UTC (rev 45538)
@@ -145,8 +145,6 @@
 	/** Text on the status bar, or NULL if the title bar is blank */
 	Common::String _statusBarText;
 
-	int status_bar_foreground, status_bar_background;
-
 #ifdef INCLUDE_OLDGFX
 	int *pic_priority_table; /**< 16 entries with priorities or NULL if not present */
 	byte pic_not_valid; /**< Is 0 if the background picture is "valid" */

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-30 14:22:22 UTC (rev 45537)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-30 14:39:26 UTC (rev 45538)
@@ -301,8 +301,7 @@
 }
 
 void SciGui::clearMenuBar() {
-	// TODO: Implement menubar
-	warning("TODO: clearMenuBar()");
+	drawStatus("", 0, 0);
 }
 
 void SciGui::drawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo) {

Modified: scummvm/trunk/engines/sci/gui32/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-10-30 14:22:22 UTC (rev 45537)
+++ scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-10-30 14:39:26 UTC (rev 45538)
@@ -805,8 +805,6 @@
 	_s->titlebar_port->_bgcolor.visual = get_pic_color(_s, colorBack);
 	_s->titlebar_port->_bgcolor.mask = GFX_MASK_VISUAL;
 
-	_s->status_bar_foreground = colorPen;
-	_s->status_bar_background = colorBack;
 	_s->_statusBarText = text;
 
 	sciw_set_status_bar(_s, _s->titlebar_port, _s->_statusBarText, colorPen, colorBack);


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