[Scummvm-git-logs] scummvm master -> ce790bff1c14d9329ef60b456da25ec67dbf185e
sev-
sev at scummvm.org
Wed Jan 31 19:22:59 CET 2018
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ce790bff1c TUCKER: Fix sentence bar offsets
Commit: ce790bff1c14d9329ef60b456da25ec67dbf185e
https://github.com/scummvm/scummvm/commit/ce790bff1c14d9329ef60b456da25ec67dbf185e
Author: Adrian Frühwirth (bonki at users.noreply.github.com)
Date: 2018-01-31T19:22:56+01:00
Commit Message:
TUCKER: Fix sentence bar offsets
Fixes Trac#10413 and Trac#10414.
Changed paths:
engines/tucker/tucker.cpp
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp
index 10da526..cf28b1b 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;
}
More information about the Scummvm-git-logs
mailing list