AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
VMAP::StaticMapTree Class Reference

#include "MapTree.h"

Public Member Functions

 StaticMapTree (uint32 mapID, const std::string &basePath)
 
 ~StaticMapTree ()
 Make sure to call unloadMap() to unregister acquired model references before destroying.
 
bool isInLineOfSight (const G3D::Vector3 &pos1, const G3D::Vector3 &pos2, ModelIgnoreFlags ignoreFlags) const
 
bool GetObjectHitPos (const G3D::Vector3 &pos1, const G3D::Vector3 &pos2, G3D::Vector3 &pResultHitPos, float pModifyDist) const
 
float getHeight (const G3D::Vector3 &pPos, float maxSearchDist) const
 
bool GetAreaInfo (G3D::Vector3 &pos, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const
 
bool GetLocationInfo (const G3D::Vector3 &pos, LocationInfo &info) const
 
bool InitMap (const std::string &fname, VMapMgr2 *vm)
 
void UnloadMap (VMapMgr2 *vm)
 
bool LoadMapTile (uint32 tileX, uint32 tileY, VMapMgr2 *vm)
 
void UnloadMapTile (uint32 tileX, uint32 tileY, VMapMgr2 *vm)
 
bool isTiled () const
 
uint32 numLoadedTiles () const
 
void GetModelInstances (ModelInstance *&models, uint32 &count)
 

Static Public Member Functions

static std::string getTileFileName (uint32 mapID, uint32 tileX, uint32 tileY)
 
static uint32 packTileID (uint32 tileX, uint32 tileY)
 
static void unpackTileID (uint32 ID, uint32 &tileX, uint32 &tileY)
 
static LoadResult CanLoadMap (const std::string &basePath, uint32 mapID, uint32 tileX, uint32 tileY)
 

Private Types

typedef std::unordered_map< uint32, bool > loadedTileMap
 
typedef std::unordered_map< uint32, uint32loadedSpawnMap
 

Private Member Functions

bool GetIntersectionTime (const G3D::Ray &pRay, float &pMaxDist, bool StopAtFirstHit, ModelIgnoreFlags ignoreFlags) const
 

Private Attributes

uint32 iMapID
 
bool iIsTiled
 
BIH iTree
 
ModelInstanceiTreeValues
 
uint32 iNTreeValues
 
loadedTileMap iLoadedTiles
 
loadedSpawnMap iLoadedSpawns
 
std::string iBasePath
 

Detailed Description

Member Typedef Documentation

◆ loadedSpawnMap

typedef std::unordered_map<uint32, uint32> VMAP::StaticMapTree::loadedSpawnMap
private

◆ loadedTileMap

typedef std::unordered_map<uint32, bool> VMAP::StaticMapTree::loadedTileMap
private

Constructor & Destructor Documentation

◆ StaticMapTree()

VMAP::StaticMapTree::StaticMapTree ( uint32  mapID,
const std::string &  basePath 
)
126 : iMapID(mapID), iIsTiled(false), iTreeValues(0), iBasePath(basePath)
127 {
128 if (iBasePath.length() > 0 && iBasePath[iBasePath.length() - 1] != '/' && iBasePath[iBasePath.length() - 1] != '\\')
129 {
130 iBasePath.push_back('/');
131 }
132 }
uint32 iMapID
Definition: MapTree.h:47
bool iIsTiled
Definition: MapTree.h:48
std::string iBasePath
Definition: MapTree.h:59
ModelInstance * iTreeValues
Definition: MapTree.h:50

References iBasePath.

◆ ~StaticMapTree()

VMAP::StaticMapTree::~StaticMapTree ( )

Make sure to call unloadMap() to unregister acquired model references before destroying.

137 {
138 delete[] iTreeValues;
139 }

References iTreeValues.

Member Function Documentation

◆ CanLoadMap()

LoadResult VMAP::StaticMapTree::CanLoadMap ( const std::string &  basePath,
uint32  mapID,
uint32  tileX,
uint32  tileY 
)
static
254 {
255 std::string basePath = vmapPath;
256 if (basePath.length() > 0 && basePath[basePath.length() - 1] != '/' && basePath[basePath.length() - 1] != '\\')
257 {
258 basePath.push_back('/');
259 }
260 std::string fullname = basePath + VMapMgr2::getMapFileName(mapID);
261
263
264 FILE* rf = fopen(fullname.c_str(), "rb");
265 if (!rf)
266 {
268 }
269
270 char tiled;
271 char chunk[8];
272 if (!readChunk(rf, chunk, VMAP_MAGIC, 8) || fread(&tiled, sizeof(char), 1, rf) != 1)
273 {
274 fclose(rf);
276 }
277 if (tiled)
278 {
279 std::string tilefile = basePath + getTileFileName(mapID, tileX, tileY);
280 FILE* tf = fopen(tilefile.c_str(), "rb");
281 if (!tf)
282 {
284 }
285 else
286 {
287 if (!readChunk(tf, chunk, VMAP_MAGIC, 8))
288 {
290 }
291 fclose(tf);
292 }
293 }
294 fclose(rf);
295 return result;
296 }
bool readChunk(FILE *rf, char *dest, const char *compare, uint32 len)
Definition: TileAssembler.cpp:40
LoadResult
Definition: IVMapMgr.h:42
const char VMAP_MAGIC[]
Definition: VMapDefinitions.h:26
static std::string getMapFileName(unsigned int mapId)
Definition: VMapMgr2.cpp:89
static std::string getTileFileName(uint32 mapID, uint32 tileX, uint32 tileY)
Definition: MapTree.cpp:92

References VMAP::FileNotFound, VMAP::VMapMgr2::getMapFileName(), getTileFileName(), VMAP::readChunk(), VMAP::Success, VMAP::VersionMismatch, and VMAP::VMAP_MAGIC.

Referenced by VMAP::VMapMgr2::existsMap().

◆ GetAreaInfo()

bool VMAP::StaticMapTree::GetAreaInfo ( G3D::Vector3 &  pos,
uint32 flags,
int32 adtId,
int32 rootId,
int32 groupId 
) const
103 {
104 AreaInfoCallback intersectionCallBack(iTreeValues);
105 iTree.intersectPoint(pos, intersectionCallBack);
106 if (intersectionCallBack.aInfo.result)
107 {
108 flags = intersectionCallBack.aInfo.flags;
109 adtId = intersectionCallBack.aInfo.adtId;
110 rootId = intersectionCallBack.aInfo.rootId;
111 groupId = intersectionCallBack.aInfo.groupId;
112 pos.z = intersectionCallBack.aInfo.ground_Z;
113 return true;
114 }
115 return false;
116 }
void intersectPoint(const G3D::Vector3 &p, IsectCallback &intersectCallback) const
Definition: BoundingIntervalHierarchy.h:284
BIH iTree
Definition: MapTree.h:49

References VMAP::AreaInfo::adtId, VMAP::AreaInfoCallback::aInfo, VMAP::AreaInfo::flags, VMAP::AreaInfo::ground_Z, VMAP::AreaInfo::groupId, BIH::intersectPoint(), iTree, iTreeValues, VMAP::AreaInfo::result, and VMAP::AreaInfo::rootId.

◆ getHeight()

float VMAP::StaticMapTree::getHeight ( const G3D::Vector3 &  pPos,
float  maxSearchDist 
) const
239 {
240 float height = G3D::finf();
241 Vector3 dir = Vector3(0, 0, -1);
242 G3D::Ray ray(pPos, dir); // direction with length of 1
243 float maxDist = maxSearchDist;
244 if (GetIntersectionTime(ray, maxDist, false, ModelIgnoreFlags::Nothing))
245 {
246 height = pPos.z - maxDist;
247 }
248 return (height);
249 }
bool GetIntersectionTime(const G3D::Ray &pRay, float &pMaxDist, bool StopAtFirstHit, ModelIgnoreFlags ignoreFlags) const
Definition: MapTree.cpp:147

References GetIntersectionTime(), and VMAP::Nothing.

◆ GetIntersectionTime()

bool VMAP::StaticMapTree::GetIntersectionTime ( const G3D::Ray &  pRay,
float &  pMaxDist,
bool  StopAtFirstHit,
ModelIgnoreFlags  ignoreFlags 
) const
private

If intersection is found within pMaxDist, sets pMaxDist to intersection distance and returns true. Else, pMaxDist is not modified and returns false;

148 {
149 float distance = pMaxDist;
150 MapRayCallback intersectionCallBack(iTreeValues, ignoreFlags);
151 iTree.intersectRay(pRay, intersectionCallBack, distance, StopAtFirstHit);
152 if (intersectionCallBack.didHit())
153 {
154 pMaxDist = distance;
155 }
156 return intersectionCallBack.didHit();
157 }
void intersectRay(const G3D::Ray &r, RayCallback &intersectCallback, float &maxDist, bool stopAtFirstHit) const
Definition: BoundingIntervalHierarchy.h:121

References VMAP::MapRayCallback::didHit(), BIH::intersectRay(), iTree, and iTreeValues.

Referenced by getHeight(), GetObjectHitPos(), and isInLineOfSight().

◆ GetLocationInfo()

bool VMAP::StaticMapTree::GetLocationInfo ( const G3D::Vector3 &  pos,
LocationInfo info 
) const
119 {
120 LocationInfoCallback intersectionCallBack(iTreeValues, info);
121 iTree.intersectPoint(pos, intersectionCallBack);
122 return intersectionCallBack.result;
123 }

References BIH::intersectPoint(), iTree, iTreeValues, and VMAP::LocationInfoCallback::result.

◆ GetModelInstances()

void VMAP::StaticMapTree::GetModelInstances ( ModelInstance *&  models,
uint32 count 
)
535 {
536 models = iTreeValues;
537 count = iNTreeValues;
538 }
uint32 iNTreeValues
Definition: MapTree.h:51

References iNTreeValues, and iTreeValues.

◆ GetObjectHitPos()

bool VMAP::StaticMapTree::GetObjectHitPos ( const G3D::Vector3 &  pos1,
const G3D::Vector3 &  pos2,
G3D::Vector3 &  pResultHitPos,
float  pModifyDist 
) const

When moving from pos1 to pos2 check if we hit an object. Return true and the position if we hit one Return the hit pos or the original dest pos

194 {
195 bool result = false;
196 float maxDist = (pPos2 - pPos1).magnitude();
197 // valid map coords should *never ever* produce float overflow, but this would produce NaNs too
198 ASSERT(maxDist < std::numeric_limits<float>::max());
199 // prevent NaN values which can cause BIH intersection to enter infinite loop
200 if (maxDist < 1e-10f)
201 {
202 pResultHitPos = pPos2;
203 return false;
204 }
205 Vector3 dir = (pPos2 - pPos1) / maxDist; // direction with length of 1
206 G3D::Ray ray(pPos1, dir);
207 float dist = maxDist;
208 if (GetIntersectionTime(ray, dist, false, ModelIgnoreFlags::Nothing))
209 {
210 pResultHitPos = pPos1 + dir * dist;
211 if (pModifyDist < 0)
212 {
213 if ((pResultHitPos - pPos1).magnitude() > -pModifyDist)
214 {
215 pResultHitPos = pResultHitPos + dir * pModifyDist;
216 }
217 else
218 {
219 pResultHitPos = pPos1;
220 }
221 }
222 else
223 {
224 pResultHitPos = pResultHitPos + dir * pModifyDist;
225 }
226 result = true;
227 }
228 else
229 {
230 pResultHitPos = pPos2;
231 result = false;
232 }
233 return result;
234 }
#define ASSERT
Definition: Errors.h:68

References ASSERT, GetIntersectionTime(), and VMAP::Nothing.

◆ getTileFileName()

std::string VMAP::StaticMapTree::getTileFileName ( uint32  mapID,
uint32  tileX,
uint32  tileY 
)
static
93 {
94 std::stringstream tilefilename;
95 tilefilename.fill('0');
96 tilefilename << std::setw(3) << mapID << '_';
97 //tilefilename << std::setw(2) << tileX << '_' << std::setw(2) << tileY << ".vmtile";
98 tilefilename << std::setw(2) << tileY << '_' << std::setw(2) << tileX << ".vmtile";
99 return tilefilename.str();
100 }

Referenced by CanLoadMap(), LoadMapTile(), and UnloadMapTile().

◆ InitMap()

bool VMAP::StaticMapTree::InitMap ( const std::string &  fname,
VMapMgr2 vm 
)
301 {
302 //VMAP_DEBUG_LOG(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : initializing StaticMapTree '{}'", fname);
303 bool success = false;
304 std::string fullname = iBasePath + fname;
305 FILE* rf = fopen(fullname.c_str(), "rb");
306 if (!rf)
307 {
308 return false;
309 }
310
311 char chunk[8];
312 char tiled = '\0';
313
314 if (readChunk(rf, chunk, VMAP_MAGIC, 8) && fread(&tiled, sizeof(char), 1, rf) == 1 &&
315 readChunk(rf, chunk, "NODE", 4) && iTree.readFromFile(rf))
316 {
318 iTreeValues = new ModelInstance[iNTreeValues];
319 success = readChunk(rf, chunk, "GOBJ", 4);
320 }
321
322 iIsTiled = bool(tiled);
323
324 // global model spawns
325 // only non-tiled maps have them, and if so exactly one (so far at least...)
326 ModelSpawn spawn;
327#ifdef VMAP_DEBUG
328 //LOG_DEBUG(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : map isTiled: {}", static_cast<uint32>(iIsTiled));
329#endif
330 if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn))
331 {
332 WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name, spawn.flags);
333 //VMAP_DEBUG_LOG(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : loading {}", spawn.name);
334 if (model)
335 {
336 // assume that global model always is the first and only tree value (could be improved...)
337 iTreeValues[0] = ModelInstance(spawn, model);
338 iLoadedSpawns[0] = 1;
339 }
340 else
341 {
342 success = false;
343 //VMAP_ERROR_LOG(LOG_FILTER_GENERAL, "StaticMapTree::InitMap() : could not acquire WorldModel pointer for '{}'", spawn.name);
344 }
345 }
346
347 fclose(rf);
348 return success;
349 }
uint32 primCount() const
Definition: BoundingIntervalHierarchy.h:118
bool readFromFile(FILE *rf)
Definition: BoundingIntervalHierarchy.cpp:287
loadedSpawnMap iLoadedSpawns
Definition: MapTree.h:58
static bool readFromFile(FILE *rf, ModelSpawn &spawn)
Definition: ModelInstance.cpp:160

References VMAP::VMapMgr2::acquireModelInstance(), VMAP::ModelSpawn::flags, iBasePath, iIsTiled, iLoadedSpawns, iNTreeValues, iTree, iTreeValues, VMAP::ModelSpawn::name, BIH::primCount(), VMAP::readChunk(), BIH::readFromFile(), VMAP::ModelSpawn::readFromFile(), and VMAP::VMAP_MAGIC.

Referenced by VMAP::VMapMgr2::_loadMap().

◆ isInLineOfSight()

bool VMAP::StaticMapTree::isInLineOfSight ( const G3D::Vector3 &  pos1,
const G3D::Vector3 &  pos2,
ModelIgnoreFlags  ignoreFlags 
) const
161 {
162 float maxDist = (pos2 - pos1).magnitude();
163 // return false if distance is over max float, in case of cheater teleporting to the end of the universe
164 if (maxDist == std::numeric_limits<float>::max() || !std::isfinite(maxDist))
165 {
166 return false;
167 }
168
169 // valid map coords should *never ever* produce float overflow, but this would produce NaNs too
170 ASSERT(maxDist < std::numeric_limits<float>::max());
171 // prevent NaN values which can cause BIH intersection to enter infinite loop
172 if (maxDist < 1e-10f)
173 {
174 return true;
175 }
176 // direction with length of 1
177 G3D::Ray ray = G3D::Ray::fromOriginAndDirection(pos1, (pos2 - pos1) / maxDist);
178
179 if (GetIntersectionTime(ray, maxDist, true, ignoreFlags))
180 {
181
182 return false;
183 }
184
185 return true;
186 }

References ASSERT, and GetIntersectionTime().

◆ isTiled()

bool VMAP::StaticMapTree::isTiled ( ) const
inline
83{ return iIsTiled; }

References iIsTiled.

◆ LoadMapTile()

bool VMAP::StaticMapTree::LoadMapTile ( uint32  tileX,
uint32  tileY,
VMapMgr2 vm 
)
370 {
371 if (!iIsTiled)
372 {
373 // currently, core creates grids for all maps, whether it has terrain tiles or not
374 // so we need "fake" tile loads to know when we can unload map geometry
375 iLoadedTiles[packTileID(tileX, tileY)] = false;
376 return true;
377 }
378 if (!iTreeValues)
379 {
380 LOG_ERROR("maps", "StaticMapTree::LoadMapTile() : tree has not been initialized [{}, {}]", tileX, tileY);
381 return false;
382 }
383 bool result = true;
384
385 std::string tilefile = iBasePath + getTileFileName(iMapID, tileX, tileY);
386 FILE* tf = fopen(tilefile.c_str(), "rb");
387 if (tf)
388 {
389 char chunk[8];
390
391 if (!readChunk(tf, chunk, VMAP_MAGIC, 8))
392 {
393 result = false;
394 }
395 uint32 numSpawns = 0;
396 if (result && fread(&numSpawns, sizeof(uint32), 1, tf) != 1)
397 {
398 result = false;
399 }
400 for (uint32 i = 0; i < numSpawns && result; ++i)
401 {
402 // read model spawns
403 ModelSpawn spawn;
404 result = ModelSpawn::readFromFile(tf, spawn);
405 if (result)
406 {
407 // acquire model instance
408 WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name, spawn.flags);
409 if (!model)
410 {
411 LOG_ERROR("maps", "StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [{}, {}]", tileX, tileY);
412 }
413
414 // update tree
415 uint32 referencedVal;
416
417 if (fread(&referencedVal, sizeof(uint32), 1, tf) == 1)
418 {
419 if (!iLoadedSpawns.count(referencedVal))
420 {
421#if defined(VMAP_DEBUG)
422 if (referencedVal > iNTreeValues)
423 {
424 LOG_DEBUG("maps", "StaticMapTree::LoadMapTile() : invalid tree element ({}/{})", referencedVal, iNTreeValues);
425 continue;
426 }
427#endif
428 iTreeValues[referencedVal] = ModelInstance(spawn, model);
429 iLoadedSpawns[referencedVal] = 1;
430 }
431 else
432 {
433 ++iLoadedSpawns[referencedVal];
434#if defined(VMAP_DEBUG)
435 if (iTreeValues[referencedVal].ID != spawn.ID)
436 {
437 LOG_DEBUG("maps", "StaticMapTree::LoadMapTile() : trying to load wrong spawn in node");
438 }
439 else if (iTreeValues[referencedVal].name != spawn.name)
440 {
441 LOG_DEBUG("maps", "StaticMapTree::LoadMapTile() : name collision on GUID={}", spawn.ID);
442 }
443#endif
444 }
445 }
446 else
447 {
448 result = false;
449 }
450 }
451 }
452 iLoadedTiles[packTileID(tileX, tileY)] = true;
453 fclose(tf);
454 }
455 else
456 {
457 iLoadedTiles[packTileID(tileX, tileY)] = false;
458 }
459
460 METRIC_EVENT("map_events", "LoadMapTile",
461 "Map: " + std::to_string(iMapID) + " TileX: " + std::to_string(tileX) + " TileY: " + std::to_string(tileY));
462
463 return result;
464 }
std::uint32_t uint32
Definition: Define.h:108
#define LOG_ERROR(filterType__,...)
Definition: Log.h:159
#define LOG_DEBUG(filterType__,...)
Definition: Log.h:171
#define METRIC_EVENT(category, title, description)
Definition: Metric.h:187
static uint32 packTileID(uint32 tileX, uint32 tileY)
Definition: MapTree.h:66
loadedTileMap iLoadedTiles
Definition: MapTree.h:56
std::string name
Definition: ModelInstance.h:52
uint32 ID
Definition: ModelInstance.h:47

References VMAP::VMapMgr2::acquireModelInstance(), VMAP::ModelSpawn::flags, getTileFileName(), iBasePath, VMAP::ModelSpawn::ID, iIsTiled, iLoadedSpawns, iLoadedTiles, iMapID, iNTreeValues, iTreeValues, LOG_DEBUG, LOG_ERROR, METRIC_EVENT, VMAP::ModelSpawn::name, packTileID(), VMAP::readChunk(), VMAP::ModelSpawn::readFromFile(), and VMAP::VMAP_MAGIC.

Referenced by VMAP::VMapMgr2::_loadMap().

◆ numLoadedTiles()

uint32 VMAP::StaticMapTree::numLoadedTiles ( ) const
inline
84{ return iLoadedTiles.size(); }

References iLoadedTiles.

◆ packTileID()

static uint32 VMAP::StaticMapTree::packTileID ( uint32  tileX,
uint32  tileY 
)
inlinestatic

◆ UnloadMap()

void VMAP::StaticMapTree::UnloadMap ( VMapMgr2 vm)
354 {
355 for (loadedSpawnMap::iterator i = iLoadedSpawns.begin(); i != iLoadedSpawns.end(); ++i)
356 {
357 iTreeValues[i->first].setUnloaded();
358 for (uint32 refCount = 0; refCount < i->second; ++refCount)
359 {
360 vm->releaseModelInstance(iTreeValues[i->first].name);
361 }
362 }
363 iLoadedSpawns.clear();
364 iLoadedTiles.clear();
365 }
void setUnloaded()
Definition: ModelInstance.h:67

References iLoadedSpawns, iLoadedTiles, iTreeValues, VMAP::ModelSpawn::name, VMAP::VMapMgr2::releaseModelInstance(), and VMAP::ModelInstance::setUnloaded().

◆ UnloadMapTile()

void VMAP::StaticMapTree::UnloadMapTile ( uint32  tileX,
uint32  tileY,
VMapMgr2 vm 
)
469 {
470 uint32 tileID = packTileID(tileX, tileY);
471 loadedTileMap::iterator tile = iLoadedTiles.find(tileID);
472 if (tile == iLoadedTiles.end())
473 {
474 LOG_ERROR("maps", "StaticMapTree::UnloadMapTile() : trying to unload non-loaded tile - Map:{} X:{} Y:{}", iMapID, tileX, tileY);
475 return;
476 }
477 if (tile->second) // file associated with tile
478 {
479 std::string tilefile = iBasePath + getTileFileName(iMapID, tileX, tileY);
480 FILE* tf = fopen(tilefile.c_str(), "rb");
481 if (tf)
482 {
483 bool result = true;
484 char chunk[8];
485 if (!readChunk(tf, chunk, VMAP_MAGIC, 8))
486 {
487 result = false;
488 }
489 uint32 numSpawns;
490 if (fread(&numSpawns, sizeof(uint32), 1, tf) != 1)
491 {
492 result = false;
493 }
494 for (uint32 i = 0; i < numSpawns && result; ++i)
495 {
496 // read model spawns
497 ModelSpawn spawn;
498 result = ModelSpawn::readFromFile(tf, spawn);
499 if (result)
500 {
501 // release model instance
502 vm->releaseModelInstance(spawn.name);
503
504 // update tree
505 uint32 referencedNode;
506
507 if (fread(&referencedNode, sizeof(uint32), 1, tf) != 1)
508 {
509 result = false;
510 }
511 else
512 {
513 if (!iLoadedSpawns.count(referencedNode))
514 {
515 LOG_ERROR("maps", "StaticMapTree::UnloadMapTile() : trying to unload non-referenced model '{}' (ID:{})", spawn.name, spawn.ID);
516 }
517 else if (--iLoadedSpawns[referencedNode] == 0)
518 {
519 iTreeValues[referencedNode].setUnloaded();
520 iLoadedSpawns.erase(referencedNode);
521 }
522 }
523 }
524 }
525 fclose(tf);
526 }
527 }
528 iLoadedTiles.erase(tile);
529
530 METRIC_EVENT("map_events", "UnloadMapTile",
531 "Map: " + std::to_string(iMapID) + " TileX: " + std::to_string(tileX) + " TileY: " + std::to_string(tileY));
532 }

References getTileFileName(), iBasePath, VMAP::ModelSpawn::ID, iLoadedSpawns, iLoadedTiles, iMapID, iTreeValues, LOG_ERROR, METRIC_EVENT, VMAP::ModelSpawn::name, packTileID(), VMAP::readChunk(), VMAP::ModelSpawn::readFromFile(), VMAP::VMapMgr2::releaseModelInstance(), VMAP::ModelInstance::setUnloaded(), and VMAP::VMAP_MAGIC.

◆ unpackTileID()

static void VMAP::StaticMapTree::unpackTileID ( uint32  ID,
uint32 tileX,
uint32 tileY 
)
inlinestatic
67{ tileX = ID >> 16; tileY = ID & 0xFF; }

Referenced by MMAP::MapBuilder::buildMap(), MMAP::MapBuilder::buildNavMesh(), and VMAP::TileAssembler::convertWorld2().

Member Data Documentation

◆ iBasePath

std::string VMAP::StaticMapTree::iBasePath
private

◆ iIsTiled

bool VMAP::StaticMapTree::iIsTiled
private

Referenced by InitMap(), isTiled(), and LoadMapTile().

◆ iLoadedSpawns

loadedSpawnMap VMAP::StaticMapTree::iLoadedSpawns
private

◆ iLoadedTiles

loadedTileMap VMAP::StaticMapTree::iLoadedTiles
private

◆ iMapID

uint32 VMAP::StaticMapTree::iMapID
private

Referenced by LoadMapTile(), and UnloadMapTile().

◆ iNTreeValues

uint32 VMAP::StaticMapTree::iNTreeValues
private

◆ iTree

BIH VMAP::StaticMapTree::iTree
private

◆ iTreeValues