[Scummvm-cvs-logs] SF.net SVN: scummvm:[48567] scummvm/trunk/engines/savestate.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Apr 6 11:27:27 CEST 2010


Revision: 48567
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48567&view=rev
Author:   fingolfin
Date:     2010-04-06 09:27:27 +0000 (Tue, 06 Apr 2010)

Log Message:
-----------
Switch SaveStateDescriptor::getBool to use Common::parseBool

Modified Paths:
--------------
    scummvm/trunk/engines/savestate.cpp

Modified: scummvm/trunk/engines/savestate.cpp
===================================================================
--- scummvm/trunk/engines/savestate.cpp	2010-04-06 09:27:13 UTC (rev 48566)
+++ scummvm/trunk/engines/savestate.cpp	2010-04-06 09:27:27 UTC (rev 48567)
@@ -35,15 +35,10 @@
 
 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());
 	}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list