SCUMM: Implement correct behavior for old style text overflow

This commit is contained in:
Andrea Boscarino 2022-03-27 19:37:14 +02:00 committed by athrxx
parent d3f756eedc
commit 47270487b6
2 changed files with 32 additions and 16 deletions

View file

@ -217,18 +217,6 @@ void TextRenderer_v7::drawString(const char *str, byte *buffer, Common::Rect &cl
// with kStyleAlignLeft flag).
xpos = x - _direction * width;
if (!_newStyle) {
int amax = _screenWidth - width;
int amin = (_direction == 1) ? clipRect.left : clipRect.left + width;
// Full Throttle has several lines which can fail the amin <= amax assertion in our CLIP()
// function; this is because said lines have a width higher than _screenWidth.
// Doing this restores the correct and accurate behaviour for those lines.
if (amin > amax) {
amax = amin;
}
xpos = CLIP<int>(xpos, amin, amax);
}
drawSubstring(str + lineStart, len, buffer, clipRect, xpos, y, pitch, col, flags);
y += height;
}