aboutsummaryrefslogtreecommitdiff
path: root/engines/toon
diff options
context:
space:
mode:
authorsylvaintv2011-04-17 15:27:18 +0200
committersylvaintv2011-04-17 15:27:18 +0200
commitf809e94dd23f57e42b4c6e83fe39bdaccf635e85 (patch)
treefd8e5efb25f1f4e583f917949b1018e21098cca2 /engines/toon
parenta383fe452f5b62a74fc92b8734425bd8ab793402 (diff)
downloadscummvm-rg350-f809e94dd23f57e42b4c6e83fe39bdaccf635e85.tar.gz
scummvm-rg350-f809e94dd23f57e42b4c6e83fe39bdaccf635e85.tar.bz2
scummvm-rg350-f809e94dd23f57e42b4c6e83fe39bdaccf635e85.zip
TOON: Fix dirty rect issues with fonts
Diffstat (limited to 'engines/toon')
-rw-r--r--engines/toon/font.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/toon/font.cpp b/engines/toon/font.cpp
index 8192a6f6f1..0e2d58ca83 100644
--- a/engines/toon/font.cpp
+++ b/engines/toon/font.cpp
@@ -81,7 +81,7 @@ void FontRenderer::renderText(int32 x, int32 y, Common::String origText, int32 m
x -= xx / 2;
}
- _vm->addDirtyRect(x, y, x + xx, y + yy);
+ _vm->addDirtyRect(x, y, x + xx + 2, y + yy);
int32 curX = x;
int32 curY = y;
@@ -214,7 +214,7 @@ void FontRenderer::renderMultiLineText(int32 x, int32 y, Common::String origText
curChar = textToFont(curChar);
int width = _currentFont->getFrameWidth(curChar);
- curWidth += width - 2;
+ curWidth += MAX<int32>(width - 2, 0);
it++;
curLetterNr++;
}
@@ -275,12 +275,12 @@ void FontRenderer::renderMultiLineText(int32 x, int32 y, Common::String origText
for (int32 i = 0; i < numLines; i++) {
const byte *line = lines[i];
curX = x - lineSize[i] / 2;
- _vm->addDirtyRect(curX + _vm->state()->_currentScrollValue, y, curX + lineSize[i] + _vm->state()->_currentScrollValue, curY + height);
+ _vm->addDirtyRect(curX + _vm->state()->_currentScrollValue, curY, curX + lineSize[i] + _vm->state()->_currentScrollValue + 2, curY + height);
while (*line) {
byte curChar = textToFont(*line);
if (curChar != 32) _currentFont->drawFontFrame(_vm->getMainSurface(), curChar, curX + _vm->state()->_currentScrollValue, curY, _currentFontColor);
- curX = curX + _currentFont->getFrameWidth(curChar) - 2;
+ curX = curX + MAX<int32>(_currentFont->getFrameWidth(curChar) - 2, 0);
//height = MAX(height, _currentFont->getFrameHeight(curChar));
line++;
}