diff options
Diffstat (limited to 'src/common/Collision/Maps/MapDefines.h')
| -rw-r--r-- | src/common/Collision/Maps/MapDefines.h | 52 |
1 files changed, 44 insertions, 8 deletions
diff --git a/src/common/Collision/Maps/MapDefines.h b/src/common/Collision/Maps/MapDefines.h index 7f28fc8b2a..d928c51721 100644 --- a/src/common/Collision/Maps/MapDefines.h +++ b/src/common/Collision/Maps/MapDefines.h @@ -1,14 +1,14 @@ /* * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published by the - * Free Software Foundation; either version 3 of the License, or (at your - * option) any later version. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along @@ -26,7 +26,40 @@ #define SIZE_OF_GRIDS 533.3333f #define MMAP_MAGIC 0x4d4d4150 // 'MMAP' -#define MMAP_VERSION 16 +#define MMAP_VERSION 18 + +struct MmapTileRecastConfig +{ + float walkableSlopeAngle; + + uint8 walkableRadius; // 1 + uint8 walkableHeight; // 1 + uint8 walkableClimb; // 1 + uint8 padding0{0}; // 1 → align next to 4 + + uint32 vertexPerMapEdge; + uint32 vertexPerTileEdge; + uint32 tilesPerMapEdge; + float baseUnitDim; + float cellSizeHorizontal; + float cellSizeVertical; + float maxSimplificationError; + + bool operator==(const MmapTileRecastConfig& b) const { + return walkableSlopeAngle == b.walkableSlopeAngle && + walkableRadius == b.walkableRadius && + walkableHeight == b.walkableHeight && + walkableClimb == b.walkableClimb && + vertexPerMapEdge == b.vertexPerMapEdge && + vertexPerTileEdge == b.vertexPerTileEdge && + tilesPerMapEdge == b.tilesPerMapEdge && + baseUnitDim == b.baseUnitDim && + cellSizeHorizontal == b.cellSizeHorizontal && + cellSizeVertical == b.cellSizeVertical && + maxSimplificationError == b.maxSimplificationError; + } +}; +static_assert(sizeof(MmapTileRecastConfig) == 36, "Unexpected size of MmapTileRecastConfig"); struct MmapTileHeader { @@ -37,17 +70,20 @@ struct MmapTileHeader char usesLiquids{true}; char padding[3] {}; + MmapTileRecastConfig recastConfig; + MmapTileHeader() : dtVersion(DT_NAVMESH_VERSION) { } }; // All padding fields must be handled and initialized to ensure mmaps_generator will produce binary-identical *.mmtile files -static_assert(sizeof(MmapTileHeader) == 20, "MmapTileHeader size is not correct, adjust the padding field size"); +static_assert(sizeof(MmapTileHeader) == 56, "MmapTileHeader size is not correct, adjust the padding field size"); static_assert(sizeof(MmapTileHeader) == (sizeof(MmapTileHeader::mmapMagic) + sizeof(MmapTileHeader::dtVersion) + sizeof(MmapTileHeader::mmapVersion) + sizeof(MmapTileHeader::size) + sizeof(MmapTileHeader::usesLiquids) + - sizeof(MmapTileHeader::padding)), "MmapTileHeader has uninitialized padding fields"); + sizeof(MmapTileHeader::padding)+ + sizeof(MmapTileRecastConfig)), "MmapTileHeader has uninitialized padding fields"); enum NavTerrain { |
