aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2010-04-06 09:27:27 +0000
committerMax Horn2010-04-06 09:27:27 +0000
commit56e81ac0da70b926ecd20c674145ec67c1332509 (patch)
treee951eab7cc645f6e8344efc44d0cb86e0331ed33
parent7c510f2dfa1191ea76633e667ef302a6b6ed949b (diff)
downloadscummvm-rg350-56e81ac0da70b926ecd20c674145ec67c1332509.tar.gz
scummvm-rg350-56e81ac0da70b926ecd20c674145ec67c1332509.tar.bz2
scummvm-rg350-56e81ac0da70b926ecd20c674145ec67c1332509.zip
Switch SaveStateDescriptor::getBool to use Common::parseBool
svn-id: r48567
-rw-r--r--engines/savestate.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/engines/savestate.cpp b/engines/savestate.cpp
index 32aa39c118..3cd81a2ff6 100644
--- a/engines/savestate.cpp
+++ b/engines/savestate.cpp
@@ -35,15 +35,10 @@ void SaveStateDescriptor::setThumbnail(Graphics::Surface *t) {
bool SaveStateDescriptor::getBool(const Common::String &key) const {
if (contains(key)) {
- Common::String value = getVal(key);
- if (value.equalsIgnoreCase("true") ||
- value.equalsIgnoreCase("yes") ||
- value.equals("1"))
- return true;
- if (value.equalsIgnoreCase("false") ||
- value.equalsIgnoreCase("no") ||
- value.equals("0"))
- return false;
+ const Common::String value = getVal(key);
+ bool valueAsBool;
+ if (Common::parseBool(value, valueAsBool))
+ return valueAsBool;
error("SaveStateDescriptor: %s '%s' has unknown value '%s' for boolean '%s'",
save_slot().c_str(), description().c_str(), value.c_str(), key.c_str());
}