diff options
author | lukaslw | 2014-06-14 22:22:39 +0200 |
---|---|---|
committer | lukaslw | 2014-06-22 20:09:04 +0200 |
commit | 7c9d66bbe98048ebe83d7cd7a580c55d0be51f97 (patch) | |
tree | f8c3e896fecefc51455f7ca757915ef67e408a00 /engines/prince | |
parent | f1b36cffeacf9de7b17fe9673412176d44cbc468 (diff) | |
download | scummvm-rg350-7c9d66bbe98048ebe83d7cd7a580c55d0be51f97.tar.gz scummvm-rg350-7c9d66bbe98048ebe83d7cd7a580c55d0be51f97.tar.bz2 scummvm-rg350-7c9d66bbe98048ebe83d7cd7a580c55d0be51f97.zip |
PRINCE: Texts X position fix in options window and hotspot()
Diffstat (limited to 'engines/prince')
-rw-r--r-- | engines/prince/prince.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index b48a5101e6..402bce9faf 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -764,10 +764,7 @@ int PrinceEngine::hotspot(Graphics::Surface *screen, Common::Array<Mob> &mobList } } - uint16 textW = 0; - for (uint16 i = 0; i < mobName.size(); i++) { - textW += _font->getCharWidth(mobName[i]); - } + uint16 textW = getTextWidth(mobName.c_str()); uint16 x = mousepos.x - textW / 2; if (x > screen->w) { @@ -1752,8 +1749,6 @@ void PrinceEngine::checkInvOptions() { } } //NoBackgroundFlag = 1; - //int eax = _optionsX + _invOptionsWidth / 2; - //int ecx = _optionsNumber; int optionsColor; int textY = _optionsY + 16; for (int i = 0; i < _invOptionsNumber; i++) { @@ -1774,12 +1769,9 @@ void PrinceEngine::checkInvOptions() { invText = invOptionsTextEN[i]; break; }; - uint16 textW = 0; - for (uint16 i = 0; i < invText.size(); i++) { - textW += _font->getCharWidth(invText[i]); - } - uint16 textX = _optionsX + _optionsWidth / 2 - textW / 2; - _font->drawString(_graph->_screenForInventory, invText, textX, textY, _graph->_screenForInventory->w, optionsColor); + uint16 textW = getTextWidth(invText.c_str()); + uint16 textX = _optionsX + _invOptionsWidth / 2 - textW / 2; + _font->drawString(_graph->_screenForInventory, invText, textX, textY, textW, optionsColor); textY += _invOptionsStep; } //NoBackgroundFlag = 1; |