TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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. More...
 
bool isInLineOfSight (const G3D::Vector3 &pos1, const G3D::Vector3 &pos2) 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, VMapManager2 *vm)
 
void UnloadMap (VMapManager2 *vm)
 
bool LoadMapTile (uint32 tileX, uint32 tileY, VMapManager2 *vm)
 
void UnloadMapTile (uint32 tileX, uint32 tileY, VMapManager2 *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 bool 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, uint32
loadedSpawnMap
 

Private Member Functions

bool getIntersectionTime (const G3D::Ray &pRay, float &pMaxDist, bool pStopAtFirstHit) const
 
 StaticMapTree (StaticMapTree const &right)=delete
 
StaticMapTreeoperator= (StaticMapTree const &right)=delete
 

Private Attributes

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

Member Typedef Documentation

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

Constructor & Destructor Documentation

VMAP::StaticMapTree::StaticMapTree ( uint32  mapID,
const std::string &  basePath 
)
122  :
123  iMapID(mapID), iIsTiled(false), iTreeValues(NULL),
124  iNTreeValues(0), iBasePath(basePath)
125  {
126  if (iBasePath.length() > 0 && iBasePath[iBasePath.length()-1] != '/' && iBasePath[iBasePath.length()-1] != '\\')
127  {
128  iBasePath.push_back('/');
129  }
130  }
arena_t NULL
Definition: jemalloc_internal.h:624
uint32 iMapID
Definition: MapTree.h:45
ModelInstance * iTreeValues
Definition: MapTree.h:48
uint32 iNTreeValues
Definition: MapTree.h:49
bool iIsTiled
Definition: MapTree.h:46
std::string iBasePath
Definition: MapTree.h:57
VMAP::StaticMapTree::~StaticMapTree ( )

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

135  {
136  delete[] iTreeValues;
137  }
ModelInstance * iTreeValues
Definition: MapTree.h:48
VMAP::StaticMapTree::StaticMapTree ( StaticMapTree const right)
privatedelete

Member Function Documentation

bool VMAP::StaticMapTree::CanLoadMap ( const std::string &  basePath,
uint32  mapID,
uint32  tileX,
uint32  tileY 
)
static
Todo:
check magic number when implemented...
242  {
243  std::string basePath = vmapPath;
244  if (basePath.length() > 0 && basePath[basePath.length()-1] != '/' && basePath[basePath.length()-1] != '\\')
245  basePath.push_back('/');
246  std::string fullname = basePath + VMapManager2::getMapFileName(mapID);
247  bool success = true;
248  FILE* rf = fopen(fullname.c_str(), "rb");
249  if (!rf)
250  return false;
252  char tiled;
253  char chunk[8];
254  if (!readChunk(rf, chunk, VMAP_MAGIC, 8) || fread(&tiled, sizeof(char), 1, rf) != 1)
255  {
256  fclose(rf);
257  return false;
258  }
259  if (tiled)
260  {
261  std::string tilefile = basePath + getTileFileName(mapID, tileX, tileY);
262  FILE* tf = fopen(tilefile.c_str(), "rb");
263  if (!tf)
264  success = false;
265  else
266  {
267  if (!readChunk(tf, chunk, VMAP_MAGIC, 8))
268  success = false;
269  fclose(tf);
270  }
271  }
272  fclose(rf);
273  return success;
274  }
Definition: adtfile.h:57
static std::string getMapFileName(unsigned int mapId)
Definition: VMapManager2.cpp:76
bool readChunk(FILE *rf, char *dest, const char *compare, uint32 len)
Definition: TileAssembler.cpp:40
const char VMAP_MAGIC[]
Definition: VMapDefinitions.h:28
static std::string getTileFileName(uint32 mapID, uint32 tileX, uint32 tileY)
Definition: MapTree.cpp:89

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool VMAP::StaticMapTree::getAreaInfo ( G3D::Vector3 pos,
uint32 flags,
int32 adtId,
int32 rootId,
int32 groupId 
) const
100  {
101  AreaInfoCallback intersectionCallBack(iTreeValues);
102  iTree.intersectPoint(pos, intersectionCallBack);
103  if (intersectionCallBack.aInfo.result)
104  {
105  flags = intersectionCallBack.aInfo.flags;
106  adtId = intersectionCallBack.aInfo.adtId;
107  rootId = intersectionCallBack.aInfo.rootId;
108  groupId = intersectionCallBack.aInfo.groupId;
109  pos.z = intersectionCallBack.aInfo.ground_Z;
110  return true;
111  }
112  return false;
113  }
ModelInstance * iTreeValues
Definition: MapTree.h:48
BIH iTree
Definition: MapTree.h:47
float z
Definition: Vector3.h:62
void intersectPoint(const G3D::Vector3 &p, IsectCallback &intersectCallback) const
Definition: BoundingIntervalHierarchy.h:260
uint8 flags
Definition: DisableMgr.cpp:44

+ Here is the call graph for this function:

float VMAP::StaticMapTree::getHeight ( const G3D::Vector3 pPos,
float  maxSearchDist 
) const
227  {
228  float height = G3D::finf();
229  Vector3 dir = Vector3(0, 0, -1);
230  G3D::Ray ray(pPos, dir); // direction with length of 1
231  float maxDist = maxSearchDist;
232  if (getIntersectionTime(ray, maxDist, false))
233  {
234  height = pPos.z - maxDist;
235  }
236  return(height);
237  }
float finf()
Definition: g3dmath.cpp:71
Definition: Vector3.h:58
Definition: Ray.h:24
float z
Definition: Vector3.h:62
bool getIntersectionTime(const G3D::Ray &pRay, float &pMaxDist, bool pStopAtFirstHit) const
Definition: MapTree.cpp:145

+ Here is the call graph for this function:

bool VMAP::StaticMapTree::getIntersectionTime ( const G3D::Ray pRay,
float &  pMaxDist,
bool  pStopAtFirstHit 
) const
private

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

146  {
147  float distance = pMaxDist;
148  MapRayCallback intersectionCallBack(iTreeValues);
149  iTree.intersectRay(pRay, intersectionCallBack, distance, pStopAtFirstHit);
150  if (intersectionCallBack.didHit())
151  pMaxDist = distance;
152  return intersectionCallBack.didHit();
153  }
double distance(double x, double y)
Definition: g3dmath.h:731
ModelInstance * iTreeValues
Definition: MapTree.h:48
BIH iTree
Definition: MapTree.h:47
void intersectRay(const G3D::Ray &r, RayCallback &intersectCallback, float &maxDist, bool stopAtFirst=false) const
Definition: BoundingIntervalHierarchy.h:121

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool VMAP::StaticMapTree::GetLocationInfo ( const G3D::Vector3 pos,
LocationInfo info 
) const
116  {
117  LocationInfoCallback intersectionCallBack(iTreeValues, info);
118  iTree.intersectPoint(pos, intersectionCallBack);
119  return intersectionCallBack.result;
120  }
ModelInstance * iTreeValues
Definition: MapTree.h:48
BIH iTree
Definition: MapTree.h:47
void intersectPoint(const G3D::Vector3 &p, IsectCallback &intersectCallback) const
Definition: BoundingIntervalHierarchy.h:260

+ Here is the call graph for this function:

void VMAP::StaticMapTree::getModelInstances ( ModelInstance *&  models,
uint32 count 
)
479  {
480  models = iTreeValues;
481  count = iNTreeValues;
482  }
ModelInstance * iTreeValues
Definition: MapTree.h:48
uint32 iNTreeValues
Definition: MapTree.h:49
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

182  {
183  bool result=false;
184  float maxDist = (pPos2 - pPos1).magnitude();
185  // valid map coords should *never ever* produce float overflow, but this would produce NaNs too
187  // prevent NaN values which can cause BIH intersection to enter infinite loop
188  if (maxDist < 1e-10f)
189  {
190  pResultHitPos = pPos2;
191  return false;
192  }
193  Vector3 dir = (pPos2 - pPos1)/maxDist; // direction with length of 1
194  G3D::Ray ray(pPos1, dir);
195  float dist = maxDist;
196  if (getIntersectionTime(ray, dist, false))
197  {
198  pResultHitPos = pPos1 + dir * dist;
199  if (pModifyDist < 0)
200  {
201  if ((pResultHitPos - pPos1).magnitude() > -pModifyDist)
202  {
203  pResultHitPos = pResultHitPos + dir*pModifyDist;
204  }
205  else
206  {
207  pResultHitPos = pPos1;
208  }
209  }
210  else
211  {
212  pResultHitPos = pResultHitPos + dir*pModifyDist;
213  }
214  result = true;
215  }
216  else
217  {
218  pResultHitPos = pPos2;
219  result = false;
220  }
221  return result;
222  }
T max(const T &x, const T &y)
Definition: g3dmath.h:320
Definition: Vector3.h:58
Definition: Ray.h:24
bool getIntersectionTime(const G3D::Ray &pRay, float &pMaxDist, bool pStopAtFirstHit) const
Definition: MapTree.cpp:145
#define ASSERT
Definition: Errors.h:55

+ Here is the call graph for this function:

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

+ Here is the caller graph for this function:

bool VMAP::StaticMapTree::InitMap ( const std::string &  fname,
VMapManager2 vm 
)
279  {
280  VMAP_DEBUG_LOG("maps", "StaticMapTree::InitMap() : initializing StaticMapTree '%s'", fname.c_str());
281  bool success = false;
282  std::string fullname = iBasePath + fname;
283  FILE* rf = fopen(fullname.c_str(), "rb");
284  if (!rf)
285  return false;
286 
287  char chunk[8];
288  char tiled = '\0';
289 
290  if (readChunk(rf, chunk, VMAP_MAGIC, 8) && fread(&tiled, sizeof(char), 1, rf) == 1 &&
291  readChunk(rf, chunk, "NODE", 4) && iTree.readFromFile(rf))
292  {
295  success = readChunk(rf, chunk, "GOBJ", 4);
296  }
297 
298  iIsTiled = tiled != '\0';
299 
300  // global model spawns
301  // only non-tiled maps have them, and if so exactly one (so far at least...)
302  ModelSpawn spawn;
303 #ifdef VMAP_DEBUG
304  TC_LOG_DEBUG("maps", "StaticMapTree::InitMap() : map isTiled: %u", static_cast<uint32>(iIsTiled));
305 #endif
306  if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn))
307  {
308  WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name);
309  VMAP_DEBUG_LOG("maps", "StaticMapTree::InitMap() : loading %s", spawn.name.c_str());
310  if (model)
311  {
312  // assume that global model always is the first and only tree value (could be improved...)
313  iTreeValues[0] = ModelInstance(spawn, model);
314  iLoadedSpawns[0] = 1;
315  }
316  else
317  {
318  success = false;
319  VMAP_ERROR_LOG("misc", "StaticMapTree::InitMap() : could not acquire WorldModel pointer for '%s'", spawn.name.c_str());
320  }
321  }
322 
323  fclose(rf);
324  return success;
325  }
static bool readFromFile(FILE *rf, ModelSpawn &spawn)
Definition: ModelInstance.cpp:154
Definition: model.h:53
uint32 primCount() const
Definition: BoundingIntervalHierarchy.h:118
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: adtfile.h:57
bool readChunk(FILE *rf, char *dest, const char *compare, uint32 len)
Definition: TileAssembler.cpp:40
loadedSpawnMap iLoadedSpawns
Definition: MapTree.h:56
#define VMAP_DEBUG_LOG(FILTER,...)
Definition: VMapDefinitions.h:39
ModelInstance * iTreeValues
Definition: MapTree.h:48
uint32 iNTreeValues
Definition: MapTree.h:49
bool readFromFile(FILE *rf)
Definition: BoundingIntervalHierarchy.cpp:261
BIH iTree
Definition: MapTree.h:47
bool iIsTiled
Definition: MapTree.h:46
#define VMAP_ERROR_LOG(FILTER,...)
Definition: VMapDefinitions.h:38
const char VMAP_MAGIC[]
Definition: VMapDefinitions.h:28
std::string iBasePath
Definition: MapTree.h:57

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool VMAP::StaticMapTree::isInLineOfSight ( const G3D::Vector3 pos1,
const G3D::Vector3 pos2 
) const
157  {
158  float maxDist = (pos2 - pos1).magnitude();
159  // return false if distance is over max float, in case of cheater teleporting to the end of the universe
160  if (maxDist == std::numeric_limits<float>::max() || !std::isfinite(maxDist))
161  return false;
162 
163  // valid map coords should *never ever* produce float overflow, but this would produce NaNs too
165  // prevent NaN values which can cause BIH intersection to enter infinite loop
166  if (maxDist < 1e-10f)
167  return true;
168  // direction with length of 1
169  G3D::Ray ray = G3D::Ray::fromOriginAndDirection(pos1, (pos2 - pos1)/maxDist);
170  if (getIntersectionTime(ray, maxDist, true))
171  return false;
172 
173  return true;
174  }
T max(const T &x, const T &y)
Definition: g3dmath.h:320
static Ray fromOriginAndDirection(const Point3 &point, const Vector3 &direction)
Definition: Ray.h:87
Definition: Ray.h:24
bool getIntersectionTime(const G3D::Ray &pRay, float &pMaxDist, bool pStopAtFirstHit) const
Definition: MapTree.cpp:145
#define ASSERT
Definition: Errors.h:55

+ Here is the call graph for this function:

bool VMAP::StaticMapTree::isTiled ( ) const
inline
81 { return iIsTiled; }
bool iIsTiled
Definition: MapTree.h:46
bool VMAP::StaticMapTree::LoadMapTile ( uint32  tileX,
uint32  tileY,
VMapManager2 vm 
)
344  {
345  if (!iIsTiled)
346  {
347  // currently, core creates grids for all maps, whether it has terrain tiles or not
348  // so we need "fake" tile loads to know when we can unload map geometry
349  iLoadedTiles[packTileID(tileX, tileY)] = false;
350  return true;
351  }
352  if (!iTreeValues)
353  {
354  VMAP_ERROR_LOG("misc", "StaticMapTree::LoadMapTile() : tree has not been initialized [%u, %u]", tileX, tileY);
355  return false;
356  }
357  bool result = true;
358 
359  std::string tilefile = iBasePath + getTileFileName(iMapID, tileX, tileY);
360  FILE* tf = fopen(tilefile.c_str(), "rb");
361  if (tf)
362  {
363  char chunk[8];
364 
365  if (!readChunk(tf, chunk, VMAP_MAGIC, 8))
366  result = false;
367  uint32 numSpawns = 0;
368  if (result && fread(&numSpawns, sizeof(uint32), 1, tf) != 1)
369  result = false;
370  for (uint32 i=0; i<numSpawns && result; ++i)
371  {
372  // read model spawns
373  ModelSpawn spawn;
374  result = ModelSpawn::readFromFile(tf, spawn);
375  if (result)
376  {
377  // acquire model instance
378  WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name);
379  if (!model)
380  VMAP_ERROR_LOG("misc", "StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u, %u]", tileX, tileY);
381 
382  // update tree
383  uint32 referencedVal;
384 
385  if (fread(&referencedVal, sizeof(uint32), 1, tf) == 1)
386  {
387  if (!iLoadedSpawns.count(referencedVal))
388  {
389  if (referencedVal > iNTreeValues)
390  {
391  VMAP_ERROR_LOG("maps", "StaticMapTree::LoadMapTile() : invalid tree element (%u/%u) referenced in tile %s", referencedVal, iNTreeValues, tilefile.c_str());
392  continue;
393  }
394 
395  iTreeValues[referencedVal] = ModelInstance(spawn, model);
396  iLoadedSpawns[referencedVal] = 1;
397  }
398  else
399  {
400  ++iLoadedSpawns[referencedVal];
401 #ifdef VMAP_DEBUG
402  if (iTreeValues[referencedVal].ID != spawn.ID)
403  TC_LOG_DEBUG("maps", "StaticMapTree::LoadMapTile() : trying to load wrong spawn in node");
404  else if (iTreeValues[referencedVal].name != spawn.name)
405  TC_LOG_DEBUG("maps", "StaticMapTree::LoadMapTile() : name collision on GUID=%u", spawn.ID);
406 #endif
407  }
408  }
409  else
410  result = false;
411  }
412  }
413  iLoadedTiles[packTileID(tileX, tileY)] = true;
414  fclose(tf);
415  }
416  else
417  iLoadedTiles[packTileID(tileX, tileY)] = false;
418  return result;
419  }
static uint32 packTileID(uint32 tileX, uint32 tileY)
Definition: MapTree.h:64
static bool readFromFile(FILE *rf, ModelSpawn &spawn)
Definition: ModelInstance.cpp:154
Definition: model.h:53
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
uint32 iMapID
Definition: MapTree.h:45
Definition: adtfile.h:57
bool readChunk(FILE *rf, char *dest, const char *compare, uint32 len)
Definition: TileAssembler.cpp:40
loadedSpawnMap iLoadedSpawns
Definition: MapTree.h:56
ModelInstance * iTreeValues
Definition: MapTree.h:48
uint32 iNTreeValues
Definition: MapTree.h:49
uint32_t uint32
Definition: Define.h:150
uint32 ID
Definition: ModelInstance.h:48
bool iIsTiled
Definition: MapTree.h:46
#define VMAP_ERROR_LOG(FILTER,...)
Definition: VMapDefinitions.h:38
std::string name
Definition: ModelInstance.h:53
loadedTileMap iLoadedTiles
Definition: MapTree.h:54
const char VMAP_MAGIC[]
Definition: VMapDefinitions.h:28
static std::string getTileFileName(uint32 mapID, uint32 tileX, uint32 tileY)
Definition: MapTree.cpp:89
std::string iBasePath
Definition: MapTree.h:57

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32 VMAP::StaticMapTree::numLoadedTiles ( ) const
inline
82 { return uint32(iLoadedTiles.size()); }
loadedTileMap iLoadedTiles
Definition: MapTree.h:54
uint32_t uint32
Definition: g3dmath.h:168
StaticMapTree& VMAP::StaticMapTree::operator= ( StaticMapTree const right)
privatedelete
static uint32 VMAP::StaticMapTree::packTileID ( uint32  tileX,
uint32  tileY 
)
inlinestatic
64 { return tileX<<16 | tileY; }

+ Here is the caller graph for this function:

void VMAP::StaticMapTree::UnloadMap ( VMapManager2 vm)
330  {
331  for (loadedSpawnMap::iterator i = iLoadedSpawns.begin(); i != iLoadedSpawns.end(); ++i)
332  {
333  iTreeValues[i->first].setUnloaded();
334  for (uint32 refCount = 0; refCount < i->second; ++refCount)
335  vm->releaseModelInstance(iTreeValues[i->first].name);
336  }
337  iLoadedSpawns.clear();
338  iLoadedTiles.clear();
339  }
void setUnloaded()
Definition: ModelInstance.h:68
loadedSpawnMap iLoadedSpawns
Definition: MapTree.h:56
ModelInstance * iTreeValues
Definition: MapTree.h:48
uint32_t uint32
Definition: Define.h:150
std::string name
Definition: ModelInstance.h:53
loadedTileMap iLoadedTiles
Definition: MapTree.h:54

+ Here is the call graph for this function:

void VMAP::StaticMapTree::UnloadMapTile ( uint32  tileX,
uint32  tileY,
VMapManager2 vm 
)
424  {
425  uint32 tileID = packTileID(tileX, tileY);
426  loadedTileMap::iterator tile = iLoadedTiles.find(tileID);
427  if (tile == iLoadedTiles.end())
428  {
429  VMAP_ERROR_LOG("misc", "StaticMapTree::UnloadMapTile() : trying to unload non-loaded tile - Map:%u X:%u Y:%u", iMapID, tileX, tileY);
430  return;
431  }
432  if (tile->second) // file associated with tile
433  {
434  std::string tilefile = iBasePath + getTileFileName(iMapID, tileX, tileY);
435  FILE* tf = fopen(tilefile.c_str(), "rb");
436  if (tf)
437  {
438  bool result=true;
439  char chunk[8];
440  if (!readChunk(tf, chunk, VMAP_MAGIC, 8))
441  result = false;
442  uint32 numSpawns;
443  if (fread(&numSpawns, sizeof(uint32), 1, tf) != 1)
444  result = false;
445  for (uint32 i=0; i<numSpawns && result; ++i)
446  {
447  // read model spawns
448  ModelSpawn spawn;
449  result = ModelSpawn::readFromFile(tf, spawn);
450  if (result)
451  {
452  // release model instance
453  vm->releaseModelInstance(spawn.name);
454 
455  // update tree
456  uint32 referencedNode;
457 
458  if (fread(&referencedNode, sizeof(uint32), 1, tf) != 1)
459  result = false;
460  else
461  {
462  if (!iLoadedSpawns.count(referencedNode))
463  VMAP_ERROR_LOG("misc", "StaticMapTree::UnloadMapTile() : trying to unload non-referenced model '%s' (ID:%u)", spawn.name.c_str(), spawn.ID);
464  else if (--iLoadedSpawns[referencedNode] == 0)
465  {
466  iTreeValues[referencedNode].setUnloaded();
467  iLoadedSpawns.erase(referencedNode);
468  }
469  }
470  }
471  }
472  fclose(tf);
473  }
474  }
475  iLoadedTiles.erase(tile);
476  }
static uint32 packTileID(uint32 tileX, uint32 tileY)
Definition: MapTree.h:64
static bool readFromFile(FILE *rf, ModelSpawn &spawn)
Definition: ModelInstance.cpp:154
uint32 iMapID
Definition: MapTree.h:45
Definition: adtfile.h:57
void setUnloaded()
Definition: ModelInstance.h:68
bool readChunk(FILE *rf, char *dest, const char *compare, uint32 len)
Definition: TileAssembler.cpp:40
loadedSpawnMap iLoadedSpawns
Definition: MapTree.h:56
ModelInstance * iTreeValues
Definition: MapTree.h:48
uint32_t uint32
Definition: Define.h:150
#define VMAP_ERROR_LOG(FILTER,...)
Definition: VMapDefinitions.h:38
loadedTileMap iLoadedTiles
Definition: MapTree.h:54
const char VMAP_MAGIC[]
Definition: VMapDefinitions.h:28
static std::string getTileFileName(uint32 mapID, uint32 tileX, uint32 tileY)
Definition: MapTree.cpp:89
std::string iBasePath
Definition: MapTree.h:57

+ Here is the call graph for this function:

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

+ Here is the caller graph for this function:

Member Data Documentation

std::string VMAP::StaticMapTree::iBasePath
private
bool VMAP::StaticMapTree::iIsTiled
private
loadedSpawnMap VMAP::StaticMapTree::iLoadedSpawns
private
loadedTileMap VMAP::StaticMapTree::iLoadedTiles
private
uint32 VMAP::StaticMapTree::iMapID
private
uint32 VMAP::StaticMapTree::iNTreeValues
private
BIH VMAP::StaticMapTree::iTree
private
ModelInstance* VMAP::StaticMapTree::iTreeValues
private

The documentation for this class was generated from the following files: