AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
MMAP Namespace Reference

Classes

class  IMMapMgr
 
struct  IntermediateValues
 
class  MapBuilder
 
struct  MapTiles
 
struct  MeshData
 
struct  MMapData
 
class  MMapFactory
 
class  MMapMgr
 
class  TerrainBuilder
 
struct  Tile
 
class  TileBuilder
 
struct  TileConfig
 
struct  TileInfo
 

Typedefs

typedef std::unordered_map< uint32, dtTileRef > MMapTileSet
 
typedef std::unordered_map< uint32, dtNavMeshQuery * > NavMeshQuerySet
 
typedef std::unordered_map< uint32, MMapData * > MMapDataSet
 
typedef std::list< MapTilesTileList
 

Enumerations

enum  MMAP_LOAD_RESULT {
  MMAP_LOAD_RESULT_ERROR ,
  MMAP_LOAD_RESULT_OK ,
  MMAP_LOAD_RESULT_IGNORED ,
  MMAP_LOAD_RESULT_ERROR ,
  MMAP_LOAD_RESULT_OK ,
  MMAP_LOAD_RESULT_IGNORED
}
 
enum  MMAP_LOAD_RESULT {
  MMAP_LOAD_RESULT_ERROR ,
  MMAP_LOAD_RESULT_OK ,
  MMAP_LOAD_RESULT_IGNORED ,
  MMAP_LOAD_RESULT_ERROR ,
  MMAP_LOAD_RESULT_OK ,
  MMAP_LOAD_RESULT_IGNORED
}
 
enum  ListFilesResult {
  LISTFILE_DIRECTORY_NOT_FOUND = 0 ,
  LISTFILE_OK = 1
}
 
enum  Spot {
  TOP = 1 ,
  RIGHT = 2 ,
  LEFT = 3 ,
  BOTTOM = 4 ,
  ENTIRE = 5
}
 
enum  Grid {
  GRID_V8 ,
  GRID_V9
}
 

Functions

bool matchWildcardFilter (const char *filter, const char *str)
 
ListFilesResult getDirContents (std::vector< std::string > &fileList, std::string dirpath=".", std::string filter="*")
 

Variables

MMapMgrg_MMapMgr = nullptr
 
static char const *const MAP_FILE_NAME_FORMAT = "%s/mmaps/%03i.mmap"
 
static char const *const TILE_FILE_NAME_FORMAT = "%s/mmaps/%03i%02i%02i.mmtile"
 
uint32 const MAP_VERSION_MAGIC = 9
 
static uint16 holetab_h [4] = {0x1111, 0x2222, 0x4444, 0x8888}
 
static uint16 holetab_v [4] = {0x000F, 0x00F0, 0x0F00, 0xF000}
 
static const int V9_SIZE = 129
 
static const int V9_SIZE_SQ = V9_SIZE * V9_SIZE
 
static const int V8_SIZE = 128
 
static const int V8_SIZE_SQ = V8_SIZE * V8_SIZE
 
static const float GRID_SIZE = 533.3333f
 
static const float GRID_PART_SIZE = GRID_SIZE / V8_SIZE
 
static const float INVALID_MAP_LIQ_HEIGHT = -500.f
 
static const float INVALID_MAP_LIQ_HEIGHT_MAX = 5000.0f
 

Typedef Documentation

◆ MMapDataSet

typedef std::unordered_map<uint32, MMapData*> MMAP::MMapDataSet

◆ MMapTileSet

typedef std::unordered_map<uint32, dtTileRef> MMAP::MMapTileSet

◆ NavMeshQuerySet

typedef std::unordered_map<uint32, dtNavMeshQuery*> MMAP::NavMeshQuerySet

◆ TileList

typedef std::list<MapTiles> MMAP::TileList

Enumeration Type Documentation

◆ Grid

enum MMAP::Grid
Enumerator
GRID_V8 
GRID_V9 
40 {
41 GRID_V8,
43 };
@ GRID_V8
Definition: TerrainBuilder.h:41
@ GRID_V9
Definition: TerrainBuilder.h:42

◆ ListFilesResult

Enumerator
LISTFILE_DIRECTORY_NOT_FOUND 
LISTFILE_OK 
72 {
74 LISTFILE_OK = 1
75 };
@ LISTFILE_DIRECTORY_NOT_FOUND
Definition: PathCommon.h:73
@ LISTFILE_OK
Definition: PathCommon.h:74

◆ MMAP_LOAD_RESULT [1/2]

Enumerator
MMAP_LOAD_RESULT_ERROR 
MMAP_LOAD_RESULT_OK 
MMAP_LOAD_RESULT_IGNORED 
MMAP_LOAD_RESULT_ERROR 
MMAP_LOAD_RESULT_OK 
MMAP_LOAD_RESULT_IGNORED 
28 {
32 };
@ MMAP_LOAD_RESULT_ERROR
Definition: IMMAPMgr.h:29
@ MMAP_LOAD_RESULT_IGNORED
Definition: IMMAPMgr.h:31
@ MMAP_LOAD_RESULT_OK
Definition: IMMAPMgr.h:30

◆ MMAP_LOAD_RESULT [2/2]

Enumerator
MMAP_LOAD_RESULT_ERROR 
MMAP_LOAD_RESULT_OK 
MMAP_LOAD_RESULT_IGNORED 
MMAP_LOAD_RESULT_ERROR 
MMAP_LOAD_RESULT_OK 
MMAP_LOAD_RESULT_IGNORED 

◆ Spot

enum MMAP::Spot
Enumerator
TOP 
RIGHT 
LEFT 
BOTTOM 
ENTIRE 
31 {
32 TOP = 1,
33 RIGHT = 2,
34 LEFT = 3,
35 BOTTOM = 4,
36 ENTIRE = 5
37 };
@ ENTIRE
Definition: TerrainBuilder.h:36
@ LEFT
Definition: TerrainBuilder.h:34
@ RIGHT
Definition: TerrainBuilder.h:33
@ BOTTOM
Definition: TerrainBuilder.h:35
@ TOP
Definition: TerrainBuilder.h:32

Function Documentation

◆ getDirContents()

ListFilesResult MMAP::getDirContents ( std::vector< std::string > &  fileList,
std::string  dirpath = ".",
std::string  filter = "*" 
)
inline
78 {
79#ifdef WIN32
80 HANDLE hFind;
81 WIN32_FIND_DATA findFileInfo;
82 std::string directory;
83
84 directory = dirpath + "/" + filter;
85
86 hFind = FindFirstFile(directory.c_str(), &findFileInfo);
87
88 if (hFind == INVALID_HANDLE_VALUE)
90 do
91 {
92 if ((findFileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
93 fileList.push_back(std::string(findFileInfo.cFileName));
94 } while (FindNextFile(hFind, &findFileInfo));
95
96 FindClose(hFind);
97
98#else
99 const char* p = dirpath.c_str();
100 DIR* dirp = opendir(p);
101 struct dirent* dp;
102
103 while (dirp)
104 {
105 errno = 0;
106 if ((dp = readdir(dirp)) != nullptr)
107 {
108 if (matchWildcardFilter(filter.c_str(), dp->d_name))
109 fileList.emplace_back(dp->d_name);
110 }
111 else
112 break;
113 }
114
115 if (dirp)
116 closedir(dirp);
117 else
119#endif
120
121 return LISTFILE_OK;
122 }

References LISTFILE_DIRECTORY_NOT_FOUND, LISTFILE_OK, and matchWildcardFilter().

Referenced by checkDirectories(), and MMAP::MapBuilder::discoverTiles().

◆ matchWildcardFilter()

bool MMAP::matchWildcardFilter ( const char *  filter,
const char *  str 
)
inline
40 {
41 if (!filter || !str)
42 return false;
43
44 // end on null character
45 while (*filter && *str)
46 {
47 if (*filter == '*')
48 {
49 if (*++filter == '\0') // wildcard at end of filter means all remaing chars match
50 return true;
51
52 for (;;)
53 {
54 if (*filter == *str)
55 break;
56 if (*str == '\0')
57 return false; // reached end of string without matching next filter character
58 str++;
59 }
60 }
61 else if (*filter != *str)
62 return false; // mismatch
63
64 filter++;
65 str++;
66 }
67
68 return ((*filter == '\0' || (*filter == '*' && *++filter == '\0')) && *str == '\0');
69 }

Referenced by getDirContents().

Variable Documentation

◆ g_MMapMgr

MMapMgr* MMAP::g_MMapMgr = nullptr

◆ GRID_PART_SIZE

◆ GRID_SIZE

◆ holetab_h

uint16 MMAP::holetab_h[4] = {0x1111, 0x2222, 0x4444, 0x8888}
static

◆ holetab_v

uint16 MMAP::holetab_v[4] = {0x000F, 0x00F0, 0x0F00, 0xF000}
static

◆ INVALID_MAP_LIQ_HEIGHT

const float MMAP::INVALID_MAP_LIQ_HEIGHT = -500.f
static

◆ INVALID_MAP_LIQ_HEIGHT_MAX

const float MMAP::INVALID_MAP_LIQ_HEIGHT_MAX = 5000.0f
static

◆ MAP_FILE_NAME_FORMAT

char const* const MMAP::MAP_FILE_NAME_FORMAT = "%s/mmaps/%03i.mmap"
static

◆ MAP_VERSION_MAGIC

uint32 const MMAP::MAP_VERSION_MAGIC = 9

◆ TILE_FILE_NAME_FORMAT

char const* const MMAP::TILE_FILE_NAME_FORMAT = "%s/mmaps/%03i%02i%02i.mmtile"
static

Referenced by MMAP::MMapMgr::loadMap().

◆ V8_SIZE

◆ V8_SIZE_SQ

const int MMAP::V8_SIZE_SQ = V8_SIZE * V8_SIZE
static

◆ V9_SIZE

◆ V9_SIZE_SQ

const int MMAP::V9_SIZE_SQ = V9_SIZE * V9_SIZE
static