aboutsummaryrefslogtreecommitdiff
path: root/src/server/collision
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/collision')
-rw-r--r--src/server/collision/BoundingIntervalHierarchy.h4
-rw-r--r--src/server/collision/CMakeLists.txt1
-rw-r--r--src/server/collision/Management/VMapManager2.cpp6
-rw-r--r--src/server/collision/Management/VMapManager2.h6
-rw-r--r--src/server/collision/Models/ModelInstance.cpp4
-rw-r--r--src/server/collision/VMapDefinitions.h1
6 files changed, 10 insertions, 12 deletions
diff --git a/src/server/collision/BoundingIntervalHierarchy.h b/src/server/collision/BoundingIntervalHierarchy.h
index 4d38bfc18c4..491a299ca68 100644
--- a/src/server/collision/BoundingIntervalHierarchy.h
+++ b/src/server/collision/BoundingIntervalHierarchy.h
@@ -177,7 +177,7 @@ class BIH
{
uint32 tn = tree[node];
uint32 axis = (tn & (3 << 30)) >> 30;
- bool BVH2 = tn & (1 << 29);
+ bool BVH2 = (tn & (1 << 29)) != 0;
int offset = tn & ~(7 << 29);
if (!BVH2)
{
@@ -271,7 +271,7 @@ class BIH
{
uint32 tn = tree[node];
uint32 axis = (tn & (3 << 30)) >> 30;
- bool BVH2 = tn & (1 << 29);
+ bool BVH2 = (tn & (1 << 29)) != 0;
int offset = tn & ~(7 << 29);
if (!BVH2)
{
diff --git a/src/server/collision/CMakeLists.txt b/src/server/collision/CMakeLists.txt
index a2024bff7cb..378bd62a78a 100644
--- a/src/server/collision/CMakeLists.txt
+++ b/src/server/collision/CMakeLists.txt
@@ -75,7 +75,6 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/Management
${CMAKE_CURRENT_SOURCE_DIR}/Maps
${CMAKE_CURRENT_SOURCE_DIR}/Models
- ${ACE_INCLUDE_DIR}
${MYSQL_INCLUDE_DIR}
)
diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp
index 813a3c04288..1d267cbd2a5 100644
--- a/src/server/collision/Management/VMapManager2.cpp
+++ b/src/server/collision/Management/VMapManager2.cpp
@@ -25,8 +25,6 @@
#include "ModelInstance.h"
#include "WorldModel.h"
#include <G3D/Vector3.h>
-#include <ace/Null_Mutex.h>
-#include <ace/Singleton.h>
#include "DisableMgr.h"
#include "DBCStores.h"
#include "Log.h"
@@ -252,7 +250,7 @@ namespace VMAP
WorldModel* VMapManager2::acquireModelInstance(const std::string& basepath, const std::string& filename)
{
//! Critical section, thread safe access to iLoadedModelFiles
- TRINITY_GUARD(ACE_Thread_Mutex, LoadedModelFilesLock);
+ std::lock_guard<std::mutex> lock(LoadedModelFilesLock);
ModelFileMap::iterator model = iLoadedModelFiles.find(filename);
if (model == iLoadedModelFiles.end())
@@ -275,7 +273,7 @@ namespace VMAP
void VMapManager2::releaseModelInstance(const std::string &filename)
{
//! Critical section, thread safe access to iLoadedModelFiles
- TRINITY_GUARD(ACE_Thread_Mutex, LoadedModelFilesLock);
+ std::lock_guard<std::mutex> lock(LoadedModelFilesLock);
ModelFileMap::iterator model = iLoadedModelFiles.find(filename);
if (model == iLoadedModelFiles.end())
diff --git a/src/server/collision/Management/VMapManager2.h b/src/server/collision/Management/VMapManager2.h
index 711025e67c0..03de6951d5d 100644
--- a/src/server/collision/Management/VMapManager2.h
+++ b/src/server/collision/Management/VMapManager2.h
@@ -19,10 +19,10 @@
#ifndef _VMAPMANAGER2_H
#define _VMAPMANAGER2_H
+#include <mutex>
+#include <unordered_map>
#include "Define.h"
#include "IVMapManager.h"
-#include <unordered_map>
-#include <ace/Thread_Mutex.h>
//===========================================================
@@ -73,7 +73,7 @@ namespace VMAP
ModelFileMap iLoadedModelFiles;
InstanceTreeMap iInstanceMapTrees;
// Mutex for iLoadedModelFiles
- ACE_Thread_Mutex LoadedModelFilesLock;
+ std::mutex LoadedModelFilesLock;
bool _loadMap(uint32 mapId, const std::string& basePath, uint32 tileX, uint32 tileY);
/* void _unloadMap(uint32 pMapId, uint32 x, uint32 y); */
diff --git a/src/server/collision/Models/ModelInstance.cpp b/src/server/collision/Models/ModelInstance.cpp
index 3262c154965..475984c4fd3 100644
--- a/src/server/collision/Models/ModelInstance.cpp
+++ b/src/server/collision/Models/ModelInstance.cpp
@@ -167,7 +167,7 @@ namespace VMAP
check += fread(&spawn.iPos, sizeof(float), 3, rf);
check += fread(&spawn.iRot, sizeof(float), 3, rf);
check += fread(&spawn.iScale, sizeof(float), 1, rf);
- bool has_bound = (spawn.flags & MOD_HAS_BOUND);
+ bool has_bound = (spawn.flags & MOD_HAS_BOUND) != 0;
if (has_bound) // only WMOs have bound in MPQ, only available after computation
{
Vector3 bLow, bHigh;
@@ -206,7 +206,7 @@ namespace VMAP
check += fwrite(&spawn.iPos, sizeof(float), 3, wf);
check += fwrite(&spawn.iRot, sizeof(float), 3, wf);
check += fwrite(&spawn.iScale, sizeof(float), 1, wf);
- bool has_bound = (spawn.flags & MOD_HAS_BOUND);
+ bool has_bound = (spawn.flags & MOD_HAS_BOUND) != 0;
if (has_bound) // only WMOs have bound in MPQ, only available after computation
{
check += fwrite(&spawn.iBound.low(), sizeof(float), 3, wf);
diff --git a/src/server/collision/VMapDefinitions.h b/src/server/collision/VMapDefinitions.h
index 0bc74df51ec..8cd965ddffd 100644
--- a/src/server/collision/VMapDefinitions.h
+++ b/src/server/collision/VMapDefinitions.h
@@ -19,6 +19,7 @@
#ifndef _VMAPDEFINITIONS_H
#define _VMAPDEFINITIONS_H
#include <cstring>
+#include <cstdio>
#define LIQUID_TILE_SIZE (533.333f / 128.f)