diff options
author | Adrian Frühwirth | 2018-01-20 04:05:50 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2018-01-31 19:22:56 +0100 |
commit | ce790bff1c14d9329ef60b456da25ec67dbf185e (patch) | |
tree | bac38ff35877d8547575dd82bd7a7483ce2e8adb | |
parent | 1133b34954b31e141bc8d920d67e579ceabd1dcb (diff) | |
download | scummvm-rg350-ce790bff1c14d9329ef60b456da25ec67dbf185e.tar.gz scummvm-rg350-ce790bff1c14d9329ef60b456da25ec67dbf185e.tar.bz2 scummvm-rg350-ce790bff1c14d9329ef60b456da25ec67dbf185e.zip |
TUCKER: Fix sentence bar offsets
Fixes Trac#10413 and Trac#10414.
-rw-r--r-- | engines/tucker/tucker.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index 10da52603f..cf28b1b656 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -1968,9 +1968,9 @@ void TuckerEngine::clearItemsGfx() { } void TuckerEngine::drawPausedInfoBar() { - int len = getStringWidth(36, _infoBarBuf); - int x = 159 - len / 2; - drawItemString(326 + x, 36, _infoBarBuf); + const int len = getStringWidth(36, _infoBarBuf); + const int x = (kScreenWidth / 2) - 1 - (len / 2); + drawItemString(x, 36, _infoBarBuf); } const uint8 *TuckerEngine::getStringBuf(int type) const { @@ -2020,7 +2020,7 @@ void TuckerEngine::drawInfoString() { infoStringWidth += getStringWidth(_actionObj2Num + 1, obj2StrBuf); } } - const int xPos = 159 - infoStringWidth / 2; + const int xPos = (kScreenWidth / 2) - 1 - (infoStringWidth / 2); if (_gameLang == Common::EN_ANY || (_actionObj2Num == 0 && _actionObj2Type == 0) || verbPreposition == 0) { drawItemString(xPos, _actionVerb + 1, infoStrBuf); if (_actionObj1Num > 0 || _actionObj1Type > 0) { @@ -2037,8 +2037,8 @@ void TuckerEngine::drawInfoString() { void TuckerEngine::drawGameHintString() { const int len = getStringWidth(_gameHintsStringNum + 29, _infoBarBuf); - const int x = 159 - len / 2; - drawItemString(326 + x, _gameHintsStringNum + 29, _infoBarBuf); + const int x = (kScreenWidth / 2) - 1 - (len / 2); + drawItemString(x, _gameHintsStringNum + 29, _infoBarBuf); } void TuckerEngine::updateCharacterAnimation() { @@ -2900,7 +2900,11 @@ void TuckerEngine::drawItemString(int x, int num, const uint8 *str) { int pos = getPositionForLine(num, str); while (str[pos] != '\n') { const uint8 chr = str[pos]; - Graphics::drawStringChar(_itemsGfxBuf, x, 0, 320, chr, 1, _charsetGfxBuf); + // Different versions of the game use different character set dimensions (charset.pcx). + // The default (English) set uses a height of 8 pixels whereas others use 10 pixels. + // This needs to be taken into consideration when drawing the language bar so text + // gets vertically centered in all languages. + Graphics::drawStringChar(_itemsGfxBuf, x, (10 - (Graphics::_charset._charH)) / 2, 320, chr, 1, _charsetGfxBuf); x += _charWidthTable[chr]; ++pos; } |