diff options
author | Willem Jan Palenstijn | 2013-04-18 23:55:01 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:47:44 +0200 |
commit | 102299630901d08a44ef3aec367fcbcae065b9fe (patch) | |
tree | 98db4bbe0c54176c0a43e2f5076f8b3d63b8065c /engines/sci/console.cpp | |
parent | 583f9abaf98f64895546b75573e9442ca47426e3 (diff) | |
parent | 78ba3210a57094086d44b25d5a8507c33ce9bef3 (diff) | |
download | scummvm-rg350-102299630901d08a44ef3aec367fcbcae065b9fe.tar.gz scummvm-rg350-102299630901d08a44ef3aec367fcbcae065b9fe.tar.bz2 scummvm-rg350-102299630901d08a44ef3aec367fcbcae065b9fe.zip |
Merge branch 'master'
Diffstat (limited to 'engines/sci/console.cpp')
-rw-r--r-- | engines/sci/console.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 5ae8245e5a..50fae61de0 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -284,6 +284,7 @@ void Console::postEnter() { #endif VideoState emptyState; + emptyState.reset(); emptyState.fileName = _videoFile; emptyState.flags = kDoubled; // always allow the videos to be double sized playVideo(videoDecoder, emptyState); @@ -2226,6 +2227,7 @@ bool Console::cmdIsSample(int argc, const char **argv) { DebugPrintf("Sample size: %d, sample rate: %d, channels: %d, digital channel number: %d\n", track->digitalSampleSize, track->digitalSampleRate, track->channelCount, track->digitalChannelNr); + delete soundRes; return true; } @@ -2349,8 +2351,7 @@ bool Console::cmdVMVarlist(int argc, const char **argv) { for (int i = 0; i < 4; i++) { DebugPrintf("%s vars at %04x:%04x ", varnames[i], PRINT_REG(make_reg(s->variablesSegment[i], s->variables[i] - s->variablesBase[i]))); - if (s->variablesMax) - DebugPrintf(" total %d", s->variablesMax[i]); + DebugPrintf(" total %d", s->variablesMax[i]); DebugPrintf("\n"); } @@ -2407,7 +2408,7 @@ bool Console::cmdVMVars(int argc, const char **argv) { return true; } - if ((s->variablesMax) && (s->variablesMax[varType] <= varIndex)) { + if (s->variablesMax[varType] <= varIndex) { DebugPrintf("Maximum variable number for this type is %d (0x%x)\n", s->variablesMax[varType], s->variablesMax[varType]); return true; } @@ -2507,6 +2508,7 @@ bool Console::cmdValueType(int argc, const char **argv) { break; case SIG_TYPE_INTEGER: DebugPrintf("Integer"); + break; case SIG_TYPE_INTEGER | SIG_TYPE_NULL: DebugPrintf("Null"); break; @@ -3633,6 +3635,8 @@ bool Console::cmdAddresses(int argc, const char **argv) { DebugPrintf(" - ?obj -- Looks up an object with the specified name, uses its address. This will abort if\n"); DebugPrintf(" the object name is ambiguous; in that case, a list of addresses and indices is provided.\n"); DebugPrintf(" ?obj.idx may be used to disambiguate 'obj' by the index 'idx'.\n"); + DebugPrintf(" Underscores are used as substitute characters for spaces in object names.\n"); + DebugPrintf(" For example, an object named \"Glass Jar\" can be accessed as \"Glass_Jar\".\n"); return true; } @@ -3764,6 +3768,8 @@ static int parse_reg_t(EngineState *s, const char *str, reg_t *dest, bool mayBeV charsCountObject++; if ((*strLoop >= 'I') && (*strLoop <= 'Z')) charsCountObject++; + if (*strLoop == '_') // underscores are used as substitutes for spaces in object names + charsCountObject++; } strLoop++; } @@ -3836,10 +3842,16 @@ static int parse_reg_t(EngineState *s, const char *str, reg_t *dest, bool mayBeV index = strtol(tmp + 1, &endptr, 16); if (*endptr) return -1; - // Chop of the index + // Chop off the index str_objname = Common::String(str_objname.c_str(), tmp); } + // Replace all underscores in the name with spaces + for (uint i = 0; i < str_objname.size(); i++) { + if (str_objname[i] == '_') + str_objname.setChar(' ', i); + } + // Now all values are available; iterate over all objects. *dest = s->_segMan->findObjectByName(str_objname, index); if (dest->isNull()) |