[Scummvm-cvs-logs] SF.net SVN: scummvm:[41374] scummvm/trunk/engines/agos

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Mon Jun 8 16:50:34 CEST 2009


Revision: 41374
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41374&view=rev
Author:   Kirben
Date:     2009-06-08 14:50:34 +0000 (Mon, 08 Jun 2009)

Log Message:
-----------
Add more Polish font data for The Feeble Files.

Modified Paths:
--------------
    scummvm/trunk/engines/agos/agos.h
    scummvm/trunk/engines/agos/string.cpp

Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h	2009-06-08 14:47:38 UTC (rev 41373)
+++ scummvm/trunk/engines/agos/agos.h	2009-06-08 14:50:34 UTC (rev 41374)
@@ -848,6 +848,7 @@
 
 	void skipSpeech();
 
+	const char *getPixelLength(const char *string, uint16 maxWidth, uint16 &pixels);
 	bool printNameOf(Item *item, uint x, uint y);
 	bool printTextOf(uint a, uint x, uint y);
 	void printVerbOf(uint hitarea_id);

Modified: scummvm/trunk/engines/agos/string.cpp
===================================================================
--- scummvm/trunk/engines/agos/string.cpp	2009-06-08 14:47:38 UTC (rev 41373)
+++ scummvm/trunk/engines/agos/string.cpp	2009-06-08 14:50:34 UTC (rev 41374)
@@ -333,6 +333,32 @@
 	error("loadTextIntoMem: didn't find %d", stringId);
 }
 
+static const byte polish_charWidth[226] = {
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 6, 2, 8, 7, 6,10, 8, 2,
+	4, 4, 7, 6, 3, 4, 2, 3, 6, 4,
+	6, 6, 7, 6, 6, 6, 6, 6, 2, 8,
+	6, 9, 7, 6, 6, 8, 7, 8, 8, 7,
+	6, 9, 8, 2, 6, 7, 6,10, 8, 9,
+	7, 9, 7, 7, 8, 8, 8,12, 8, 8,
+	7, 6, 7, 6, 4, 7, 7, 7, 7, 6,
+	7, 7, 4, 7, 6, 2, 3, 6, 2,10,
+	6, 7, 7, 7, 5, 6, 4, 6, 6,10,
+	6, 6, 6, 0, 0, 0, 0, 0, 8, 6,
+	7, 7, 7, 7, 7, 6, 7, 7, 7, 4,
+	4, 3, 8, 8, 7, 0, 0, 7, 7, 7,
+	6, 6, 6, 9, 8, 0, 0, 0, 0, 0,
+	7, 3, 7, 6, 6, 8, 0, 0, 6, 0,
+	0, 0, 0, 2, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 7
+};
+
 static const byte charWidth[226] = {
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -359,14 +385,15 @@
 	0, 0, 0, 0, 0, 7
 };
 
-const char *getPixelLength(const char *string, uint16 maxWidth, uint16 &pixels) {
+const char *AGOSEngine::getPixelLength(const char *string, uint16 maxWidth, uint16 &pixels) {
 	pixels = 0;
 
 	while (*string != 0) {
 		byte chr = *string;
-		if ((pixels + charWidth[chr]) > maxWidth)
+		uint8 len = (_language == Common::PL_POL) ? polish_charWidth[chr] : charWidth[chr];
+		if ((pixels + len) > maxWidth)
 			break;
-		pixels += charWidth[chr];
+		pixels += len;
 		string++;
 	}
 
@@ -559,7 +586,7 @@
 		}
 		while (*string2 != ' ') {
 			byte chr = *string2;
-			pixels -= charWidth[chr];
+			pixels -= (_language == Common::PL_POL) ? polish_charWidth[chr] : charWidth[chr];
 			string2--;
 		}
 		spaces = (width - pixels) / 12;
@@ -609,7 +636,7 @@
 		}
 		while (*string2 != ' ') {
 			byte chr = *string2;
-			pixels -= charWidth[chr];
+			pixels -= (_language == Common::PL_POL) ? polish_charWidth[chr] : charWidth[chr];
 			string2--;
 		}
 		if (w == 0xFFFF)


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