aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-05-04 00:26:39 +0000
committerMax Horn2003-05-04 00:26:39 +0000
commit4065f23844f138f1e42c0e9fdf2349d78c54f2f2 (patch)
treecb1bd58303c05eed737ce7b0bada8224ff97fc43 /scumm
parent67b9ef7dff0a66fa4f4e6bee3292873da0282cc9 (diff)
downloadscummvm-rg350-4065f23844f138f1e42c0e9fdf2349d78c54f2f2.tar.gz
scummvm-rg350-4065f23844f138f1e42c0e9fdf2349d78c54f2f2.tar.bz2
scummvm-rg350-4065f23844f138f1e42c0e9fdf2349d78c54f2f2.zip
decode string properly in o2_printEgo
svn-id: r7296
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script_v2.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index 007b8a2bdd..278aefec82 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -836,8 +836,31 @@ void Scumm_v2::o2_printEgo() {
//_actorToPrintStrFor = (unsigned char)_vars[VAR_EGO];
//_messagePtr = _scriptPointer;
- printf("o2_printEgo(%s)\n", _scriptPointer);
- _scriptPointer += resStrLen(_scriptPointer) + 1;
+ char buffer[256]; // FIXME
+ char *ptr = buffer;
+ char c;
+ while ((c = *_scriptPointer++)) {
+ if (c & 0x80) {
+ *ptr++ = c & 0x7f;
+ *ptr++ = ' ';
+ } else 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.
+ // This might allow us to reuse the existing code.
+ *ptr++ = 0xFF;
+ *ptr++ = c;
+ if (c > 3) {
+ *ptr++ = 0;
+ *ptr++ = *_scriptPointer++;
+ }
+ } else
+ *ptr++ = c;
+ }
+ *ptr = 0;
+
+ printf("o2_printEgo(%s)\n", buffer);
+
//_messagePtr = addMessageToStack(_messagePtr);
//_scriptPointer = _messagePtr;
}