[Scummvm-cvs-logs] CVS: scummvm/scumm script_v2.cpp,2.34,2.35
Max Horn
fingolfin at users.sourceforge.net
Sat May 3 17:27:18 CEST 2003
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv15689
Modified Files:
script_v2.cpp
Log Message:
decode string properly in o2_printEgo
Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.34
retrieving revision 2.35
diff -u -d -r2.34 -r2.35
--- script_v2.cpp 3 May 2003 15:08:10 -0000 2.34
+++ script_v2.cpp 4 May 2003 00:26:39 -0000 2.35
@@ -836,8 +836,31 @@
//_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;
}
More information about the Scummvm-git-logs
mailing list