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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sun Oct 18 14:44:52 CEST 2009


Revision: 45220
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45220&view=rev
Author:   m_kiewitz
Date:     2009-10-18 12:44:51 +0000 (Sun, 18 Oct 2009)

Log Message:
-----------
SCI/newgui: listbox now finally working correctly

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui.cpp
    scummvm/trunk/engines/sci/gui/gui_gfx.cpp

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-18 12:13:58 UTC (rev 45219)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-18 12:44:51 UTC (rev 45220)
@@ -391,8 +391,8 @@
 
 void SciGui::drawControlList(Common::Rect rect, reg_t obj, int16 maxChars, int16 count, const char **entries, GuiResourceId fontId, int16 style, int16 upperPos, int16 cursorPos, bool isAlias, bool hilite) {
 	if (!hilite) {
+		_gfx->drawListControl(rect, obj, maxChars, count, entries, fontId, upperPos, cursorPos, isAlias);
 		rect.grow(1);
-		_gfx->drawListControl(rect, obj, maxChars, count, entries, fontId, upperPos, cursorPos, isAlias);
 		if (isAlias && (style & 8)) {
 			_gfx->FrameRect(rect);
 		}

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-18 12:13:58 UTC (rev 45219)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-18 12:44:51 UTC (rev 45220)
@@ -745,33 +745,33 @@
 	int16 i;
 	const char *listEntry;
 	int16 listEntryLen;
+	int16 lastYpos;
 
 	// draw basic window
 	EraseRect(workerRect);
 	workerRect.grow(1);
 	FrameRect(workerRect);
-	PUT_SEL32V(obj, nsLeft, workerRect.left); PUT_SEL32V(obj, nsTop, workerRect.top);
-	PUT_SEL32V(obj, nsRight, workerRect.right); PUT_SEL32V(obj, nsBottom, workerRect.bottom);
+
 	// draw UP/DOWN arrows
-	workerRect = rect;
+	workerRect.top++;
 	TextBox(controlListUpArrow, 0, workerRect, 1, 0);
 	workerRect.top = workerRect.bottom - 10;
 	TextBox(controlListDownArrow, 0, workerRect, 1, 0);
 
 	// Draw inner lines
-	workerRect = rect;
-	workerRect.top = rect.top + 10;
-	workerRect.bottom = rect.bottom - 10;
+	workerRect.top = rect.top + 9;
+	workerRect.bottom -= 10;
 	FrameRect(workerRect);
 	workerRect.grow(-1);
-	
+
 	SetFont(fontId);
 	fontSize = _curPort->fontHeight;
 	PenColor(_curPort->penClr); BackColor(_curPort->backClr);
-	workerRect.bottom = workerRect.top + fontSize;
+	workerRect.bottom = workerRect.top + 9;
+	lastYpos = rect.bottom - fontSize;
 
 	// Write actual text
-	for (i = 0; i < count; i++) {
+	for (i = upperPos; i < count; i++) {
 		EraseRect(workerRect);
 		listEntry = entries[i];
 		if (listEntry[0]) {
@@ -783,6 +783,8 @@
 			}
 		}
 		workerRect.translate(0, fontSize);
+		if (workerRect.bottom > lastYpos)
+			break;
 	}
 
 	SetFont(oldFontId);


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