Move code to ignore invalid characters.

svn-id: r31238
This commit is contained in:
Travis Howell 2008-03-26 03:10:40 +00:00
parent eeb4c75244
commit 10be4b2a6d
2 changed files with 8 additions and 12 deletions

View File

@ -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:

View File

@ -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) {