[Scummvm-cvs-logs] scummvm master -> 227e69ef08105ac9af64374fd8333a96078e194d

bluegr md5 at scummvm.org
Sat Oct 8 18:19:37 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
227e69ef08 SCI2+: Fixed the implementation of kTextSize(), removing some hacks


Commit: 227e69ef08105ac9af64374fd8333a96078e194d
    https://github.com/scummvm/scummvm/commit/227e69ef08105ac9af64374fd8333a96078e194d
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-10-08T09:11:14-07:00

Commit Message:
SCI2+: Fixed the implementation of kTextSize(), removing some hacks

Thanks to lskovlun for the fix

Changed paths:
    engines/sci/engine/kgraphics.cpp
    engines/sci/graphics/text32.cpp



diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 83eb941..ec0b4a8 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -379,8 +379,13 @@ reg_t kTextSize(EngineState *s, int argc, reg_t *argv) {
 	}
 
 	debugC(kDebugLevelStrings, "GetTextSize '%s' -> %dx%d", text.c_str(), textWidth, textHeight);
-	dest[2] = make_reg(0, textHeight);
-	dest[3] = make_reg(0, textWidth);
+	if (getSciVersion() <= SCI_VERSION_1_1) {
+		dest[2] = make_reg(0, textHeight);
+		dest[3] = make_reg(0, textWidth);
+	} else {
+		dest[2] = make_reg(0, textWidth);
+		dest[3] = make_reg(0, textHeight);
+	}
 
 	return s->r_acc;
 }
diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp
index f13a56f..82740c0 100644
--- a/engines/sci/graphics/text32.cpp
+++ b/engines/sci/graphics/text32.cpp
@@ -94,15 +94,8 @@ void GfxText32::drawTextBitmap(reg_t textObject, uint16 textX, uint16 textY, uin
 
 	while (*txt) {
 		charCount = GetLongest(txt, maxWidth, font);
-		if (charCount == 0) {
-			// If the text does not fit inside the given plane, use the
-			// whole screen.
-			// TODO/FIXME: Is this really needed? Perhaps some other
-			// functionality is missing instead?
-			charCount = GetLongest(txt, _screen->getWidth() - textX, font);
-			if (charCount == 0)
-				break;
-		}
+		if (charCount == 0)
+			break;
 
 		uint16 curX = textX;
 
@@ -248,11 +241,6 @@ void GfxText32::kernelTextSize(const char *text, int16 font, int16 maxWidth, int
 	Size(rect, text, font, maxWidth);
 	*textWidth = rect.width();
 	*textHeight = rect.height();
-
-	// TODO: Setting textWidth properly changes the subtitle plane top to 0.
-	// I have no idea why, so we currently hack in the old behavior here.
-	*textWidth = 0;
-	*textHeight = 0;
 }
 
 void GfxText32::StringWidth(const char *str, GuiResourceId fontId, int16 &textWidth, int16 &textHeight) {






More information about the Scummvm-git-logs mailing list