[Scummvm-cvs-logs] SF.net SVN: scummvm: [31236] scummvm/trunk/engines/agos/charset-fontdata. cpp

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Wed Mar 26 02:57:27 CET 2008


Revision: 31236
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31236&view=rev
Author:   Kirben
Date:     2008-03-25 18:57:26 -0700 (Tue, 25 Mar 2008)

Log Message:
-----------
Always ignore invalid characters, when using charset data.

Modified Paths:
--------------
    scummvm/trunk/engines/agos/charset-fontdata.cpp

Modified: scummvm/trunk/engines/agos/charset-fontdata.cpp
===================================================================
--- scummvm/trunk/engines/agos/charset-fontdata.cpp	2008-03-26 01:50:59 UTC (rev 31235)
+++ scummvm/trunk/engines/agos/charset-fontdata.cpp	2008-03-26 01:57:26 UTC (rev 31236)
@@ -1580,41 +1580,49 @@
 	if (getGameType() == GType_FF || getGameType() == GType_PP) {
 		dst = getBackGround() + y * _dxSurfacePitch + x + window->textColumnOffset;
 		h = 13;
-		w =  feebleFontSize[chr - 0x20];
+		w =  feebleFontSize[chr - 32];
 
-		src = feeble_windowFont + (chr - 0x20) * 13;
+		// Ignore invalid characters
+		if (chr - 32 > 195)
+			return;
+
+		src = feeble_windowFont + (chr - 32) * 13;
 	} else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
 		dst = (byte *)screen->pixels + y * _dxSurfacePitch + x + window->textColumnOffset;
 		h = 8;
 		w = 6;
 
+		// Ignore invalid characters
+		if (chr - 32 > 98)
+			return;
+
 		switch (_language) {
 		case Common::CZ_CZE:
-			src = czech_simonFont + (chr - 0x20) * 8;
+			src = czech_simonFont + (chr - 32) * 8;
 			break;
 		case Common::RU_RUS:
-			src = russian_simonFont + (chr - 0x20) * 8;
+			src = russian_simonFont + (chr - 32) * 8;
 			break;
 		case Common::PL_POL:
-			src = polish_simonFont + (chr - 0x20) * 8;
+			src = polish_simonFont + (chr - 32) * 8;
 			break;
 		case Common::HB_ISR:
-			src = hebrew_simonFont + (chr - 0x20) * 8;
+			src = hebrew_simonFont + (chr - 32) * 8;
 			break;
 		case Common::ES_ESP:
-			src = spanish_simonFont + (chr - 0x20) * 8;
+			src = spanish_simonFont + (chr - 32) * 8;
 			break;
 		case Common::IT_ITA:
-			src = italian_simonFont + (chr - 0x20) * 8;
+			src = italian_simonFont + (chr - 32) * 8;
 			break;
 		case Common::FR_FRA:
-			src = french_simonFont + (chr - 0x20) * 8;
+			src = french_simonFont + (chr - 32) * 8;
 			break;
 		case Common::DE_DEU:
-			src = german_simonFont + (chr - 0x20) * 8;
+			src = german_simonFont + (chr - 32) * 8;
 			break;
 		case Common::EN_ANY:
-			src = english_simonFont + (chr - 0x20) * 8;
+			src = english_simonFont + (chr - 32) * 8;
 			break;
 		default:
 			error("windowDrawChar: Unknown language %d\n", _language);
@@ -1624,22 +1632,26 @@
 		h = 8;
 		w = 6;
 
+		// Ignore invalid characters
+		if (chr - 32 > 98)
+			return;
+
 		// TODO: Add font tables for German
 		switch (_language) {
 		case Common::ES_ESP:
-			src = spanish_commonFont + (chr - 0x20) * 8;
+			src = spanish_commonFont + (chr - 32) * 8;
 			break;
 		case Common::IT_ITA:
-			src = italian_commonFont + (chr - 0x20) * 8;
+			src = italian_commonFont + (chr - 32) * 8;
 			break;
 		case Common::FR_FRA:
-			src = french_commonFont + (chr - 0x20) * 8;
+			src = french_commonFont + (chr - 32) * 8;
 			break;
 		case Common::DE_DEU:
-			src = english_commonFont + (chr - 0x20) * 8;
+			src = english_commonFont + (chr - 32) * 8;
 			break;
 		case Common::EN_ANY:
-			src = english_commonFont + (chr - 0x20) * 8;
+			src = english_commonFont + (chr - 32) * 8;
 			break;
 		default:
 			error("windowDrawChar: Unknown language %d\n", _language);


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