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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Tue Oct 20 14:00:37 CEST 2009


Revision: 45264
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45264&view=rev
Author:   m_kiewitz
Date:     2009-10-20 12:00:37 +0000 (Tue, 20 Oct 2009)

Log Message:
-----------
SCI/newgui: kDisplay fixed so text centering will work correctly (based on sierra sci disassembly) - fixes kq5 credits, lb2 intro selection

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

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-20 11:14:22 UTC (rev 45263)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-20 12:00:37 UTC (rev 45264)
@@ -177,7 +177,7 @@
 	GuiTextAlignment alignment = SCI_TEXT_ALIGNMENT_LEFT;
 	int16 bgcolor = -1, width = -1, bRedraw = 1;
 	bool doSaveUnder = false;
-	Common::Rect rect, *orect = &((GuiWindow *)_gfx->GetPort())->dims;
+	Common::Rect rect;
 
 	// Make a "backup" of the port settings
 	GuiPort oldPort = *_gfx->GetPort();
@@ -239,15 +239,12 @@
 		}
 	}
 
-	// FIXME: this code seems to be broken somewhat. KQ5 sets coordinates to 90, 80 and sets width to 320
-	//         our code can not handle this currently, so the text wont get centered as it should
-	//         clipping coordinates to 0, 0 isnt working either, because kq5 writes to coordinates 90, 80 AND 89, 80
-	//         to create a shadow of the font. Investigation into disassembly needed
-
 	// now drawing the text
 	_gfx->TextSize(rect, text, -1, width);
-	_gfx->Move((orect->left <= _screen->_width ? 0 : _screen->_width - orect->left), (orect->top <= _screen->_height ? 0 : _screen->_height - orect->top)); // move port to (0,0)
 	rect.moveTo(_gfx->GetPort()->curLeft, _gfx->GetPort()->curTop);
+	_gfx->Move(rect.right <= _screen->_width ? 0 : _screen->_width - rect.right, rect.bottom <= _screen->_height ? 0 : _screen->_width - rect.bottom);
+	rect.moveTo(_gfx->GetPort()->curLeft, _gfx->GetPort()->curTop);
+
 	if (doSaveUnder)
 		_s->r_acc = _gfx->BitsSave(rect, SCI_SCREEN_MASK_VISUAL);
 	if (bgcolor != -1)


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