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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Fri Jan 22 18:38:06 CET 2010


Revision: 47441
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47441&view=rev
Author:   m_kiewitz
Date:     2010-01-22 17:38:06 +0000 (Fri, 22 Jan 2010)

Log Message:
-----------
SCI: draw a black line under menubar when menu is active (effectively for jones, wouldnt be needed otherwise), adjust inverting menu selections accordingly

Modified Paths:
--------------
    scummvm/trunk/engines/sci/graphics/gfx.cpp
    scummvm/trunk/engines/sci/graphics/gfx.h
    scummvm/trunk/engines/sci/graphics/menu.cpp

Modified: scummvm/trunk/engines/sci/graphics/gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gfx.cpp	2010-01-22 14:44:40 UTC (rev 47440)
+++ scummvm/trunk/engines/sci/graphics/gfx.cpp	2010-01-22 17:38:06 UTC (rev 47441)
@@ -66,6 +66,8 @@
 	_text->SetFont(0);
 	_menuPort->rect = Common::Rect(0, 0, _screen->getWidth(), _screen->getHeight());
 	_menuBarRect = Common::Rect(0, 0, _screen->getWidth(), 9);
+	_menuRect = Common::Rect(0, 0, _screen->getWidth(), 10);
+	_menuLine = Common::Rect(0, 9, _screen->getWidth(), 10);
 
 	_EGAdrawingVisualize = false;
 

Modified: scummvm/trunk/engines/sci/graphics/gfx.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/gfx.h	2010-01-22 14:44:40 UTC (rev 47440)
+++ scummvm/trunk/engines/sci/graphics/gfx.h	2010-01-22 17:38:06 UTC (rev 47441)
@@ -105,6 +105,8 @@
 
 	Port *_menuPort;
 	Common::Rect _menuBarRect;
+	Common::Rect _menuRect;
+	Common::Rect _menuLine;
 	Port *_curPort;
 
 	View *getView(GuiResourceId viewNum);

Modified: scummvm/trunk/engines/sci/graphics/menu.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/menu.cpp	2010-01-22 14:44:40 UTC (rev 47440)
+++ scummvm/trunk/engines/sci/graphics/menu.cpp	2010-01-22 17:38:06 UTC (rev 47441)
@@ -300,8 +300,9 @@
 	GuiMenuList::iterator listIterator;
 	GuiMenuList::iterator listEnd = _list.end();
 
-	// Hardcoded black on white
+	// Hardcoded black on white and a black line afterwards
 	_gfx->FillRect(_gfx->_menuBarRect, 1, _screen->getColorWhite());
+	_gfx->FillRect(_gfx->_menuLine, 1, 0);
 	_gfx->PenColor(0);
 	_gfx->MoveTo(8, 1);
 
@@ -418,7 +419,7 @@
 	}
 	if (!_barSaveHandle.isNull()) {
 		_gfx->BitsRestore(_barSaveHandle);
-		_gfx->BitsShow(_gfx->_menuBarRect);
+		_gfx->BitsShow(_gfx->_menuRect);
 		_barSaveHandle = NULL_REG;
 	}
 	if (_oldPort)
@@ -559,6 +560,8 @@
 	}
 	_gfx->TextGreyedOutput(false);
 
+	// Draw the black line again
+	_gfx->FillRect(_gfx->_menuLine, 1, 0);
 
 	_menuRect.left -= 8;
 	_menuRect.left--; _menuRect.right++; _menuRect.bottom++;
@@ -571,8 +574,8 @@
 	if (itemId == 0)
 		return;
 
-	itemRect.top += (itemId - 1) * _gfx->_curPort->fontHeight;
-	itemRect.bottom = itemRect.top + _gfx->_curPort->fontHeight + 1;
+	itemRect.top += (itemId - 1) * _gfx->_curPort->fontHeight + 1;
+	itemRect.bottom = itemRect.top + _gfx->_curPort->fontHeight;
 	itemRect.left++; itemRect.right--;
 
 	_gfx->InvertRect(itemRect);
@@ -648,7 +651,7 @@
 
 	calculateTextWidth();
 	_oldPort = _gfx->SetPort(_gfx->_menuPort);
-	_barSaveHandle = _gfx->BitsSave(_gfx->_menuBarRect, SCI_SCREEN_MASK_VISUAL);
+	_barSaveHandle = _gfx->BitsSave(_gfx->_menuRect, SCI_SCREEN_MASK_VISUAL);
 
 	_gfx->PenColor(0);
 	_gfx->BackColor(_screen->getColorWhite());
@@ -656,7 +659,7 @@
 	drawBar();
 	drawMenu(0, curItemEntry->menuId);
 	invertMenuSelection(curItemEntry->id);
-	_gfx->BitsShow(_gfx->_menuBarRect);
+	_gfx->BitsShow(_gfx->_menuRect);
 	_gfx->BitsShow(_menuRect);
 
 	while (true) {
@@ -769,13 +772,13 @@
 
 	calculateTextWidth();
 	_oldPort = _gfx->SetPort(_gfx->_menuPort);
-	_barSaveHandle = _gfx->BitsSave(_gfx->_menuBarRect, SCI_SCREEN_MASK_VISUAL);
+	_barSaveHandle = _gfx->BitsSave(_gfx->_menuRect, SCI_SCREEN_MASK_VISUAL);
 
 	_gfx->PenColor(0);
 	_gfx->BackColor(_screen->getColorWhite());
 
 	drawBar();
-	_gfx->BitsShow(_gfx->_menuBarRect);
+	_gfx->BitsShow(_gfx->_menuRect);
 
 	while (true) {
 		curEvent = _event->get(SCI_EVENT_ANY);


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