![]() |
TrinityCore
|
#include <MMapManager.h>
Public Member Functions | |
| MMapManager () | |
| MMapManager (MMapManager const &other)=delete | |
| MMapManager (MMapManager &&other) noexcept=delete | |
| MMapManager & | operator= (MMapManager const &other)=delete |
| MMapManager & | operator= (MMapManager &&other) noexcept=delete |
| ~MMapManager () | |
| void | InitializeThreadUnsafe (std::unordered_map< uint32, std::vector< uint32 > > const &mapData) |
| LoadResult | loadMap (std::string_view basePath, uint32 mapId, uint32 instanceId, int32 x, int32 y) |
| bool | loadMapInstance (std::string_view basePath, uint32 meshMapId, uint32 instanceMapId, uint32 instanceId) |
| void | unloadMap (uint32 mapId, int32 x, int32 y) |
| void | unloadMap (uint32 mapId) |
| void | unloadMapInstance (uint32 meshMapId, uint32 instanceMapId, uint32 instanceId) |
| dtNavMeshQuery const * | GetNavMeshQuery (uint32 meshMapId, uint32 instanceMapId, uint32 instanceId) |
| dtNavMesh * | GetNavMesh (uint32 mapId, uint32 instanceId) |
| uint32 | getLoadedTilesCount () const |
| uint32 | getLoadedMapsCount () const |
Static Public Member Functions | |
| static MMapManager * | instance () |
| static LoadResult | parseNavMeshParamsFile (std::string_view basePath, uint32 mapId, dtNavMeshParams *params, std::vector< OffMeshData > *offmeshConnections=nullptr) |
| static bool | isRebuildingTilesEnabledOnMap (uint32 mapId) |
Private Member Functions | |
| LoadResult | loadMapData (std::string_view basePath, uint32 mapId, uint32 instanceId) |
| uint32 | packTileID (int32 x, int32 y) |
| MMapDataSet::const_iterator | GetMMapData (uint32 mapId) const |
Private Attributes | |
| MMapDataSet | loadedMMaps |
| uint32 | loadedTiles = 0 |
| std::unordered_map< uint32, uint32 > | parentMapData |
Definition at line 48 of file MMapManager.h.
|
default |
|
delete |
|
deletenoexcept |
|
default |
|
inline |
Definition at line 73 of file MMapManager.h.
Referenced by mmaps_commandscript::HandleMmapStatsCommand().
|
inline |
Definition at line 72 of file MMapManager.h.
Referenced by mmaps_commandscript::HandleMmapStatsCommand().
|
private |
Definition at line 107 of file MMapManager.cpp.
References loadedMMaps.
Referenced by GetNavMesh(), GetNavMeshQuery(), unloadMap(), and unloadMapInstance().
Definition at line 448 of file MMapManager.cpp.
References GetMMapData(), and loadedMMaps.
Referenced by misc_commandscript::HandleGPSCommand(), mmaps_commandscript::HandleMmapLoadedTilesCommand(), mmaps_commandscript::HandleMmapLocCommand(), mmaps_commandscript::HandleMmapStatsCommand(), and PathGenerator::PathGenerator().
| dtNavMeshQuery const * MMAP::MMapManager::GetNavMeshQuery | ( | uint32 | meshMapId, |
| uint32 | instanceMapId, | ||
| uint32 | instanceId | ||
| ) |
Definition at line 461 of file MMapManager.cpp.
References GetMMapData(), and loadedMMaps.
Referenced by mmaps_commandscript::HandleMmapLoadedTilesCommand(), mmaps_commandscript::HandleMmapLocCommand(), and PathGenerator::PathGenerator().
| void MMAP::MMapManager::InitializeThreadUnsafe | ( | std::unordered_map< uint32, std::vector< uint32 > > const & | mapData | ) |
Definition at line 96 of file MMapManager.cpp.
References loadedMMaps, and parentMapData.
Referenced by World::SetInitialWorldSettings().
|
static |
Definition at line 90 of file MMapManager.cpp.
References instance().
Referenced by misc_commandscript::HandleGPSCommand(), mmaps_commandscript::HandleMmapLoadedTilesCommand(), mmaps_commandscript::HandleMmapLocCommand(), mmaps_commandscript::HandleMmapPathCommand(), mmaps_commandscript::HandleMmapStatsCommand(), instance(), TerrainInfo::LoadMMapImpl(), TerrainInfo::LoadMMapInstanceImpl(), Map::Map(), PathGenerator::PathGenerator(), World::SetInitialWorldSettings(), TerrainInfo::UnloadMapImpl(), TerrainInfo::UnloadMMapInstanceImpl(), and TerrainInfo::~TerrainInfo().
|
static |
Definition at line 117 of file MMapManager.cpp.
References MMAP::MMapData::GetInstanceIdForMeshLookup().
Referenced by Map::Map(), unloadMap(), and unloadMapInstance().
| LoadResult MMAP::MMapManager::loadMap | ( | std::string_view | basePath, |
| uint32 | mapId, | ||
| uint32 | instanceId, | ||
| int32 | x, | ||
| int32 | y | ||
| ) |
Definition at line 206 of file MMapManager.cpp.
References MMAP::AlreadyLoaded, ASSERT, MMAP::FileNotFound, MMAP::MMapData::GetMeshData(), MMAP::LibraryError, loadedMMaps, MMAP::MMapMapData::loadedTileRefs, loadedTiles, loadMapData(), Trinity::Containers::MapGetValuePtr(), MMAP_MAGIC, MMAP_VERSION, MmapTileHeader::mmapMagic, MmapTileHeader::mmapVersion, MMAP::MMapMapData::navMesh, packTileID(), parentMapData, MMAP::ReadFromFileFailed, MmapTileHeader::size, Trinity::StringFormat(), MMAP::Success, TC_LOG_DEBUG, TC_LOG_ERROR, MMAP::TILE_FILE_NAME_FORMAT, and MMAP::VersionMismatch.
|
private |
Definition at line 122 of file MMapManager.cpp.
References MMAP::AlreadyLoaded, ASSERT, MMAP::LibraryError, loadedMMaps, Trinity::make_unique_ptr_with_deleter(), params, parseNavMeshParamsFile(), MMAP::Success, TC_LOG_DEBUG, and TC_LOG_ERROR.
Referenced by loadMap(), and loadMapInstance().
| bool MMAP::MMapManager::loadMapInstance | ( | std::string_view | basePath, |
| uint32 | meshMapId, | ||
| uint32 | instanceMapId, | ||
| uint32 | instanceId | ||
| ) |
Definition at line 305 of file MMapManager.cpp.
References MMAP::AlreadyLoaded, MMAP::MMapData::GetMeshData(), loadedMMaps, loadMapData(), Trinity::make_unique_ptr_with_deleter(), Trinity::Containers::MapGetValuePtr(), MMAP::MMapData::navMeshQueries, MMAP::Success, TC_LOG_DEBUG, and TC_LOG_ERROR.
Referenced by TerrainInfo::LoadMMapInstanceImpl().
|
deletenoexcept |
|
delete |
Definition at line 201 of file MMapManager.cpp.
Referenced by loadMap(), and unloadMap().
|
static |
Definition at line 154 of file MMapManager.cpp.
References MMAP::FileNotFound, MMAP::MAP_FILE_NAME_FORMAT, MMAP_MAGIC, MMAP_VERSION, MmapNavMeshHeader::mmapMagic, MmapNavMeshHeader::mmapVersion, MmapNavMeshHeader::offmeshConnectionCount, MmapNavMeshHeader::params, params, MMAP::ReadFromFileFailed, Trinity::StringFormat(), MMAP::Success, TC_LOG_DEBUG, TC_LOG_ERROR, and MMAP::VersionMismatch.
Referenced by loadMapData().
| void MMAP::MMapManager::unloadMap | ( | uint32 | mapId | ) |
Definition at line 375 of file MMapManager.cpp.
References ASSERT, isRebuildingTilesEnabledOnMap(), loadedMMaps, loadedTiles, Trinity::Containers::MapValue, TC_LOG_DEBUG, and TC_LOG_ERROR.
Definition at line 338 of file MMapManager.cpp.
References ABORT, GetMMapData(), loadedMMaps, loadedTiles, MMAP::MMapData::meshData, packTileID(), TC_LOG_DEBUG, and TC_LOG_ERROR.
Referenced by TerrainInfo::UnloadMapImpl(), and TerrainInfo::~TerrainInfo().
| void MMAP::MMapManager::unloadMapInstance | ( | uint32 | meshMapId, |
| uint32 | instanceMapId, | ||
| uint32 | instanceId | ||
| ) |
Definition at line 409 of file MMapManager.cpp.
References GetMMapData(), isRebuildingTilesEnabledOnMap(), loadedMMaps, loadedTiles, MMAP::MMapData::navMeshQueries, MMAP::MMapData::RemoveMeshData(), TC_LOG_DEBUG, and TC_LOG_ERROR.
Referenced by TerrainInfo::UnloadMMapInstanceImpl().
|
private |
Definition at line 82 of file MMapManager.h.
Referenced by GetMMapData(), GetNavMesh(), GetNavMeshQuery(), InitializeThreadUnsafe(), loadMap(), loadMapData(), loadMapInstance(), unloadMap(), unloadMap(), and unloadMapInstance().
|
private |
Definition at line 83 of file MMapManager.h.
Referenced by loadMap(), unloadMap(), unloadMap(), and unloadMapInstance().
Definition at line 85 of file MMapManager.h.
Referenced by InitializeThreadUnsafe(), and loadMap().