[Scummvm-cvs-logs] CVS: scummvm/saga sfuncs.cpp,1.61,1.62

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Fri Dec 31 09:41:03 CET 2004


Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19748

Modified Files:
	sfuncs.cpp 
Log Message:
Slight adjustment of placard text position. It's still not identical to the
original, but I don't consider that to be a problem.


Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- sfuncs.cpp	30 Dec 2004 18:45:48 -0000	1.61
+++ sfuncs.cpp	31 Dec 2004 17:39:57 -0000	1.62
@@ -916,12 +916,12 @@
 
 // Script function #48 (0x30)
 int Script::sfPlacard(SCRIPTFUNC_PARAMS) {
-	GAME_DISPLAYINFO disp_info;
+	GAME_DISPLAYINFO disp;
 	SURFACE *back_buf = _vm->_gfx->getBackBuffer();
 	PALENTRY cur_pal[PAL_ENTRIES];
 	PALENTRY *pal;
 
-	_vm->getDisplayInfo(&disp_info);
+	_vm->getDisplayInfo(&disp);
 
 	_vm->_gfx->showCursor(false);
 	_vm->_gfx->getCurrentPal(cur_pal);
@@ -929,13 +929,18 @@
 
 	_vm->_interface->setStatusText("");
 
-	Rect rect(disp_info.logical_w, disp_info.scene_h);
+	Rect rect(disp.logical_w, disp.scene_h);
 	drawRect(back_buf, &rect, 138);
 
-	// TODO: Draw the text at the correct spot. This is (probably) just a
-	// close approximation.
+	// 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.
+
 	_vm->textDraw(MEDIUM_FONT_ID, back_buf, getString(thread->pop()),
-		disp_info.logical_w / 2, disp_info.scene_h / 2,
+		disp.logical_w / 2,
+		(disp.scene_h - _vm->_font->getHeight(MEDIUM_FONT_ID)) / 2,
 		_vm->_gfx->getWhite(), _vm->_gfx->getBlack(),
 		FONT_OUTLINE | FONT_CENTERED);
 





More information about the Scummvm-git-logs mailing list