diff --git a/conf/config.cmake.dist b/conf/config.cmake.dist index a2d5db1ca..d76098095 100644 --- a/conf/config.cmake.dist +++ b/conf/config.cmake.dist @@ -1,10 +1,12 @@ -option(SERVERS "Build worldserver and authserver" 1) -option(SCRIPTS "Build core with scripts included" 1) -option(TOOLS "Build map/vmap/mmap extraction/assembler tools" 0) -option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts" 1) -option(USE_COREPCH "Use precompiled headers when compiling servers" 1) -option(WITH_WARNINGS "Show all warnings during compile" 0) -option(WITH_COREDEBUG "Include additional debug-code in core" 0) -option(WITH_PERFTOOLS "Enable compilation with gperftools libraries included" 0) -option(WITH_MESHEXTRACTOR "Build meshextractor (alpha)" 0) -option(WITHOUT_GIT "Disable the GIT testing routines" 0) +option(SERVERS "Build worldserver and authserver" 1) +option(SCRIPTS "Build core with scripts included" 1) +option(TOOLS "Build map/vmap/mmap extraction/assembler tools" 0) +option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts" 1) +option(USE_COREPCH "Use precompiled headers when compiling servers" 1) +option(WITH_WARNINGS "Show all warnings during compile" 0) +option(WITH_COREDEBUG "Include additional debug-code in core" 0) +option(WITH_PERFTOOLS "Enable compilation with gperftools libraries included" 0) +option(WITH_MESHEXTRACTOR "Build meshextractor (alpha)" 0) +option(WITHOUT_GIT "Disable the GIT testing routines" 0) +option(DISABLE_EXTRAS "Set to 1 to disable extra features optimizing performances" 0) +option(DISABLE_VMAP_CHECKS "Remove DisableMgr Checks on vmap" 0) diff --git a/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp b/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp index f310f2026..d67b465ae 100644 --- a/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp +++ b/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp @@ -124,8 +124,10 @@ namespace VMAP bool VMapManager2::isInLineOfSight(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2) { - //if (!isLineOfSightCalcEnabled() || DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LOS)) // pussywizard: optimization - // return true; +#if defined(DISABLE_EXTRAS) || defined(DISABLE_VMAP_CHECKS) + if (!isLineOfSightCalcEnabled() || DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LOS)) + return true; +#endif InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(mapId); if (instanceTree != iInstanceMapTrees.end()) @@ -147,7 +149,9 @@ 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 (isLineOfSightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LOS)) // pussywizard: optimization +#if defined(DISABLE_EXTRAS) || defined(DISABLE_VMAP_CHECKS) + if (isLineOfSightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LOS)) +#endif { InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(mapId); if (instanceTree != iInstanceMapTrees.end()) @@ -177,7 +181,9 @@ namespace VMAP float VMapManager2::getHeight(unsigned int mapId, float x, float y, float z, float maxSearchDist) { - //if (isHeightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_HEIGHT)) // pussywizard: optimization +#if defined(DISABLE_EXTRAS) || defined(DISABLE_VMAP_CHECKS) + if (isHeightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_HEIGHT)) +#endif { InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(mapId); if (instanceTree != iInstanceMapTrees.end()) @@ -196,7 +202,9 @@ namespace VMAP bool VMapManager2::getAreaInfo(unsigned int mapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const { - //if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_AREAFLAG)) // pussywizard: optimization +#if defined(DISABLE_EXTRAS) || defined(DISABLE_VMAP_CHECKS) + if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_AREAFLAG)) +#endif { InstanceTreeMap::const_iterator instanceTree = iInstanceMapTrees.find(mapId); if (instanceTree != iInstanceMapTrees.end()) @@ -214,7 +222,9 @@ namespace VMAP bool VMapManager2::GetLiquidLevel(uint32 mapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type) const { - //if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LIQUIDSTATUS)) // pussywizard: optimization +#if defined(DISABLE_EXTRAS) || defined(DISABLE_VMAP_CHECKS) + if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LIQUIDSTATUS)) +#endif { InstanceTreeMap::const_iterator instanceTree = iInstanceMapTrees.find(mapId); if (instanceTree != iInstanceMapTrees.end()) diff --git a/src/cmake/showoptions.cmake b/src/cmake/showoptions.cmake index 28b70b457..5199d7b14 100644 --- a/src/cmake/showoptions.cmake +++ b/src/cmake/showoptions.cmake @@ -105,5 +105,21 @@ if ( NOJEM ) message(" *** DO NOT DISABLE IT UNLESS YOU KNOW WHAT YOU'RE DOING!") endif() +# Performance optimization options: + +if( DISABLE_EXTRAS ) + message("* Disable extra features : Yes") + add_definitions(-DDISABLE_EXTRAS) +else() + message("* Disable extra features : No (default)") +endif() + +if( DISABLE_VMAP_CHECKS ) + message("* Disable vmap DisableMgr checks : Yes") + add_definitions(-DDISABLE_VMAP_CHECKS) +else() + message("* Disable vmap DisableMgr checks : No (default)") +endif() + message("")