aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/Collision/Maps/MapDefines.h28
-rw-r--r--src/common/Collision/Maps/TileAssembler.cpp8
-rw-r--r--src/common/Collision/Maps/TileAssembler.h3
3 files changed, 21 insertions, 18 deletions
diff --git a/src/common/Collision/Maps/MapDefines.h b/src/common/Collision/Maps/MapDefines.h
index 5a525280f74..2109fa57e19 100644
--- a/src/common/Collision/Maps/MapDefines.h
+++ b/src/common/Collision/Maps/MapDefines.h
@@ -22,7 +22,7 @@
#include "DetourNavMesh.h"
const uint32 MMAP_MAGIC = 0x4d4d4150; // 'MMAP'
-#define MMAP_VERSION 8
+#define MMAP_VERSION 9
struct MmapTileHeader
{
@@ -46,18 +46,22 @@ static_assert(sizeof(MmapTileHeader) == (sizeof(MmapTileHeader::mmapMagic) +
sizeof(MmapTileHeader::usesLiquids) +
sizeof(MmapTileHeader::padding)), "MmapTileHeader has uninitialized padding fields");
-enum NavTerrain
+enum NavArea
{
- NAV_EMPTY = 0x00,
- NAV_GROUND = 0x01,
- NAV_MAGMA = 0x02,
- NAV_SLIME = 0x04,
- NAV_WATER = 0x08,
- NAV_UNUSED1 = 0x10,
- NAV_UNUSED2 = 0x20,
- NAV_UNUSED3 = 0x40,
- NAV_UNUSED4 = 0x80
- // we only have 8 bits
+ NAV_AREA_EMPTY = 0,
+ // areas 1-60 will be used for destructible areas (currently skipped in vmaps, WMO with flag 1)
+ // ground is the highest value to make recast choose ground over water when merging surfaces very close to each other (shallow water would be walkable)
+ NAV_AREA_GROUND = 63,
+ NAV_AREA_WATER = 62,
+ NAV_AREA_MAGMA_SLIME = 61 // don't need to differentiate between them
+};
+
+enum NavTerrainFlag
+{
+ NAV_EMPTY = 0x00,
+ NAV_GROUND = 1 << (63 - NAV_AREA_GROUND),
+ NAV_WATER = 1 << (63 - NAV_AREA_WATER),
+ NAV_MAGMA_SLIME = 1 << (63 - NAV_AREA_MAGMA_SLIME)
};
#endif /* _MAPDEFINES_H */
diff --git a/src/common/Collision/Maps/TileAssembler.cpp b/src/common/Collision/Maps/TileAssembler.cpp
index 37dc0ee55a4..250c40293e1 100644
--- a/src/common/Collision/Maps/TileAssembler.cpp
+++ b/src/common/Collision/Maps/TileAssembler.cpp
@@ -54,7 +54,7 @@ namespace VMAP
//=================================================================
TileAssembler::TileAssembler(const std::string& pSrcDirName, const std::string& pDestDirName)
- : iDestDir(pDestDirName), iSrcDir(pSrcDirName), iFilterMethod(nullptr), iCurrentUniqueNameId(0)
+ : iDestDir(pDestDirName), iSrcDir(pSrcDirName), iCurrentUniqueNameId(0)
{
boost::filesystem::create_directory(iDestDir);
//init();
@@ -236,8 +236,10 @@ namespace VMAP
printf("spawning Map %u\n", mapID);
mapData[mapID] = current = new MapSpawns();
}
- else current = (*map_iter).second;
- current->UniqueEntries.insert(pair<uint32, ModelSpawn>(spawn.ID, spawn));
+ else
+ current = map_iter->second;
+
+ current->UniqueEntries.emplace(spawn.ID, spawn);
current->TileEntries.insert(pair<uint32, uint32>(StaticMapTree::packTileID(tileX, tileY), spawn.ID));
}
bool success = (ferror(dirf) == 0);
diff --git a/src/common/Collision/Maps/TileAssembler.h b/src/common/Collision/Maps/TileAssembler.h
index 772af15450c..72040135a73 100644
--- a/src/common/Collision/Maps/TileAssembler.h
+++ b/src/common/Collision/Maps/TileAssembler.h
@@ -95,7 +95,6 @@ namespace VMAP
private:
std::string iDestDir;
std::string iSrcDir;
- bool (*iFilterMethod)(char *pName);
G3D::Table<std::string, unsigned int > iUniqueNameIds;
unsigned int iCurrentUniqueNameId;
MapData mapData;
@@ -111,8 +110,6 @@ namespace VMAP
void exportGameobjectModels();
bool convertRawFile(const std::string& pModelFilename);
- void setModelNameFilterMethod(bool (*pFilterMethod)(char *pName)) { iFilterMethod = pFilterMethod; }
- std::string getDirEntryNameFromModName(unsigned int pMapId, const std::string& pModPosName);
};
} // VMAP