aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Frühwirth2018-01-24 00:59:46 +0100
committerEugene Sandulenko2018-01-31 18:05:27 +0100
commit321a563a315898dcb8f8d0d0776c7c450d6e9caa (patch)
tree08a6417ca05fde9e47c235bff296745fa60a0137
parent52ecf7f5b2a0efe30592fb529cd76bebf742cd40 (diff)
downloadscummvm-rg350-321a563a315898dcb8f8d0d0776c7c450d6e9caa.tar.gz
scummvm-rg350-321a563a315898dcb8f8d0d0776c7c450d6e9caa.tar.bz2
scummvm-rg350-321a563a315898dcb8f8d0d0776c7c450d6e9caa.zip
TUCKER: Fix font rendering bug
Fixes Trac#6370.
-rw-r--r--engines/tucker/tucker.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp
index 08ad6a05e7..cb3dd8e6f1 100644
--- a/engines/tucker/tucker.cpp
+++ b/engines/tucker/tucker.cpp
@@ -3858,7 +3858,15 @@ void TuckerEngine::drawSpeechTextLine(const uint8 *dataPtr, int pos, int count,
x += _charWidthTable[dataPtr[pos]];
++pos;
}
- addDirtyRect(xStart, y, x - xStart, Graphics::_charset._charH);
+ // At least in the English version of the game many glyphs in the character set are one pixel
+ // wider than specified in the character width table. This ensures that, when rendering text,
+ // characters are overlapping one pixel (i.e. their outlines overlap).
+ // This has the negative side effect that when a text line ends with a glyph whose specified
+ // size is narrower than its actual size, the calculated width for the dirty rect is wrong.
+ // To compensate for this we add the current character set's maximum glyph width to make sure
+ // that the dirty rect always covers the whole line.
+ // This fixes Bug #6370.
+ addDirtyRect(xStart, y, x - xStart + Graphics::_charset._charW, Graphics::_charset._charH);
}
void TuckerEngine::redrawScreen(int offset) {