TrinityCore
Loading...
Searching...
No Matches
MapDefines.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef _MAPDEFINES_H
19#define _MAPDEFINES_H
20
21#include "Define.h"
22#include "Optional.h"
23#include <DetourNavMesh.h>
24
25const uint32 MMAP_MAGIC = 0x4d4d4150; // 'MMAP'
26#define MMAP_VERSION 15
27
40
41// All padding fields must be handled and initialized to ensure mmaps_generator will produce binary-identical *.mmtile files
42static_assert(sizeof(MmapTileHeader) == 20, "MmapTileHeader size is not correct, adjust the padding field size");
43static_assert(sizeof(MmapTileHeader) == (sizeof(MmapTileHeader::mmapMagic) +
46 sizeof(MmapTileHeader::size) +
48 sizeof(MmapTileHeader::padding)), "MmapTileHeader has uninitialized padding fields");
49
51{
53 // areas 1-60 will be used for destructible areas (currently skipped in vmaps, WMO with flag 1)
54 // 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)
58 NAV_AREA_MAGMA_SLIME = 8, // don't need to differentiate between them
61 NAV_AREA_ALL_MASK = 0x3F // max allowed value
62};
63
72
81
82#define MAP_LIQUID_STATUS_SWIMMING (LIQUID_MAP_IN_WATER | LIQUID_MAP_UNDER_WATER)
83#define MAP_LIQUID_STATUS_IN_CONTACT (MAP_LIQUID_STATUS_SWIMMING | LIQUID_MAP_WATER_WALK)
84
92
94{
95 WmoLocation() = default;
96 WmoLocation(int32 groupId, int32 nameSetId, int32 rootId, uint32 uniqueId)
97 : GroupId(groupId), NameSetId(nameSetId), RootId(rootId), UniqueId(uniqueId) { }
98
103};
104
115
116#endif // _MAPDEFINES_H
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
NavTerrainFlag
Definition MapDefines.h:65
@ NAV_GROUND_STEEP
Definition MapDefines.h:68
@ NAV_EMPTY
Definition MapDefines.h:66
@ NAV_GROUND
Definition MapDefines.h:67
@ NAV_WATER
Definition MapDefines.h:69
@ NAV_MAGMA_SLIME
Definition MapDefines.h:70
NavArea
Definition MapDefines.h:51
@ NAV_AREA_MIN_VALUE
Definition MapDefines.h:60
@ NAV_AREA_ALL_MASK
Definition MapDefines.h:61
@ NAV_AREA_GROUND_STEEP
Definition MapDefines.h:56
@ NAV_AREA_GROUND
Definition MapDefines.h:55
@ NAV_AREA_MAGMA_SLIME
Definition MapDefines.h:58
@ NAV_AREA_EMPTY
Definition MapDefines.h:52
@ NAV_AREA_MAX_VALUE
Definition MapDefines.h:59
@ NAV_AREA_WATER
Definition MapDefines.h:57
ZLiquidStatus
Definition MapDefines.h:74
@ LIQUID_MAP_UNDER_WATER
Definition MapDefines.h:79
@ LIQUID_MAP_NO_WATER
Definition MapDefines.h:75
@ LIQUID_MAP_IN_WATER
Definition MapDefines.h:78
@ LIQUID_MAP_ABOVE_WATER
Definition MapDefines.h:76
@ LIQUID_MAP_WATER_WALK
Definition MapDefines.h:77
#define MMAP_VERSION
Definition MapDefines.h:26
const uint32 MMAP_MAGIC
Definition MapDefines.h:25
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
uint32 entry
Definition MapDefines.h:88
float depth_level
Definition MapDefines.h:90
uint32 type_flags
Definition MapDefines.h:87
float level
Definition MapDefines.h:89
uint32 dtVersion
Definition MapDefines.h:31
uint32 mmapVersion
Definition MapDefines.h:32
char padding[3]
Definition MapDefines.h:35
uint32 mmapMagic
Definition MapDefines.h:30
Optional< LiquidData > liquidInfo
Definition MapDefines.h:113
Optional< WmoLocation > wmoLocation
Definition MapDefines.h:112
ZLiquidStatus liquidStatus
Definition MapDefines.h:111
uint32 UniqueId
Definition MapDefines.h:102
int32 GroupId
Definition MapDefines.h:99
WmoLocation()=default
int32 NameSetId
Definition MapDefines.h:100
WmoLocation(int32 groupId, int32 nameSetId, int32 rootId, uint32 uniqueId)
Definition MapDefines.h:96