354 VMAP_ERROR_LOG(
"misc",
"StaticMapTree::LoadMapTile() : tree has not been initialized [%u, %u]", tileX, tileY);
360 FILE* tf = fopen(tilefile.c_str(),
"rb");
368 if (result && fread(&numSpawns,
sizeof(
uint32), 1, tf) != 1)
370 for (
uint32 i=0; i<numSpawns && result; ++i)
378 WorldModel* model = vm->acquireModelInstance(
iBasePath, spawn.name);
380 VMAP_ERROR_LOG(
"misc",
"StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u, %u]", tileX, tileY);
385 if (fread(&referencedVal,
sizeof(
uint32), 1, tf) == 1)
391 VMAP_ERROR_LOG(
"maps",
"StaticMapTree::LoadMapTile() : invalid tree element (%u/%u) referenced in tile %s", referencedVal,
iNTreeValues, tilefile.c_str());
403 TC_LOG_DEBUG(
"maps",
"StaticMapTree::LoadMapTile() : trying to load wrong spawn in node");
405 TC_LOG_DEBUG(
"maps",
"StaticMapTree::LoadMapTile() : name collision on GUID=%u", spawn.ID);
static uint32 packTileID(uint32 tileX, uint32 tileY)
Definition: MapTree.h:64
static bool readFromFile(FILE *rf, ModelSpawn &spawn)
Definition: ModelInstance.cpp:154
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
uint32 iMapID
Definition: MapTree.h:45
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