[Scummvm-cvs-logs] SF.net SVN: scummvm: [26282] scummvm/trunk/engines/scumm/string.cpp
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Sat Mar 24 00:22:19 CET 2007
Revision: 26282
http://scummvm.svn.sourceforge.net/scummvm/?rev=26282&view=rev
Author: kirben
Date: 2007-03-23 16:22:18 -0700 (Fri, 23 Mar 2007)
Log Message:
-----------
Trimming of excess spaces in drawString, only applies to SCUMM 4+ games. Cofirmed via disssembly.
Modified Paths:
--------------
scummvm/trunk/engines/scumm/string.cpp
Modified: scummvm/trunk/engines/scumm/string.cpp
===================================================================
--- scummvm/trunk/engines/scumm/string.cpp 2007-03-23 16:24:28 UTC (rev 26281)
+++ scummvm/trunk/engines/scumm/string.cpp 2007-03-23 23:22:18 UTC (rev 26282)
@@ -688,25 +688,28 @@
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 @@
_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) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list