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
248 {
249 std::string basePath = vmapPath;
250 if (basePath.length() > 0 && basePath[basePath.length() - 1] != '/' && basePath[basePath.length() - 1] != '\\')
251 {
252 basePath.push_back('/');
253 }
254 std::string fullname = basePath + VMapMgr2::getMapFileName(mapID);
255
257
258 FILE* rf = fopen(fullname.c_str(), "rb");
259 if (!rf)
260 {
262 }
263
264 char tiled;
265 char chunk[8];
266 if (!readChunk(rf, chunk, VMAP_MAGIC, 8) || fread(&tiled, sizeof(char), 1, rf) != 1)
267 {
268 fclose(rf);
270 }
271 if (tiled)
272 {
273 std::string tilefile = basePath + getTileFileName(mapID, tileX, tileY);
274 FILE* tf = fopen(tilefile.c_str(), "rb");
275 if (!tf)
276 {
278 }
279 else
280 {
281 if (!readChunk(tf, chunk, VMAP_MAGIC, 8))
282 {
284 }
285 fclose(tf);
286 }
287 }
288 fclose(rf);
289 return result;
290 }
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
233 {
234 float height = G3D::finf();
235 Vector3 dir = Vector3(0, 0, -1);
236 G3D::Ray ray(pPos, dir); // direction with length of 1
237 float maxDist = maxSearchDist;
238 if (GetIntersectionTime(ray, maxDist, false, ModelIgnoreFlags::Nothing))
239 {
240 height = pPos.z - maxDist;
241 }
242 return (height);
243 }
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 
)
529 {
530 models = iTreeValues;
531 count = iNTreeValues;
532 }
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

188 {
189 bool result = false;
190 float maxDist = (pPos2 - pPos1).magnitude();
191 // valid map coords should *never ever* produce float overflow, but this would produce NaNs too
192 ASSERT(maxDist < std::numeric_limits<float>::max());
193 // prevent NaN values which can cause BIH intersection to enter infinite loop
194 if (maxDist < 1e-10f)
195 {
196 pResultHitPos = pPos2;
197 return false;
198 }
199 Vector3 dir = (pPos2 - pPos1) / maxDist; // direction with length of 1
200 G3D::Ray ray(pPos1, dir);
201 float dist = maxDist;
202 if (GetIntersectionTime(ray, dist, false, ModelIgnoreFlags::Nothing))
203 {
204 pResultHitPos = pPos1 + dir * dist;
205 if (pModifyDist < 0)
206 {
207 if ((pResultHitPos - pPos1).magnitude() > -pModifyDist)
208 {
209 pResultHitPos = pResultHitPos + dir * pModifyDist;
210 }
211 else
212 {
213 pResultHitPos = pPos1;
214 }
215 }
216 else
217 {
218 pResultHitPos = pResultHitPos + dir * pModifyDist;
219 }
220 result = true;
221 }
222 else
223 {
224 pResultHitPos = pPos2;
225 result = false;
226 }
227 return result;
228 }
#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 
)
295 {
296 //VMAP_DEBUG_LOG(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : initializing StaticMapTree '{}'", fname);
297 bool success = false;
298 std::string fullname = iBasePath + fname;
299 FILE* rf = fopen(fullname.c_str(), "rb");
300 if (!rf)
301 {
302 return false;
303 }
304
305 char chunk[8];
306 char tiled = '\0';
307
308 if (readChunk(rf, chunk, VMAP_MAGIC, 8) && fread(&tiled, sizeof(char), 1, rf) == 1 &&
309 readChunk(rf, chunk, "NODE", 4) && iTree.readFromFile(rf))
310 {
312 iTreeValues = new ModelInstance[iNTreeValues];
313 success = readChunk(rf, chunk, "GOBJ", 4);
314 }
315
316 iIsTiled = bool(tiled);
317
318 // global model spawns
319 // only non-tiled maps have them, and if so exactly one (so far at least...)
320 ModelSpawn spawn;
321#ifdef VMAP_DEBUG
322 //LOG_DEBUG(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : map isTiled: {}", static_cast<uint32>(iIsTiled));
323#endif
324 if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn))
325 {
326 WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name, spawn.flags);
327 //VMAP_DEBUG_LOG(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : loading {}", spawn.name);
328 if (model)
329 {
330 // assume that global model always is the first and only tree value (could be improved...)
331 iTreeValues[0] = ModelInstance(spawn, model);
332 iLoadedSpawns[0] = 1;
333 }
334 else
335 {
336 success = false;
337 //VMAP_ERROR_LOG(LOG_FILTER_GENERAL, "StaticMapTree::InitMap() : could not acquire WorldModel pointer for '{}'", spawn.name);
338 }
339 }
340
341 fclose(rf);
342 return success;
343 }
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 return !GetIntersectionTime(ray, maxDist, true, ignoreFlags);
180 }

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 
)
364 {
365 if (!iIsTiled)
366 {
367 // currently, core creates grids for all maps, whether it has terrain tiles or not
368 // so we need "fake" tile loads to know when we can unload map geometry
369 iLoadedTiles[packTileID(tileX, tileY)] = false;
370 return true;
371 }
372 if (!iTreeValues)
373 {
374 LOG_ERROR("maps", "StaticMapTree::LoadMapTile() : tree has not been initialized [{}, {}]", tileX, tileY);
375 return false;
376 }
377 bool result = true;
378
379 std::string tilefile = iBasePath + getTileFileName(iMapID, tileX, tileY);
380 FILE* tf = fopen(tilefile.c_str(), "rb");
381 if (tf)
382 {
383 char chunk[8];
384
385 if (!readChunk(tf, chunk, VMAP_MAGIC, 8))
386 {
387 result = false;
388 }
389 uint32 numSpawns = 0;
390 if (result && fread(&numSpawns, sizeof(uint32), 1, tf) != 1)
391 {
392 result = false;
393 }
394 for (uint32 i = 0; i < numSpawns && result; ++i)
395 {
396 // read model spawns
397 ModelSpawn spawn;
398 result = ModelSpawn::readFromFile(tf, spawn);
399 if (result)
400 {
401 // acquire model instance
402 WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name, spawn.flags);
403 if (!model)
404 {
405 LOG_ERROR("maps", "StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [{}, {}]", tileX, tileY);
406 }
407
408 // update tree
409 uint32 referencedVal;
410
411 if (fread(&referencedVal, sizeof(uint32), 1, tf) == 1)
412 {
413 if (!iLoadedSpawns.count(referencedVal))
414 {
415#if defined(VMAP_DEBUG)
416 if (referencedVal > iNTreeValues)
417 {
418 LOG_DEBUG("maps", "StaticMapTree::LoadMapTile() : invalid tree element ({}/{})", referencedVal, iNTreeValues);
419 continue;
420 }
421#endif
422 iTreeValues[referencedVal] = ModelInstance(spawn, model);
423 iLoadedSpawns[referencedVal] = 1;
424 }
425 else
426 {
427 ++iLoadedSpawns[referencedVal];
428#if defined(VMAP_DEBUG)
429 if (iTreeValues[referencedVal].ID != spawn.ID)
430 {
431 LOG_DEBUG("maps", "StaticMapTree::LoadMapTile() : trying to load wrong spawn in node");
432 }
433 else if (iTreeValues[referencedVal].name != spawn.name)
434 {
435 LOG_DEBUG("maps", "StaticMapTree::LoadMapTile() : name collision on GUID={}", spawn.ID);
436 }
437#endif
438 }
439 }
440 else
441 {
442 result = false;
443 }
444 }
445 }
446 iLoadedTiles[packTileID(tileX, tileY)] = true;
447 fclose(tf);
448 }
449 else
450 {
451 iLoadedTiles[packTileID(tileX, tileY)] = false;
452 }
453
454 METRIC_EVENT("map_events", "LoadMapTile",
455 "Map: " + std::to_string(iMapID) + " TileX: " + std::to_string(tileX) + " TileY: " + std::to_string(tileY));
456
457 return result;
458 }
std::uint32_t uint32
Definition: Define.h:108
#define LOG_ERROR(filterType__,...)
Definition: Log.h:157
#define LOG_DEBUG(filterType__,...)
Definition: Log.h:169
#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)
348 {
349 for (loadedSpawnMap::iterator i = iLoadedSpawns.begin(); i != iLoadedSpawns.end(); ++i)
350 {
351 iTreeValues[i->first].setUnloaded();
352 for (uint32 refCount = 0; refCount < i->second; ++refCount)
353 {
354 vm->releaseModelInstance(iTreeValues[i->first].name);
355 }
356 }
357 iLoadedSpawns.clear();
358 iLoadedTiles.clear();
359 }
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 
)
463 {
464 uint32 tileID = packTileID(tileX, tileY);
465 loadedTileMap::iterator tile = iLoadedTiles.find(tileID);
466 if (tile == iLoadedTiles.end())
467 {
468 LOG_ERROR("maps", "StaticMapTree::UnloadMapTile() : trying to unload non-loaded tile - Map:{} X:{} Y:{}", iMapID, tileX, tileY);
469 return;
470 }
471 if (tile->second) // file associated with tile
472 {
473 std::string tilefile = iBasePath + getTileFileName(iMapID, tileX, tileY);
474 FILE* tf = fopen(tilefile.c_str(), "rb");
475 if (tf)
476 {
477 bool result = true;
478 char chunk[8];
479 if (!readChunk(tf, chunk, VMAP_MAGIC, 8))
480 {
481 result = false;
482 }
483 uint32 numSpawns;
484 if (fread(&numSpawns, sizeof(uint32), 1, tf) != 1)
485 {
486 result = false;
487 }
488 for (uint32 i = 0; i < numSpawns && result; ++i)
489 {
490 // read model spawns
491 ModelSpawn spawn;
492 result = ModelSpawn::readFromFile(tf, spawn);
493 if (result)
494 {
495 // release model instance
496 vm->releaseModelInstance(spawn.name);
497
498 // update tree
499 uint32 referencedNode;
500
501 if (fread(&referencedNode, sizeof(uint32), 1, tf) != 1)
502 {
503 result = false;
504 }
505 else
506 {
507 if (!iLoadedSpawns.count(referencedNode))
508 {
509 LOG_ERROR("maps", "StaticMapTree::UnloadMapTile() : trying to unload non-referenced model '{}' (ID:{})", spawn.name, spawn.ID);
510 }
511 else if (--iLoadedSpawns[referencedNode] == 0)
512 {
513 iTreeValues[referencedNode].setUnloaded();
514 iLoadedSpawns.erase(referencedNode);
515 }
516 }
517 }
518 }
519 fclose(tf);
520 }
521 }
522 iLoadedTiles.erase(tile);
523
524 METRIC_EVENT("map_events", "UnloadMapTile",
525 "Map: " + std::to_string(iMapID) + " TileX: " + std::to_string(tileX) + " TileY: " + std::to_string(tileY));
526 }

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