aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/console.cpp
diff options
context:
space:
mode:
authorDreammaster2013-02-15 08:25:09 -0500
committerDreammaster2013-02-15 08:25:09 -0500
commitbb3285d933419b6bdefadc55a6e320855ff0dd27 (patch)
tree2df613c52f854c33cff660ed1b064e2996ed80bb /engines/sci/console.cpp
parentd1a19a1d4c3e20b57250e73141d81e8d9b44a2a1 (diff)
parentadc338cd719179a94ff470b28e9584262d7b47e8 (diff)
downloadscummvm-rg350-bb3285d933419b6bdefadc55a6e320855ff0dd27.tar.gz
scummvm-rg350-bb3285d933419b6bdefadc55a6e320855ff0dd27.tar.bz2
scummvm-rg350-bb3285d933419b6bdefadc55a6e320855ff0dd27.zip
Merge branch 'master' into hopkins
Diffstat (limited to 'engines/sci/console.cpp')
-rw-r--r--engines/sci/console.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 5ae8245e5a..1bf3323a7b 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -3633,6 +3633,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 +3766,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 +3840,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())