diff options
author | Filippos Karapetis | 2011-12-05 20:31:22 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-05 20:32:08 +0200 |
commit | 411892d848be30ef36a76aa55ec675fc809a5bf4 (patch) | |
tree | 420e09982cd03472b465cbb542509281c8347da1 /gui | |
parent | 585bd7b0efc7455ed8e66e802408af8956273337 (diff) | |
download | scummvm-rg350-411892d848be30ef36a76aa55ec675fc809a5bf4.tar.gz scummvm-rg350-411892d848be30ef36a76aa55ec675fc809a5bf4.tar.bz2 scummvm-rg350-411892d848be30ef36a76aa55ec675fc809a5bf4.zip |
COMMON: Handle boolean types in the debugger
Diffstat (limited to 'gui')
-rw-r--r-- | gui/debugger.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gui/debugger.cpp b/gui/debugger.cpp index 3973583d38..d5fdbd82c6 100644 --- a/gui/debugger.cpp +++ b/gui/debugger.cpp @@ -247,6 +247,18 @@ bool Debugger::parseCommand(const char *inputOrig) { *(int32 *)_dvars[i].variable = atoi(param[1]); DebugPrintf("(int)%s = %d\n", param[0], *(int32 *)_dvars[i].variable); break; + case DVAR_BOOL: + { + Common::String value = Common::String(param[1]); + if (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("false") || + value == "1" || value == "0") { + *(bool *)_dvars[i].variable = (value.equalsIgnoreCase("true") || value == "1"); + DebugPrintf("(bool)%s = %s\n", param[0], *(bool *)_dvars[i].variable ? "true" : "false"); + } else { + DebugPrintf("Invalid value for boolean variable. Valid values are \"true\", \"false\", \"1\", \"0\""); + } + } + break; // Integer Array case DVAR_INTARRAY: { const char *chr = strchr(param[0], '['); @@ -278,6 +290,9 @@ bool Debugger::parseCommand(const char *inputOrig) { case DVAR_INT: DebugPrintf("(int)%s = %d\n", param[0], *(const int32 *)_dvars[i].variable); break; + case DVAR_BOOL: + DebugPrintf("(bool)%s = %s\n", param[0], *(const bool *)_dvars[i].variable ? "true" : "false"); + break; // Integer array case DVAR_INTARRAY: { const char *chr = strchr(param[0], '['); |