mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-21 01:05:59 +00:00
COMMON: Persist global debug channels between engine runs
This commit is contained in:
parent
fef26b3c59
commit
83fc4f7338
@ -157,6 +157,7 @@ private:
|
||||
|
||||
DebugChannelMap _debugChannels;
|
||||
uint32 _debugChannelsEnabled;
|
||||
uint32 _globalChannelsMask;
|
||||
|
||||
friend class Singleton<SingletonBaseType>;
|
||||
|
||||
|
@ -54,6 +54,12 @@ struct DebugLevelComperator {
|
||||
DebugManager::DebugManager() :
|
||||
_debugChannelsEnabled(0) {
|
||||
addDebugChannels(gDebugChannels);
|
||||
|
||||
// Create global debug channels mask
|
||||
_globalChannelsMask = 0;
|
||||
for (uint i = 0; gDebugChannels[i].channel != 0; ++i) {
|
||||
_globalChannelsMask |= gDebugChannels[i].channel;
|
||||
}
|
||||
}
|
||||
|
||||
bool DebugManager::addDebugChannel(uint32 channel, const String &name, const String &description) {
|
||||
@ -83,9 +89,12 @@ void DebugManager::addAllDebugChannels(const DebugChannelDef *channels) {
|
||||
}
|
||||
|
||||
void DebugManager::removeAllDebugChannels() {
|
||||
uint32 globalChannels = _debugChannelsEnabled & _globalChannelsMask;
|
||||
_debugChannelsEnabled = 0;
|
||||
_debugChannels.clear();
|
||||
addDebugChannels(gDebugChannels);
|
||||
|
||||
_debugChannelsEnabled |= globalChannels;
|
||||
}
|
||||
|
||||
bool DebugManager::enableDebugChannel(const String &name) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user