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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat May 23 14:08:36 CEST 2009


Revision: 40807
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40807&view=rev
Author:   thebluegr
Date:     2009-05-23 12:08:36 +0000 (Sat, 23 May 2009)

Log Message:
-----------
Fixed clipping code for texts which do not fit on screen, and added a warning when this happens

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-23 11:56:27 UTC (rev 40806)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-05-23 12:08:36 UTC (rev 40807)
@@ -3268,7 +3268,8 @@
 		}
 	}
 
-	// This code places texts incorrectly on screen
+	// 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)
@@ -3281,13 +3282,16 @@
 	if (area.y + area.height > 200)
 		area.y += 200 - area.y - area.height; // Plus negative number = subtraction
 #else
-	// Replaced with this instead
 	// 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 = CLIP<int>(area.width, 0, s->gfx_state->pic_port_bounds.width);
+	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 > s->gfx_state->pic_port_bounds.height)
-		area.height = CLIP<int>(area.height, 0, s->gfx_state->pic_port_bounds.height);
+	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;
+	}
 #endif
 
 


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