diff options
author | Travis Howell | 2005-04-06 15:01:46 +0000 |
---|---|---|
committer | Travis Howell | 2005-04-06 15:01:46 +0000 |
commit | 03be8dc46e5def303ea7e8c3c6ba6fc5abab66c4 (patch) | |
tree | ae3c94069c8b98f84f319db23a63aafb49634508 /scumm/script_v72he.cpp | |
parent | e5b37bd2a28a0dab1acfacc21bb12a075051f46e (diff) | |
download | scummvm-rg350-03be8dc46e5def303ea7e8c3c6ba6fc5abab66c4.tar.gz scummvm-rg350-03be8dc46e5def303ea7e8c3c6ba6fc5abab66c4.tar.bz2 scummvm-rg350-03be8dc46e5def303ea7e8c3c6ba6fc5abab66c4.zip |
Add missing code for decodeScriptString cases.
svn-id: r17416
Diffstat (limited to 'scumm/script_v72he.cpp')
-rw-r--r-- | scumm/script_v72he.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index cb364fe0f0..9e6f0dd6e1 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -538,6 +538,7 @@ void ScummEngine_v72he::copyScriptString(byte *dst) { } void ScummEngine_v72he::decodeScriptString(byte *dst, bool scriptString) { + const byte *src; int args[31]; int num = 0, len, val; byte chr, string[256]; @@ -561,21 +562,27 @@ void ScummEngine_v72he::decodeScriptString(byte *dst, bool scriptString) { chr = string[num++]; switch(chr) { case 'b': - // byte - error("decodeScriptString: byte unhandled"); + itoa(args[val--], (char *)dst, 2); + while (*dst != 0) + *dst++; break; case 'c': *dst++ = args[val--]; break; case 'd': - dst += snprintf((char *)dst, 10, "%d", args[val--]); + itoa(args[val--], (char *)dst, 10); + while (*dst != 0) + *dst++; break; case 's': - dst += addStringToStack(dst, 512, args[val--]); + src = getStringAddress(args[val--]); + while (*src != 0) + *dst++ = *src++; break; case 'x': - // hexadecimal - error("decodeScriptString: hexadecimal unhandled"); + itoa(args[val--], (char *)dst, 16); + while (*dst != 0) + *dst++; break; default: error("decodeScriptString: Unknown type %d", chr); |