COMMON: Rename DebugManager global/member names
This commit is contained in:
parent
8e1d90f8e4
commit
fa247d13de
4 changed files with 23 additions and 23 deletions
|
@ -979,7 +979,7 @@ static void printDebugFlags(const DebugChannelDef *debugChannels) {
|
|||
/** List debug flags*/
|
||||
static void listDebugFlags(const Common::String &engineID) {
|
||||
if (engineID == "global")
|
||||
printDebugFlags(globalDebugChannels);
|
||||
printDebugFlags(gDebugChannels);
|
||||
else {
|
||||
const PluginList &plugins = EngineMan.getPlugins();
|
||||
for (PluginList::const_iterator iter = plugins.begin(); iter != plugins.end(); ++iter) {
|
||||
|
|
|
@ -160,11 +160,11 @@ public:
|
|||
private:
|
||||
typedef HashMap<String, DebugChannel, IgnoreCase_Hash, IgnoreCase_EqualTo> DebugChannelMap;
|
||||
|
||||
DebugChannelMap gDebugChannels;
|
||||
uint32 gDebugChannelsEnabled;
|
||||
DebugChannelMap _debugChannels;
|
||||
uint32 _debugChannelsEnabled;
|
||||
|
||||
friend class Singleton<SingletonBaseType>;
|
||||
DebugManager() : gDebugChannelsEnabled(0) {}
|
||||
DebugManager() : _debugChannelsEnabled(0) {}
|
||||
};
|
||||
|
||||
/** Shortcut for accessing the Debug Manager. */
|
||||
|
|
|
@ -52,28 +52,28 @@ bool DebugManager::addDebugChannel(uint32 channel, const String &name, const Str
|
|||
return false;
|
||||
}
|
||||
|
||||
if (gDebugChannels.contains(name))
|
||||
if (_debugChannels.contains(name))
|
||||
warning("Duplicate declaration of engine debug channel '%s'", name.c_str());
|
||||
|
||||
for (DebugChannelMap::iterator i = gDebugChannels.begin(); i != gDebugChannels.end(); i++)
|
||||
for (DebugChannelMap::iterator i = _debugChannels.begin(); i != _debugChannels.end(); i++)
|
||||
if (i->_value.channel == channel)
|
||||
error("Duplicate engine debug channel id '%d' for flag '%s'", channel, name.c_str());
|
||||
|
||||
gDebugChannels[name] = DebugChannel(channel, name, description);
|
||||
_debugChannels[name] = DebugChannel(channel, name, description);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void DebugManager::clearAllDebugChannels() {
|
||||
gDebugChannelsEnabled = 0;
|
||||
gDebugChannels.clear();
|
||||
_debugChannelsEnabled = 0;
|
||||
_debugChannels.clear();
|
||||
}
|
||||
|
||||
bool DebugManager::enableDebugChannel(const String &name) {
|
||||
DebugChannelMap::iterator i = gDebugChannels.find(name);
|
||||
DebugChannelMap::iterator i = _debugChannels.find(name);
|
||||
|
||||
if (i != gDebugChannels.end()) {
|
||||
gDebugChannelsEnabled |= i->_value.channel;
|
||||
if (i != _debugChannels.end()) {
|
||||
_debugChannelsEnabled |= i->_value.channel;
|
||||
i->_value.enabled = true;
|
||||
|
||||
return true;
|
||||
|
@ -83,15 +83,15 @@ bool DebugManager::enableDebugChannel(const String &name) {
|
|||
}
|
||||
|
||||
bool DebugManager::enableDebugChannel(uint32 channel) {
|
||||
gDebugChannelsEnabled |= channel;
|
||||
_debugChannelsEnabled |= channel;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DebugManager::disableDebugChannel(const String &name) {
|
||||
DebugChannelMap::iterator i = gDebugChannels.find(name);
|
||||
DebugChannelMap::iterator i = _debugChannels.find(name);
|
||||
|
||||
if (i != gDebugChannels.end()) {
|
||||
gDebugChannelsEnabled &= ~i->_value.channel;
|
||||
if (i != _debugChannels.end()) {
|
||||
_debugChannelsEnabled &= ~i->_value.channel;
|
||||
i->_value.enabled = false;
|
||||
|
||||
return true;
|
||||
|
@ -101,13 +101,13 @@ bool DebugManager::disableDebugChannel(const String &name) {
|
|||
}
|
||||
|
||||
bool DebugManager::disableDebugChannel(uint32 channel) {
|
||||
gDebugChannelsEnabled &= ~channel;
|
||||
_debugChannelsEnabled &= ~channel;
|
||||
return true;
|
||||
}
|
||||
|
||||
DebugManager::DebugChannelList DebugManager::listDebugChannels() {
|
||||
DebugChannelList tmp;
|
||||
for (DebugChannelMap::iterator i = gDebugChannels.begin(); i != gDebugChannels.end(); ++i)
|
||||
for (DebugChannelMap::iterator i = _debugChannels.begin(); i != _debugChannels.end(); ++i)
|
||||
tmp.push_back(i->_value);
|
||||
sort(tmp.begin(), tmp.end(), DebugLevelComperator());
|
||||
|
||||
|
@ -115,12 +115,12 @@ DebugManager::DebugChannelList DebugManager::listDebugChannels() {
|
|||
}
|
||||
|
||||
void DebugManager::enableAllDebugChannels() {
|
||||
for (DebugChannelMap::iterator i = gDebugChannels.begin(); i != gDebugChannels.end(); ++i)
|
||||
for (DebugChannelMap::iterator i = _debugChannels.begin(); i != _debugChannels.end(); ++i)
|
||||
enableDebugChannel(i->_value.name);
|
||||
}
|
||||
|
||||
void DebugManager::disableAllDebugChannels() {
|
||||
for (DebugChannelMap::iterator i = gDebugChannels.begin(); i != gDebugChannels.end(); ++i)
|
||||
for (DebugChannelMap::iterator i = _debugChannels.begin(); i != _debugChannels.end(); ++i)
|
||||
disableDebugChannel(i->_value.name);
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ bool DebugManager::isDebugChannelEnabled(uint32 channel, bool enforce) {
|
|||
if (gDebugLevel == 11 && enforce == false)
|
||||
return true;
|
||||
else
|
||||
return (gDebugChannelsEnabled & channel) != 0;
|
||||
return (_debugChannelsEnabled & channel) != 0;
|
||||
}
|
||||
|
||||
void DebugManager::debugFlagsRegister(const DebugChannelDef *channels) {
|
||||
|
@ -144,7 +144,7 @@ void DebugManager::debugFlagsClear() {
|
|||
// first we clear all the debug channels
|
||||
// then we add the global debug flags
|
||||
clearAllDebugChannels();
|
||||
debugFlagsRegister(globalDebugChannels);
|
||||
debugFlagsRegister(gDebugChannels);
|
||||
}
|
||||
|
||||
} // End of namespace Common
|
||||
|
|
|
@ -166,7 +166,7 @@ enum GlobalDebugLevels {
|
|||
kDebugLevelEventRec = 1 << 30
|
||||
};
|
||||
|
||||
static const DebugChannelDef globalDebugChannels[] = {
|
||||
static const DebugChannelDef gDebugChannels[] = {
|
||||
{kDebugLevelEventRec, "EventRec", "Event recorder debug level"},
|
||||
{kDebugGlobalDetection, "Detection", "debug messages for advancedDetector"},
|
||||
DEBUG_CHANNEL_END
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue