diff --git a/src/config/user_config.hpp b/src/config/user_config.hpp index 802a296c3..dbe5025d5 100644 --- a/src/config/user_config.hpp +++ b/src/config/user_config.hpp @@ -284,11 +284,6 @@ enum AnimType {ANIMS_NONE = 0, */ namespace UserConfigParams { - /** Some constants to bitmask to enable various messages to be printed. */ - enum { LOG_MEMORY = 0x0001, - LOG_GUI = 0x0002, - LOG_ADDONS = 0x0004, - LOG_MISC = 0x0008}; // ---- Audio PARAM_PREFIX GroupUserConfigParam m_audio_group @@ -497,6 +492,22 @@ namespace UserConfigParams PARAM_PREFIX PtrVector m_all_players; + /** Some constants to bitmask to enable various messages to be printed. */ + enum { LOG_MEMORY = 0x0001, + LOG_GUI = 0x0002, + LOG_ADDONS = 0x0004, + LOG_MISC = 0x0008}; + + /** Returns true if the user want additional messages for memory usage. */ + static bool logMemory() { return (m_verbosity&LOG_MEMORY) == LOG_MEMORY;} + /** Returns true if the user want additional messages related to GUI. */ + static bool logGUI () { return (m_verbosity&LOG_GUI) == LOG_GUI; } + /** Returns true if the user want additional messages related to addons. */ + static bool logAddons() { return (m_verbosity&LOG_ADDONS) == LOG_ADDONS;} + /** Returns true if the user want additional messages for general items. */ + static bool logMisc () { return (m_verbosity&LOG_MISC) == LOG_MISC; } + + } #undef PARAM_PREFIX #undef PARAM_SUFFIX diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp index 9511fbdbe..a7be11da2 100644 --- a/src/tracks/track.cpp +++ b/src/tracks/track.cpp @@ -177,7 +177,7 @@ void Track::cleanup() // remove temporary materials loaded by the material manager material_manager->popTempMaterial(); - if(UserConfigParams::m_verbosity&UserConfigParams::LOG_MEMORY) + if(UserConfigParams::logMemory()) { printf("[memory] Number of meshes in cache after cleaning up '%s': %d.\n", getIdent().c_str(), @@ -962,7 +962,7 @@ void Track::createWater(const XMLNode &node) void Track::loadTrackModel(World* parent, unsigned int mode_id) { assert(m_all_cached_meshes.size()==0); - if(UserConfigParams::m_verbosity&UserConfigParams::LOG_MEMORY) + if(UserConfigParams::logMemory()) { printf("[memory] Number of meshes in cache before loading '%s': %d.\n", getIdent().c_str(), @@ -1287,7 +1287,7 @@ void Track::loadTrackModel(World* parent, unsigned int mode_id) printf("Lap counting will not work, and start positions might be incorrect.\n"); } - if(UserConfigParams::m_verbosity&UserConfigParams::LOG_MEMORY) + if(UserConfigParams::logMemory()) printf("[memory] Number of meshes in cache after loading '%s': %d.\n", getIdent().c_str(), irr_driver->getSceneManager()->getMeshCache()->getMeshCount());