mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-22 18:02:05 +00:00
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
This commit is contained in:
parent
397b4968d9
commit
686a328b48
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user