[Scummvm-cvs-logs] scummvm master -> 5d90c6fb3efd4e5c6544a550ff603b96db23f331
bluegr
bluegr at gmail.com
Tue Jan 22 00:54:46 CET 2013
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
5d90c6fb3e SCI: Use underscores as substitute characters for spaces in object names
Commit: 5d90c6fb3efd4e5c6544a550ff603b96db23f331
https://github.com/scummvm/scummvm/commit/5d90c6fb3efd4e5c6544a550ff603b96db23f331
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-01-21T15:53:50-08:00
Commit Message:
SCI: Use underscores as substitute characters for spaces in object names
This helps in debugging objects with spaces in their names (e.g. the
"Glass Jar" object in Pepper - bug #3601090). Now, this object can be
examined like "vo Glass_Jar"
Changed paths:
engines/sci/console.cpp
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 5ae8245..2019415 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -3764,6 +3764,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 +3838,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 (int 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())
More information about the Scummvm-git-logs
mailing list