aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/string.cpp
diff options
context:
space:
mode:
authorTravis Howell2007-03-23 23:22:18 +0000
committerTravis Howell2007-03-23 23:22:18 +0000
commit00ea91c5d628ebc56d99ad7f23f26e28f56a7955 (patch)
tree0bcb37af60a3232a923ea656a6f3d319a1621103 /engines/scumm/string.cpp
parent661944a0f9892d77c0638d44d877c785e828faa1 (diff)
downloadscummvm-rg350-00ea91c5d628ebc56d99ad7f23f26e28f56a7955.tar.gz
scummvm-rg350-00ea91c5d628ebc56d99ad7f23f26e28f56a7955.tar.bz2
scummvm-rg350-00ea91c5d628ebc56d99ad7f23f26e28f56a7955.zip
Trimming of excess spaces in drawString, only applies to SCUMM 4+ games. Cofirmed via disssembly.
svn-id: r26282
Diffstat (limited to 'engines/scumm/string.cpp')
-rw-r--r--engines/scumm/string.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index 4c0b2fcfe9..8232d622ca 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -688,25 +688,28 @@ void ScummEngine::drawString(int a, const byte *msg) {
fontHeight = _charset->getFontHeight();
- // trim from the right
- byte *tmp = buf;
- space = NULL;
- while (*tmp) {
- if (*tmp == ' ') {
- if (!space)
- space = tmp;
- } else {
- space = NULL;
+ if (_game.version >= 4) {
+ // trim from the right
+ byte *tmp = buf;
+ space = NULL;
+ while (*tmp) {
+ if (*tmp == ' ') {
+ if (!space)
+ space = tmp;
+ } else {
+ space = NULL;
+ }
+ tmp++;
}
- tmp++;
+ if (space)
+ *space = '\0';
}
- if (space)
- *space = '\0';
+
if (_charset->_center) {
_charset->_left -= _charset->getStringWidth(a, buf) / 2;
}
- if (!buf[0]) {
+ if (_game.version >= 5 && !buf[0]) {
buf[0] = ' ';
buf[1] = 0;
}
@@ -798,7 +801,7 @@ void ScummEngine::drawString(int a, const byte *msg) {
_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) {