diff options
author | Dreammaster | 2013-02-15 08:25:09 -0500 |
---|---|---|
committer | Dreammaster | 2013-02-15 08:25:09 -0500 |
commit | bb3285d933419b6bdefadc55a6e320855ff0dd27 (patch) | |
tree | 2df613c52f854c33cff660ed1b064e2996ed80bb /engines/dreamweb/print.cpp | |
parent | d1a19a1d4c3e20b57250e73141d81e8d9b44a2a1 (diff) | |
parent | adc338cd719179a94ff470b28e9584262d7b47e8 (diff) | |
download | scummvm-rg350-bb3285d933419b6bdefadc55a6e320855ff0dd27.tar.gz scummvm-rg350-bb3285d933419b6bdefadc55a6e320855ff0dd27.tar.bz2 scummvm-rg350-bb3285d933419b6bdefadc55a6e320855ff0dd27.zip |
Merge branch 'master' into hopkins
Diffstat (limited to 'engines/dreamweb/print.cpp')
-rw-r--r-- | engines/dreamweb/print.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp index 64b9849980..bc75b97e71 100644 --- a/engines/dreamweb/print.cpp +++ b/engines/dreamweb/print.cpp @@ -49,7 +49,9 @@ uint8 DreamWebEngine::getNextWord(const GraphicsFile &charSet, const uint8 *stri return 0; } firstChar = modifyChar(firstChar); - if (firstChar != 255) { + // WORKAROUND: Also filter out invalid characters here (refer to the + // workaround in printChar() below for more info). + if (firstChar >= 32 && firstChar != 255) { uint8 secondChar = *string; uint8 width = charSet._frames[firstChar - 32 + _charShift].width; width = kernChars(firstChar, secondChar, width); @@ -59,9 +61,13 @@ uint8 DreamWebEngine::getNextWord(const GraphicsFile &charSet, const uint8 *stri } void DreamWebEngine::printChar(const GraphicsFile &charSet, uint16* x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height) { - if (c == 255) + // WORKAROUND: Some texts contain leftover tab characters, which will cause + // OOB memory access when showing a character, as all the printable ones are + // from 32 onwards. We compensate for that here by ignoring all the invalid + // characters (0 - 31). + if (c < 32 || c == 255) return; - + uint8 dummyWidth, dummyHeight; if (width == NULL) width = &dummyWidth; @@ -315,7 +321,7 @@ void DreamWebEngine::rollEndCreditsGameLost() { waitForVSync(); multiDump(25, 20, 160, 160); - if (_lastHardKey == 1) + if (_lastHardKey == Common::KEYCODE_ESCAPE) return; } @@ -325,7 +331,7 @@ void DreamWebEngine::rollEndCreditsGameLost() { c = *string++; } while (c != ':' && c != 0); - if (_lastHardKey == 1) + if (_lastHardKey == Common::KEYCODE_ESCAPE) return; } |