[Scummvm-cvs-logs] SF.net SVN: scummvm:[40891] scummvm/trunk/engines/sci/engine/kgraphics.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon May 25 18:30:39 CEST 2009


Revision: 40891
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40891&view=rev
Author:   thebluegr
Date:     2009-05-25 16:30:39 +0000 (Mon, 25 May 2009)

Log Message:
-----------
Re-enabled the code for correct text positioning - it should work correctly now

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-05-25 13:40:46 UTC (rev 40890)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-05-25 16:30:39 UTC (rev 40891)
@@ -3267,33 +3267,25 @@
 		}
 	}
 
-	// FIXME: This code places texts incorrectly on screen. Apparently, it was used for latter SCI1 games
-	// (1.000.510 onwards), like Eco Quest 1. It has been replaced with clipping code instead
-#if 0
-	// If the text does not fit on the screen, move it to the left and upwards until it does
-	if (halign == ALIGN_LEFT)
+	if (halign == ALIGN_LEFT) {
+		// If the text does not fit on the screen, move it to the left and upwards until it does
 		GFX_ASSERT(gfxop_get_text_params(s->gfx_state, font_nr, text, area.width, &area.width, &area.height, 0, NULL, NULL, NULL));
 
-	// Make the text fit on the screen
-	if (area.x + area.width > 320)
-		area.x += 320 - area.x - area.width; // Plus negative number = subtraction
+		// Make the text fit on the screen
+		if (area.x + area.width > 320)
+			area.x += 320 - area.x - area.width; // Plus negative number = subtraction
 
-	if (area.y + area.height > 200)
-		area.y += 200 - area.y - area.height; // Plus negative number = subtraction
-#else
-	// If the text does not fit on the screen, clip it till it does
-	if (area.x + area.width > s->gfx_state->pic_port_bounds.width) {
-		warning("Text does not fit on screen width, clipping it");
-		area.width = s->gfx_state->pic_port_bounds.width - area.x;
-	}
+		if (area.y + area.height > 200)
+			area.y += 200 - area.y - area.height; // Plus negative number = subtraction
+	} else {
+		// If the text does not fit on the screen, clip it till it does
+		if (area.x + area.width > s->gfx_state->pic_port_bounds.width)
+			area.width = s->gfx_state->pic_port_bounds.width - area.x;
 
-	if (area.y + area.height > s->gfx_state->pic_port_bounds.height) {
-		warning("Text does not fit on screen height, clipping it");
-		area.height = s->gfx_state->pic_port_bounds.height - area.y;
+		if (area.y + area.height > s->gfx_state->pic_port_bounds.height)
+			area.height = s->gfx_state->pic_port_bounds.height - area.y;
 	}
-#endif
 
-
 	if (gray)
 		color1 = &bg_color;
 	else


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