[Scummvm-cvs-logs] SF.net SVN: scummvm: [28397] scummvm/trunk/engines/saga/sfuncs.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu Aug 2 01:38:31 CEST 2007


Revision: 28397
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28397&view=rev
Author:   thebluegr
Date:     2007-08-01 16:38:31 -0700 (Wed, 01 Aug 2007)

Log Message:
-----------
The text of the psychic profile in IHNM is shown correctly now

Modified Paths:
--------------
    scummvm/trunk/engines/saga/sfuncs.cpp

Modified: scummvm/trunk/engines/saga/sfuncs.cpp
===================================================================
--- scummvm/trunk/engines/saga/sfuncs.cpp	2007-08-01 22:11:04 UTC (rev 28396)
+++ scummvm/trunk/engines/saga/sfuncs.cpp	2007-08-01 23:38:31 UTC (rev 28397)
@@ -1417,14 +1417,13 @@
 }
 
 void Script::sfPsychicProfile(SCRIPTFUNC_PARAMS) {
-	int stringId;
+	int stringId, textHeight;
 	static PalEntry cur_pal[PAL_ENTRIES];
 	PalEntry *pal;
+	TextListEntry textEntry;
 	Event event;
 	Event *q_event;
 
-	// FIXME: This still needs work: the text placement is incorrect
-
 	thread->wait(kWaitTypePlacard);
 
 	_vm->_interface->rememberMode();
@@ -1469,20 +1468,14 @@
 
 	q_event = _vm->_events->chain(q_event, &event);
 
-	// Put the text in the center of the viewport, assuming it will fit on
-	// one line. If we cannot make that assumption we'll need to extend
-	// the text drawing function so that it can center text around a point.
-	// It doesn't end up in exactly the same spot as the original did it,
-	// but it's close enough for now at least.
+	textHeight = _vm->_font->getHeight(kKnownFontVerb, thread->_strings->getString(stringId), 226, kFontCentered);
 
-	// FIXME: This assumption is wrong for the psychic profile, the text
-	// placement is incorrect
-
-	TextListEntry textEntry;
-
 	textEntry.knownColor = kKnownColorBlack;
-	textEntry.point.x = _vm->getDisplayWidth() / 2;
-	textEntry.point.y = (_vm->_scene->getHeight() - _vm->_font->getHeight(kKnownFontMedium)) / 2;
+	textEntry.useRect = true;
+	textEntry.rect.left = 245;
+	textEntry.rect.setHeight(210 + 76);
+	textEntry.rect.setWidth(226);
+	textEntry.rect.top = 210 - textHeight;
 	textEntry.font = kKnownFontVerb;
 	textEntry.flags = (FontEffectFlags)(kFontCentered);
 	textEntry.text = thread->_strings->getString(stringId);


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