Tools/MMapsGenerator: Cleanup duplicated definitions

* rebuilding is not needed
This commit is contained in:
Shauren
2018-04-14 18:22:27 +02:00
parent d0fc4b972d
commit 60c4c29da5
3 changed files with 17 additions and 47 deletions
+16 -33
View File
@@ -15,45 +15,19 @@
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <limits.h>
#include "PathCommon.h"
#include "MapBuilder.h"
#include "StringFormat.h"
#include "MapDefines.h"
#include "MapTree.h"
#include "ModelInstance.h"
#include "PathCommon.h"
#include "StringFormat.h"
#include "VMapFactory.h"
#include "VMapManager2.h"
#include "DetourNavMeshBuilder.h"
#include "DetourNavMesh.h"
#include "DetourCommon.h"
#define MMAP_MAGIC 0x4d4d4150 // 'MMAP'
#define MMAP_VERSION 8
struct MmapTileHeader
{
uint32 mmapMagic;
uint32 dtVersion;
uint32 mmapVersion;
uint32 size;
char usesLiquids;
char padding[3];
MmapTileHeader() : mmapMagic(MMAP_MAGIC), dtVersion(DT_NAVMESH_VERSION),
mmapVersion(MMAP_VERSION), size(0), usesLiquids(true), padding() {}
};
// 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) == (sizeof(MmapTileHeader::mmapMagic) +
sizeof(MmapTileHeader::dtVersion) +
sizeof(MmapTileHeader::mmapVersion) +
sizeof(MmapTileHeader::size) +
sizeof(MmapTileHeader::usesLiquids) +
sizeof(MmapTileHeader::padding)), "MmapTileHeader has uninitialized padding fields");
#include <DetourCommon.h>
#include <DetourNavMesh.h>
#include <DetourNavMeshBuilder.h>
#include <climits>
namespace MMAP
{
@@ -1003,6 +977,8 @@ namespace MMAP
case 1010: // CTF3
case 1105: // Deepwind Gorge
case 1280: // Southshore vs. Tarren Mill
case 1681: // Arathi Basin Winter
case 1803: // Seething Shore
return true;
default:
break;
@@ -1082,6 +1058,13 @@ namespace MMAP
case 1639:
case 1649:
case 1650:
case 1711:
case 1751:
case 1752:
case 1856:
case 1857:
case 1902:
case 1903:
return true;
default:
return false;
-14
View File
@@ -34,20 +34,6 @@
#include <cerrno>
#endif
enum NavTerrain
{
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
};
namespace MMAP
{
inline bool matchWildcardFilter(const char* filter, const char* str)
@@ -18,6 +18,7 @@
#include "TerrainBuilder.h"
#include "MapBuilder.h"
#include "MapDefines.h"
#include "MapTree.h"
#include "ModelInstance.h"
#include "VMapFactory.h"