aboutsummaryrefslogtreecommitdiff
path: root/scumm/script_v2.cpp
diff options
context:
space:
mode:
authorMax Horn2003-05-14 14:22:15 +0000
committerMax Horn2003-05-14 14:22:15 +0000
commitd7352e8e1933f21ee76122a2daec3c083356dc7d (patch)
treece216f18ba79e497f907ced555d192429cc1ee38 /scumm/script_v2.cpp
parent23fd68d2b67e7d49c92149f8429630e25284cc40 (diff)
downloadscummvm-rg350-d7352e8e1933f21ee76122a2daec3c083356dc7d.tar.gz
scummvm-rg350-d7352e8e1933f21ee76122a2daec3c083356dc7d.tar.bz2
scummvm-rg350-d7352e8e1933f21ee76122a2daec3c083356dc7d.zip
fixed V2 decodeParseString
svn-id: r7508
Diffstat (limited to 'scumm/script_v2.cpp')
-rw-r--r--scumm/script_v2.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index 8eed015a5d..79df54a3a4 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -374,11 +374,14 @@ void Scumm_v2::decodeParseString() {
byte buffer[256]; // FIXME
byte *ptr = buffer;
byte c;
+ bool insertSpace = false;
+
while ((c = fetchScriptByte())) {
- if (c & 0x80) {
- *ptr++ = c & 0x7f;
- *ptr++ = ' ';
- } else if (c < 8) {
+
+ insertSpace = (c & 0x80) != 0;
+ c &= 0x7f;
+
+ if (c < 8) {
// Special codes as seen in CHARSET_1 etc. My guess is that they
// have a similar function as the corresponding embedded stuff in modern
// games. Hence for now we convert them to the modern format.
@@ -391,6 +394,10 @@ void Scumm_v2::decodeParseString() {
}
} else
*ptr++ = c;
+
+ if (insertSpace)
+ *ptr++ = ' ';
+
}
*ptr = 0;