diff options
-rw-r--r-- | engines/simon/string.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/simon/string.cpp b/engines/simon/string.cpp index 7c962637d5..cffebd0c67 100644 --- a/engines/simon/string.cpp +++ b/engines/simon/string.cpp @@ -129,13 +129,17 @@ void SimonEngine::printInteractText(uint16 num, const char *string) { char *convertedString2 = convertedString; const char *string2 = string; uint16 height = 15; - uint16 w = 620; + uint16 w = 0xFFFF; uint16 b, pixels, x; + // It doesn't really matter what 'w' is to begin with, as long as it's + // something that cannot be generated by getPixelLength(). The original + // used 620, which was a potential problem. + while (1) { string2 = getPixelLength(string, 620, pixels); if (*string2 == 0x00) { - if (w == 620) + if (w == 0xFFFF) w = pixels; strcpy(convertedString2, string); break; @@ -145,7 +149,7 @@ void SimonEngine::printInteractText(uint16 num, const char *string) { pixels -= charWidth[chr]; string2--; } - if (w == 620) + if (w == 0xFFFF) w = pixels; b = string2 - string; strncpy(convertedString2, string, b); |