aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2008-03-26 03:10:40 +0000
committerTravis Howell2008-03-26 03:10:40 +0000
commit10be4b2a6d2f9542ddae8b4e86097ff2470280de (patch)
tree87f4d56e39919936e250959bf1cd8be056ca6968 /engines
parenteeb4c75244097fcb8a1614e5073df4177488c2fd (diff)
downloadscummvm-rg350-10be4b2a6d2f9542ddae8b4e86097ff2470280de.tar.gz
scummvm-rg350-10be4b2a6d2f9542ddae8b4e86097ff2470280de.tar.bz2
scummvm-rg350-10be4b2a6d2f9542ddae8b4e86097ff2470280de.zip
Move code to ignore invalid characters.
svn-id: r31238
Diffstat (limited to 'engines')
-rw-r--r--engines/agos/charset-fontdata.cpp12
-rw-r--r--engines/agos/charset.cpp8
2 files changed, 8 insertions, 12 deletions
diff --git a/engines/agos/charset-fontdata.cpp b/engines/agos/charset-fontdata.cpp
index 71095b84fe..d9918b265d 100644
--- a/engines/agos/charset-fontdata.cpp
+++ b/engines/agos/charset-fontdata.cpp
@@ -1582,20 +1582,12 @@ void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) {
h = 13;
w = feebleFontSize[chr - 32];
- // 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 - 32) * 8;
@@ -1632,10 +1624,6 @@ void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) {
h = 8;
w = 6;
- // Ignore invalid characters
- if (chr - 32 > 98)
- return;
-
// TODO: Add font tables for German
switch (_language) {
case Common::ES_ESP:
diff --git a/engines/agos/charset.cpp b/engines/agos/charset.cpp
index 0938669bca..1f3017555c 100644
--- a/engines/agos/charset.cpp
+++ b/engines/agos/charset.cpp
@@ -527,11 +527,19 @@ void AGOSEngine::windowPutChar(WindowBlock *window, byte c, byte b) {
}
} else if (c >= 32) {
if (getGameType() == GType_FF || getGameType() == GType_PP) {
+ // Ignore invalid characters
+ if (c - 32 > 195)
+ return;
+
windowDrawChar(window, window->textColumn + window->x, window->textRow + window->y, c);
window->textColumn += getFeebleFontSize(c);
return;
}
+ // Ignore invalid characters
+ if (c - 32 > 98)
+ return;
+
if (window->textLength == window->textMaxLength) {
windowNewLine(window);
} else if (window->textRow == window->height) {