Trimming of excess spaces in drawString, only applies to SCUMM 4+ games. Cofirmed via disssembly.

svn-id: r26282
This commit is contained in:
Travis Howell 2007-03-23 23:22:18 +00:00
parent 661944a0f9
commit 00ea91c5d6

View file

@ -688,6 +688,7 @@ void ScummEngine::drawString(int a, const byte *msg) {
fontHeight = _charset->getFontHeight(); fontHeight = _charset->getFontHeight();
if (_game.version >= 4) {
// trim from the right // trim from the right
byte *tmp = buf; byte *tmp = buf;
space = NULL; space = NULL;
@ -702,11 +703,13 @@ void ScummEngine::drawString(int a, const byte *msg) {
} }
if (space) if (space)
*space = '\0'; *space = '\0';
}
if (_charset->_center) { if (_charset->_center) {
_charset->_left -= _charset->getStringWidth(a, buf) / 2; _charset->_left -= _charset->getStringWidth(a, buf) / 2;
} }
if (!buf[0]) { if (_game.version >= 5 && !buf[0]) {
buf[0] = ' '; buf[0] = ' ';
buf[1] = 0; buf[1] = 0;
} }
@ -798,7 +801,7 @@ void ScummEngine::drawString(int a, const byte *msg) {
_nextTop = _charset->_top; _nextTop = _charset->_top;
} }
_string[a].xpos = _charset->_str.right + 8; // Indy3: Fixes Grail Diary text positioning _string[a].xpos = _charset->_str.right;
} }
int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize) { int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize) {