[Scummvm-cvs-logs] SF.net SVN: scummvm:[33691] scummvm/trunk/engines/touche

cyx at users.sourceforge.net cyx at users.sourceforge.net
Thu Aug 7 23:50:12 CEST 2008


Revision: 33691
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33691&view=rev
Author:   cyx
Date:     2008-08-07 21:50:12 +0000 (Thu, 07 Aug 2008)

Log Message:
-----------
fix for bug #2040484: TOUCHE: Graphic glitch with long answer options

Modified Paths:
--------------
    scummvm/trunk/engines/touche/graphics.cpp
    scummvm/trunk/engines/touche/graphics.h
    scummvm/trunk/engines/touche/touche.cpp
    scummvm/trunk/engines/touche/touche.h

Modified: scummvm/trunk/engines/touche/graphics.cpp
===================================================================
--- scummvm/trunk/engines/touche/graphics.cpp	2008-08-07 21:49:55 UTC (rev 33690)
+++ scummvm/trunk/engines/touche/graphics.cpp	2008-08-07 21:50:12 UTC (rev 33691)
@@ -76,10 +76,13 @@
 	return chrData[2];
 }
 
-void Graphics::drawString16(uint8 *dst, int dstPitch, uint16 color, int x, int y, const char *str) {
+void Graphics::drawString16(uint8 *dst, int dstPitch, uint16 color, int x, int y, const char *str, int xmax) {
 	while (*str) {
 		uint8 chr = (uint8)*str++;
 		x += drawChar16(dst, dstPitch, chr, x, y, color);
+		if (xmax != 0 && x > xmax) {
+			break;
+		}
 	}
 }
 

Modified: scummvm/trunk/engines/touche/graphics.h
===================================================================
--- scummvm/trunk/engines/touche/graphics.h	2008-08-07 21:49:55 UTC (rev 33690)
+++ scummvm/trunk/engines/touche/graphics.h	2008-08-07 21:50:12 UTC (rev 33691)
@@ -40,7 +40,7 @@
 	static void setupFont(Common::Language language);
 	static int getStringWidth16(const char *str);
 	static int getCharWidth16(uint8 chr);
-	static void drawString16(uint8 *dst, int dstPitch, uint16 color, int x, int y, const char *str);
+	static void drawString16(uint8 *dst, int dstPitch, uint16 color, int x, int y, const char *str, int xmax = 0);
 	static int drawChar16(uint8 *dst, int dstPitch, uint8 chr, int x, int y, uint16 color);
 	static void fillRect(uint8 *dst, int dstPitch, int x, int y, int w, int h, uint8 color);
 	static void drawRect(uint8 *dst, int dstPitch, int x, int y, int w, int h, uint8 color1, uint8 color2);

Modified: scummvm/trunk/engines/touche/touche.cpp
===================================================================
--- scummvm/trunk/engines/touche/touche.cpp	2008-08-07 21:49:55 UTC (rev 33690)
+++ scummvm/trunk/engines/touche/touche.cpp	2008-08-07 21:50:12 UTC (rev 33691)
@@ -1248,10 +1248,11 @@
 	return Graphics::getStringWidth16(str);
 }
 
-void ToucheEngine::drawString(uint16 color, int x, int y, int16 num) {
+void ToucheEngine::drawString(uint16 color, int x, int y, int16 num, StringType strType) {
+	const int xmax = (_language == Common::ES_ESP && strType == kStringTypeConversation) ? kScreenWidth - 20 : 0;
 	if (num) {
 		const char *str = getString(num);
-		Graphics::drawString16(_offscreenBuffer, kScreenWidth, color, x, y, str);
+		Graphics::drawString16(_offscreenBuffer, kScreenWidth, color, x, y, str, xmax);
 	}
 }
 
@@ -2414,7 +2415,7 @@
 	}
 	drawConversationPanel();
 	for (int i = 0; i < 4; ++i) {
-		drawString(214, 42, 328 + i * kTextHeight, _conversationChoicesTable[_scrollConversationChoiceOffset + i].msg);
+		drawString(214, 42, 328 + i * kTextHeight, _conversationChoicesTable[_scrollConversationChoiceOffset + i].msg, kStringTypeConversation);
 	}
 	updateScreenArea(0, 320, kScreenWidth, kScreenHeight - 320);
 	_conversationAreaCleared = false;
@@ -2422,7 +2423,7 @@
 
 void ToucheEngine::drawConversationString(int num, uint16 color) {
 	const int y = 328 + num * kTextHeight;
-	drawString(color, 42, y, _conversationChoicesTable[num + _scrollConversationChoiceOffset].msg);
+	drawString(color, 42, y, _conversationChoicesTable[num + _scrollConversationChoiceOffset].msg, kStringTypeConversation);
 	updateScreenArea(0, y, kScreenWidth, kTextHeight);
 }
 

Modified: scummvm/trunk/engines/touche/touche.h
===================================================================
--- scummvm/trunk/engines/touche/touche.h	2008-08-07 21:49:55 UTC (rev 33690)
+++ scummvm/trunk/engines/touche/touche.h	2008-08-07 21:50:12 UTC (rev 33691)
@@ -331,6 +331,11 @@
 	kMaxSaveStates = 100
 };
 
+enum StringType {
+	kStringTypeDefault,
+	kStringTypeConversation
+};
+
 class MidiPlayer;
 
 class ToucheEngine: public Engine {
@@ -399,7 +404,7 @@
 	void setKeyCharMoney();
 	const char *getString(int num) const;
 	int getStringWidth(int num) const;
-	void drawString(uint16 color, int x, int y, int16 num);
+	void drawString(uint16 color, int x, int y, int16 num, StringType strType = kStringTypeDefault);
 	void drawGameString(uint16 color, int x1, int y, const char *str);
 	int restartKeyCharScriptOnAction(int action, int obj1, int obj2);
 	void buildSpriteScalingTable(int z1, int z2);


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