[Scummvm-cvs-logs] SF.net SVN: scummvm:[46230] scummvm/trunk/engines/m4

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Tue Dec 1 11:47:40 CET 2009


Revision: 46230
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46230&view=rev
Author:   dreammaster
Date:     2009-12-01 10:47:39 +0000 (Tue, 01 Dec 2009)

Log Message:
-----------
Corrected the palette colours for the interface elements

Modified Paths:
--------------
    scummvm/trunk/engines/m4/scene.cpp
    scummvm/trunk/engines/m4/scene.h

Modified: scummvm/trunk/engines/m4/scene.cpp
===================================================================
--- scummvm/trunk/engines/m4/scene.cpp	2009-12-01 10:26:46 UTC (rev 46229)
+++ scummvm/trunk/engines/m4/scene.cpp	2009-12-01 10:47:39 UTC (rev 46230)
@@ -114,6 +114,12 @@
 		_backgroundSurface->loadBackground(sceneNumber);
 		_palData = NULL;
 	} else {
+		// Set system palette entries
+		_vm->_palette->blockRange(0, 7);
+		RGB8 sysColors[3] = { {0x1f<<2, 0x2d<<2, 0x31<<2, 0}, {0x24<<2, 0x37<<2, 0x3a<<2, 0}, 
+			{0x00<<2, 0x10<<2, 0x16<<2, 0}};
+		_vm->_palette->setPalette(&sysColors[0], 4, 3);
+
 		_backgroundSurface->loadBackground(sceneNumber, &_palData);
 		_vm->_palette->addRange(_palData);
 		_backgroundSurface->translate(_palData);
@@ -800,14 +806,13 @@
 
 void InterfaceElement::setFontMode(FontMode newMode) {
 	switch (newMode) {
-	case MODE_0:
+	case ITEM_NORMAL:
 		_vm->_font->setColors(4, 4, 0xff);
 		break;
-	case MODE_1:
-		//_vm->_font->setColors(5, 5, 0xff);
-		_vm->_font->setColors(0xff, 0xff, 0xff);
+	case ITEM_HIGHLIGHTED:
+		_vm->_font->setColors(5, 5, 0xff);
 		break;
-	case MODE_2:
+	case ITEM_SELECTED:
 		_vm->_font->setColors(6, 6, 0xff);
 		break;
 	}
@@ -845,8 +850,10 @@
 			Common::Rect r;
 			getActionRect(actionId, r);
 
-			// Determine the font colour depending on whether an item is selected
-			setFontMode((_highlightedAction == actionId) ? MODE_1 : MODE_0);
+			// Determine the font colour depending on whether an item is selected. Note that the 'Look' item
+			// is always 'selected', even when another action is selected
+			setFontMode((_highlightedAction == actionId) ? ITEM_HIGHLIGHTED : 
+				((actionId == kVerbLook) ? ITEM_SELECTED : ITEM_NORMAL));
 
 			// Get the verb action and capitalise it
 			const char *verbStr = _vm->_globals->getVocab(actionId);
@@ -862,10 +869,13 @@
 
 bool ActionsView::onEvent(M4EventType eventType, int param1, int x, int y, bool &captureEvents) {
 	if (eventType == MEVENT_MOVE) {
-		// If the cursor isn't in "wait mode", reset it back to the normal cursor
-		if (_vm->_mouse->getCursorNum() != CURSOR_WAIT)
-			_vm->_mouse->setCursorNum(CURSOR_ARROW);
+		// If the cursor isn't in "wait mode", don't do any processing
+		if (_vm->_mouse->getCursorNum() == CURSOR_WAIT)
+			return true;
 
+		// Ensure the cursor is the standard arrow
+		_vm->_mouse->setCursorNum(CURSOR_ARROW);
+
 		// Check if any of the actions are currently highlighted
 		_highlightedAction = 0;
 		for (int i = kVerbLook; i <= kVerbThrow; ++i) {

Modified: scummvm/trunk/engines/m4/scene.h
===================================================================
--- scummvm/trunk/engines/m4/scene.h	2009-12-01 10:26:46 UTC (rev 46229)
+++ scummvm/trunk/engines/m4/scene.h	2009-12-01 10:47:39 UTC (rev 46230)
@@ -127,7 +127,7 @@
 	void nextCommonCursor();
 };
 
-enum FontMode {MODE_0, MODE_1, MODE_2};
+enum FontMode {ITEM_NORMAL, ITEM_HIGHLIGHTED, ITEM_SELECTED};
 
 class InterfaceElement: public View {
 protected:


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