aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorJohannes Schickel2008-05-20 16:37:32 +0000
committerJohannes Schickel2008-05-20 16:37:32 +0000
commitcc08a4953d3cf1af0146b29c63f8f72803f1ca48 (patch)
tree2a499e12ff355e88c0cb5877224643199bd0ceb0 /engines/scumm
parent5204d012f6b059532f68e9c7330616989f95a380 (diff)
downloadscummvm-rg350-cc08a4953d3cf1af0146b29c63f8f72803f1ca48.tar.gz
scummvm-rg350-cc08a4953d3cf1af0146b29c63f8f72803f1ca48.tar.bz2
scummvm-rg350-cc08a4953d3cf1af0146b29c63f8f72803f1ca48.zip
Cleaned up engine debug level code.
svn-id: r32195
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/debugger.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp
index 954e400c2c..9f9115e207 100644
--- a/engines/scumm/debugger.cpp
+++ b/engines/scumm/debugger.cpp
@@ -498,25 +498,24 @@ bool ScummDebugger::Cmd_Object(int argc, const char **argv) {
}
bool ScummDebugger::Cmd_Debug(int argc, const char **argv) {
- Common::Array<Common::EngineDebugLevel> lvls = Common::listSpecialDebugLevels();
+ const Common::DebugLevelContainer &lvls = Common::listSpecialDebugLevels();
bool setFlag = false; // Remove or add debug channel?
if ((argc == 1) && (Common::getEnabledSpecialDebugLevels() == 0)) {
DebugPrintf("No debug flags are enabled\n");
DebugPrintf("Available Channels: ");
- for (uint i = 0; i < lvls.size(); i++) {
- DebugPrintf("%s, ", lvls[i].option.c_str());
+ for (Common::DebugLevelContainer::iterator i = lvls.begin(); i != lvls.end(); ++i) {
+ DebugPrintf("%s, ", i->option.c_str());
}
DebugPrintf("\n");
return true;
}
if ((argc == 1) && (Common::getEnabledSpecialDebugLevels() > 0)) {
- for (uint i = 0; i < lvls.size(); i++) {
- if (lvls[i].enabled)
- DebugPrintf("%s - %s\n", lvls[i].option.c_str(),
- lvls[i].description.c_str());
+ for (Common::DebugLevelContainer::iterator i = lvls.begin(); i != lvls.end(); ++i) {
+ if (i->enabled)
+ DebugPrintf("%s - %s\n", i->option.c_str(), i->description.c_str());
}
return true;
}
@@ -529,25 +528,24 @@ bool ScummDebugger::Cmd_Debug(int argc, const char **argv) {
} else {
DebugPrintf("Syntax: Debug +CHANNEL, or Debug -CHANNEL\n");
DebugPrintf("Available Channels: ");
- for (uint i = 0; i < lvls.size(); i++) {
- DebugPrintf("%s, ", lvls[i].option.c_str());
- DebugPrintf("\n");
+ for (Common::DebugLevelContainer::iterator i = lvls.begin(); i != lvls.end(); ++i) {
+ DebugPrintf("%s\n", i->option.c_str());
}
}
// Identify flag
const char *realFlag = argv[1] + 1;
- for (uint i = 0; i < lvls.size(); i++) {
- if ((scumm_stricmp(lvls[i].option.c_str(), realFlag)) == 0) {
+ for (Common::DebugLevelContainer::iterator i = lvls.begin(); i != lvls.end(); ++i) {
+ if (i->option.equalsIgnoreCase(realFlag)) {
if (setFlag) {
- enableSpecialDebugLevel(lvls[i].option);
+ enableSpecialDebugLevel(i->option);
DebugPrintf("Enable ");
} else {
- disableSpecialDebugLevel(lvls[i].option);
+ disableSpecialDebugLevel(i->option);
DebugPrintf("Disable ");
}
- DebugPrintf("%s\n", lvls[i].description.c_str());
+ DebugPrintf("%s\n", i->description.c_str());
return true;
}
}