From 56e81ac0da70b926ecd20c674145ec67c1332509 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 6 Apr 2010 09:27:27 +0000 Subject: Switch SaveStateDescriptor::getBool to use Common::parseBool svn-id: r48567 --- engines/savestate.cpp | 13 ++++--------- 1 file 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()); } -- cgit v1.2.3