diff options
author | Yehonal <yehonal.azeroth@gmail.com> | 2017-08-19 19:42:48 +0200 |
---|---|---|
committer | Yehonal <yehonal.azeroth@gmail.com> | 2017-08-19 19:42:48 +0200 |
commit | c1586e0d995de5dd278b0acfe410acf66f6c2c6d (patch) | |
tree | 5c66718c37379eda84669c1990c8d2f8fc0835d3 /modules | |
parent | f888e8c86b09d55587294921fbfeb58afb3d2282 (diff) |
changed DISABLED_ cmake variable to ENABLED_ and implemented for all disabled logs
Diffstat (limited to 'modules')
4 files changed, 63 insertions, 31 deletions
diff --git a/modules/worldengine/lib-collision/src/Management/MMapManager.cpp b/modules/worldengine/lib-collision/src/Management/MMapManager.cpp index a4a50ce3e0..f18604f775 100644 --- a/modules/worldengine/lib-collision/src/Management/MMapManager.cpp +++ b/modules/worldengine/lib-collision/src/Management/MMapManager.cpp @@ -34,7 +34,7 @@ namespace MMAP FILE* file = fopen(fileName, "rb"); if (!file) { -#if defined(DISABLE_EXTRAS) || defined(DISABLE_EXTRA_LOGS) +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_MAPS, "MMAP:loadMapData: Error: Could not open mmap file '%s'", fileName); #endif delete [] fileName; @@ -63,7 +63,9 @@ namespace MMAP delete [] fileName; - ;//sLog->outDetail("MMAP:loadMapData: Loaded %03i.mmap", mapId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MMAP:loadMapData: Loaded %03i.mmap", mapId); +#endif // store inside our map list MMapData* mmap_data = new MMapData(mesh); @@ -117,7 +119,9 @@ namespace MMAP FILE *file = fopen(fileName, "rb"); if (!file) { - ;//sLog->outDebug(LOG_FILTER_MAPS, "MMAP:loadMap: Could not open mmtile file '%s'", fileName); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MMAP:loadMap: Could not open mmtile file '%s'", fileName); +#endif delete [] fileName; return false; } @@ -167,7 +171,9 @@ namespace MMAP { mmap->mmapLoadedTiles.insert(std::pair<uint32, dtTileRef>(packedGridPos, tileRef)); ++loadedTiles; - ;//sLog->outDetail("MMAP:loadMap: Loaded mmtile %03i[%02i,%02i] into %03i[%02i,%02i]", mapId, x, y, mapId, header->x, header->y); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MMAP:loadMap: Loaded mmtile %03i[%02i,%02i] into %03i[%02i,%02i]", mapId, x, y, mapId, header->x, header->y); +#endif return true; } else @@ -188,7 +194,9 @@ namespace MMAP if (loadedMMaps.find(mapId) == loadedMMaps.end()) { // file may not exist, therefore not loaded - ;//sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMap: Asked to unload not loaded navmesh map. %03u%02i%02i.mmtile", mapId, x, y); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMap: Asked to unload not loaded navmesh map. %03u%02i%02i.mmtile", mapId, x, y); +#endif return false; } @@ -199,7 +207,9 @@ namespace MMAP if (mmap->mmapLoadedTiles.find(packedGridPos) == mmap->mmapLoadedTiles.end()) { // file may not exist, therefore not loaded - ;//sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMap: Asked to unload not loaded navmesh tile. %03u%02i%02i.mmtile", mapId, x, y); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMap: Asked to unload not loaded navmesh tile. %03u%02i%02i.mmtile", mapId, x, y); +#endif return false; } @@ -224,7 +234,9 @@ namespace MMAP { mmap->mmapLoadedTiles.erase(packedGridPos); --loadedTiles; - ;//sLog->outDetail("MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId); +#endif return true; } @@ -238,7 +250,9 @@ namespace MMAP if (loadedMMaps.find(mapId) == loadedMMaps.end()) { // file may not exist, therefore not loaded - ;//sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMap: Asked to unload not loaded navmesh map %03u", mapId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMap: Asked to unload not loaded navmesh map %03u", mapId); +#endif return false; } @@ -260,13 +274,17 @@ namespace MMAP else { --loadedTiles; - ;//sLog->outDetail("MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId); +#endif } } delete mmap; loadedMMaps.erase(mapId); - ;//sLog->outDetail("MMAP:unloadMap: Unloaded %03i.mmap", mapId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MMAP:unloadMap: Unloaded %03i.mmap", mapId); +#endif return true; } @@ -279,14 +297,18 @@ namespace MMAP if (loadedMMaps.find(mapId) == loadedMMaps.end()) { // file may not exist, therefore not loaded - ;//sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMapInstance: Asked to unload not loaded navmesh map %03u", mapId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMapInstance: Asked to unload not loaded navmesh map %03u", mapId); +#endif return false; } MMapData* mmap = loadedMMaps[mapId]; if (mmap->navMeshQueries.find(instanceId) == mmap->navMeshQueries.end()) { - ;//sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMapInstance: Asked to unload not loaded dtNavMeshQuery mapId %03u instanceId %u", mapId, instanceId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMapInstance: Asked to unload not loaded dtNavMeshQuery mapId %03u instanceId %u", mapId, instanceId); +#endif return false; } @@ -294,7 +316,9 @@ namespace MMAP dtFreeNavMeshQuery(query); mmap->navMeshQueries.erase(instanceId); - ;//sLog->outDetail("MMAP:unloadMapInstance: Unloaded mapId %03u instanceId %u", mapId, instanceId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MMAP:unloadMapInstance: Unloaded mapId %03u instanceId %u", mapId, instanceId); +#endif return true; } @@ -336,7 +360,9 @@ namespace MMAP return NULL; } - ;//sLog->outDetail("MMAP:GetNavMeshQuery: created dtNavMeshQuery for mapId %03u instanceId %u", mapId, instanceId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MMAP:GetNavMeshQuery: created dtNavMeshQuery for mapId %03u instanceId %u", mapId, instanceId); +#endif mmap->navMeshQueries.insert(std::pair<uint32, dtNavMeshQuery*>(instanceId, query)); } } diff --git a/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp b/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp index d67b465ae9..e466929a07 100644 --- a/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp +++ b/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp @@ -124,7 +124,7 @@ namespace VMAP bool VMapManager2::isInLineOfSight(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2) { -#if defined(DISABLE_EXTRAS) || defined(DISABLE_VMAP_CHECKS) +#if ENABLE_EXTRAS && ENABLE_VMAP_CHECKS if (!isLineOfSightCalcEnabled() || DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LOS)) return true; #endif @@ -149,7 +149,7 @@ namespace VMAP */ bool VMapManager2::getObjectHitPos(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float &ry, float& rz, float modifyDist) { -#if defined(DISABLE_EXTRAS) || defined(DISABLE_VMAP_CHECKS) +#if ENABLE_EXTRAS && ENABLE_VMAP_CHECKS if (isLineOfSightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LOS)) #endif { @@ -181,7 +181,7 @@ namespace VMAP float VMapManager2::getHeight(unsigned int mapId, float x, float y, float z, float maxSearchDist) { -#if defined(DISABLE_EXTRAS) || defined(DISABLE_VMAP_CHECKS) +#if ENABLE_EXTRAS && ENABLE_VMAP_CHECKS if (isHeightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_HEIGHT)) #endif { @@ -202,7 +202,7 @@ namespace VMAP bool VMapManager2::getAreaInfo(unsigned int mapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const { -#if defined(DISABLE_EXTRAS) || defined(DISABLE_VMAP_CHECKS) +#if ENABLE_EXTRAS && ENABLE_VMAP_CHECKS if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_AREAFLAG)) #endif { @@ -222,7 +222,7 @@ namespace VMAP bool VMapManager2::GetLiquidLevel(uint32 mapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type) const { -#if defined(DISABLE_EXTRAS) || defined(DISABLE_VMAP_CHECKS) +#if ENABLE_EXTRAS && ENABLE_VMAP_CHECKS if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LIQUIDSTATUS)) #endif { @@ -262,7 +262,9 @@ namespace VMAP delete worldmodel; return NULL; } - ;//sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); +#endif model = iLoadedModelFiles.insert(std::pair<std::string, ManagedModel>(filename, ManagedModel())).first; model->second.setModel(worldmodel); } @@ -283,7 +285,9 @@ namespace VMAP } if (model->second.decRefCount() == 0) { - ;//sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: unloading file '%s'", filename.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: unloading file '%s'", filename.c_str()); +#endif delete model->second.getModel(); iLoadedModelFiles.erase(model); }*/ diff --git a/modules/worldengine/lib-collision/src/Maps/MapTree.cpp b/modules/worldengine/lib-collision/src/Maps/MapTree.cpp index ebd8656f4e..092625dd9c 100644 --- a/modules/worldengine/lib-collision/src/Maps/MapTree.cpp +++ b/modules/worldengine/lib-collision/src/Maps/MapTree.cpp @@ -44,8 +44,8 @@ namespace VMAP AreaInfoCallback(ModelInstance* val): prims(val) {} void operator()(const Vector3& point, uint32 entry) { -#ifdef VMAP_DEBUG - ;//sLog->outDebug(LOG_FILTER_MAPS, "AreaInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS && VMAP_DEBUG + sLog->outDebug(LOG_FILTER_MAPS, "AreaInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); #endif prims[entry].intersectPoint(point, aInfo); } @@ -60,8 +60,8 @@ namespace VMAP LocationInfoCallback(ModelInstance* val, LocationInfo &info): prims(val), locInfo(info), result(false) {} void operator()(const Vector3& point, uint32 entry) { -#ifdef VMAP_DEBUG - ;//sLog->outDebug(LOG_FILTER_MAPS, "LocationInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS && VMAP_DEBUG + sLog->outDebug(LOG_FILTER_MAPS, "LocationInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); #endif if (prims[entry].GetLocationInfo(point, locInfo)) result = true; @@ -373,10 +373,10 @@ namespace VMAP { if (!iLoadedSpawns.count(referencedVal)) { -#ifdef VMAP_DEBUG +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS && VMAP_DEBUG if (referencedVal > iNTreeValues) { - ;//sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : invalid tree element (%u/%u)", referencedVal, iNTreeValues); + sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : invalid tree element (%u/%u)", referencedVal, iNTreeValues); continue; } #endif @@ -386,11 +386,11 @@ namespace VMAP else { ++iLoadedSpawns[referencedVal]; -#ifdef VMAP_DEBUG +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS && VMAP_DEBUG if (iTreeValues[referencedVal].ID != spawn.ID) - ;//sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : trying to load wrong spawn in node"); + sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : trying to load wrong spawn in node"); else if (iTreeValues[referencedVal].name != spawn.name) - ;//sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : name collision on GUID=%u", spawn.ID); + sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : name collision on GUID=%u", spawn.ID); #endif } } diff --git a/modules/worldengine/nucleus/src/Database/MySQLConnection.cpp b/modules/worldengine/nucleus/src/Database/MySQLConnection.cpp index b11f161be8..2735d4940b 100644 --- a/modules/worldengine/nucleus/src/Database/MySQLConnection.cpp +++ b/modules/worldengine/nucleus/src/Database/MySQLConnection.cpp @@ -121,7 +121,9 @@ bool MySQLConnection::Open() // sLog->outInfo(LOG_FILTER_SQL, "[WARNING] MySQL client/server version mismatch; may conflict with behaviour of prepared statements."); } - ;//sLog->outDetail("Connected to MySQL database at %s", m_connectionInfo.host.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Connected to MySQL database at %s", m_connectionInfo.host.c_str()); +#endif mysql_autocommit(m_Mysql, 1); // set connection properties to UTF8 to properly handle locales for different |