diff options
author | Filippos Karapetis | 2011-09-26 15:21:04 +0300 |
---|---|---|
committer | Filippos Karapetis | 2011-09-26 15:21:04 +0300 |
commit | 686a328b48482e157eac4d59057f769de228a2a9 (patch) | |
tree | 4daedf616e5722c57ab01d40857472bf1bddeb74 /engines/agi | |
parent | 397b4968d9f16c2ad146bd12cb757e1214f9b3fc (diff) | |
download | scummvm-rg350-686a328b48482e157eac4d59057f769de228a2a9.tar.gz scummvm-rg350-686a328b48482e157eac4d59057f769de228a2a9.tar.bz2 scummvm-rg350-686a328b48482e157eac4d59057f769de228a2a9.zip |
AGI: Fixed the line changing code, and added EOL checks
The extra checks make sure that there isn't an extra line added at the
end of the string. They're added as a precautionary measure
Diffstat (limited to 'engines/agi')
-rw-r--r-- | engines/agi/text.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp index 9116d5a76d..6bba90d856 100644 --- a/engines/agi/text.cpp +++ b/engines/agi/text.cpp @@ -81,14 +81,17 @@ void AgiEngine::printText2(int l, const char *msg, int foff, int xoff, int yoff, x1++; - // Change line if we've reached the end of this one - if (x1 == len && m[len - 1] != '\n') { + // Change line if we've reached the end of this one, unless the next + // character is a new line itself, or the end of the string + if (x1 == len && m[1] != '\n' && m[1] != 0) { y1++; x1 = foff = 0; } } else { - y1++; - x1 = foff = 0; + if (m[1] != 0) { + y1++; + x1 = foff = 0; + } } } } |