diff options
| author | Shauren <shauren.trinity@gmail.com> | 2025-10-02 13:43:45 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2025-10-02 13:43:45 +0200 |
| commit | 6b41c3d3274653605b42f1144f554fe43eee344e (patch) | |
| tree | c8d515ce67ade9b7f360e157c3798d25ffb7aa23 /src/common/Collision/Management/MMapManager.h | |
| parent | ca70a5c1a0b597b201603e48051d5a0623bd5248 (diff) | |
Core/MMaps: Improve mmap debugging experience for terrain swap maps
* Output terrain map id in `.mmap loc` command
* Suppress file not found errors for terrain swap maps
* Fix generating single tiles for terrain swap maps (--tile argument)
Diffstat (limited to 'src/common/Collision/Management/MMapManager.h')
| -rw-r--r-- | src/common/Collision/Management/MMapManager.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/common/Collision/Management/MMapManager.h b/src/common/Collision/Management/MMapManager.h index fe32152e138..45c0466e687 100644 --- a/src/common/Collision/Management/MMapManager.h +++ b/src/common/Collision/Management/MMapManager.h @@ -54,6 +54,16 @@ namespace MMAP typedef std::unordered_map<uint32, MMapData*> MMapDataSet; + enum class LoadResult : uint8 + { + Success, + AlreadyLoaded, + FileNotFound, + VersionMismatch, + ReadFromFileFailed, + LibraryError + }; + // singleton class // holds all all access to mmap loading unloading and meshes class TC_COMMON_API MMapManager @@ -63,7 +73,7 @@ namespace MMAP ~MMapManager(); void InitializeThreadUnsafe(std::unordered_map<uint32, std::vector<uint32>> const& mapData); - bool loadMap(std::string const& basePath, uint32 mapId, int32 x, int32 y); + LoadResult loadMap(std::string const& basePath, uint32 mapId, int32 x, int32 y); bool loadMapInstance(std::string const& basePath, uint32 meshMapId, uint32 instanceMapId, uint32 instanceId); bool unloadMap(uint32 mapId, int32 x, int32 y); bool unloadMap(uint32 mapId); @@ -76,7 +86,7 @@ namespace MMAP uint32 getLoadedTilesCount() const { return loadedTiles; } uint32 getLoadedMapsCount() const { return uint32(loadedMMaps.size()); } private: - bool loadMapData(std::string const& basePath, uint32 mapId); + LoadResult loadMapData(std::string const& basePath, uint32 mapId); uint32 packTileID(int32 x, int32 y); MMapDataSet::const_iterator GetMMapData(uint32 mapId) const; |
