diff options
author | Shauren <shauren.trinity@gmail.com> | 2018-04-02 20:05:08 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2018-04-02 20:05:08 +0200 |
commit | b095c4cd30c4c386e9f4c0532b4234b44fb8dcea (patch) | |
tree | 08913ff4ff11553b989360b344af47df8463dda7 | |
parent | e74ca891ceccbd7154a8e739075725d4d99718bb (diff) |
Core/Misc: Removed obsolete NO_CORE_FUNCS
-rw-r--r-- | cmake/showoptions.cmake | 1 | ||||
-rw-r--r-- | src/common/Collision/Management/VMapManager2.cpp | 8 | ||||
-rw-r--r-- | src/common/Collision/Maps/MapTree.cpp | 16 | ||||
-rw-r--r-- | src/common/Collision/Models/GameObjectModel.cpp | 14 | ||||
-rw-r--r-- | src/common/Collision/VMapDefinitions.h | 11 |
5 files changed, 18 insertions, 32 deletions
diff --git a/cmake/showoptions.cmake b/cmake/showoptions.cmake index 6c060295ee0..069b90b544f 100644 --- a/cmake/showoptions.cmake +++ b/cmake/showoptions.cmake @@ -31,7 +31,6 @@ endif() if( TOOLS ) message("* Build map/vmap tools : Yes (default)") - add_definitions(-DNO_CORE_FUNCS) else() message("* Build map/vmap tools : No") endif() diff --git a/src/common/Collision/Management/VMapManager2.cpp b/src/common/Collision/Management/VMapManager2.cpp index ae8052c83c4..bf52acbe4c3 100644 --- a/src/common/Collision/Management/VMapManager2.cpp +++ b/src/common/Collision/Management/VMapManager2.cpp @@ -317,11 +317,11 @@ namespace VMAP WorldModel* worldmodel = new WorldModel(); if (!worldmodel->readFile(basepath + filename + ".vmo")) { - VMAP_ERROR_LOG("misc", "VMapManager2: could not load '%s%s.vmo'", basepath.c_str(), filename.c_str()); + TC_LOG_ERROR("misc", "VMapManager2: could not load '%s%s.vmo'", basepath.c_str(), filename.c_str()); delete worldmodel; return NULL; } - VMAP_DEBUG_LOG("maps", "VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); + TC_LOG_DEBUG("maps", "VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); model = iLoadedModelFiles.insert(std::pair<std::string, ManagedModel>(filename, ManagedModel())).first; model->second.setModel(worldmodel); } @@ -337,12 +337,12 @@ namespace VMAP auto model = iLoadedModelFiles.find(filename); if (model == iLoadedModelFiles.end()) { - VMAP_ERROR_LOG("misc", "VMapManager2: trying to unload non-loaded file '%s'", filename.c_str()); + TC_LOG_ERROR("misc", "VMapManager2: trying to unload non-loaded file '%s'", filename.c_str()); return; } if (model->second.decRefCount() == 0) { - VMAP_DEBUG_LOG("maps", "VMapManager2: unloading file '%s'", filename.c_str()); + TC_LOG_DEBUG("maps", "VMapManager2: unloading file '%s'", filename.c_str()); delete model->second.getModel(); iLoadedModelFiles.erase(model); } diff --git a/src/common/Collision/Maps/MapTree.cpp b/src/common/Collision/Maps/MapTree.cpp index 6404c6ce4bb..24874412a22 100644 --- a/src/common/Collision/Maps/MapTree.cpp +++ b/src/common/Collision/Maps/MapTree.cpp @@ -295,7 +295,7 @@ namespace VMAP bool StaticMapTree::InitMap(const std::string &fname, VMapManager2* vm) { - VMAP_DEBUG_LOG("maps", "StaticMapTree::InitMap() : initializing StaticMapTree '%s'", fname.c_str()); + TC_LOG_DEBUG("maps", "StaticMapTree::InitMap() : initializing StaticMapTree '%s'", fname.c_str()); bool success = false; std::string fullname = iBasePath + fname; FILE* rf = fopen(fullname.c_str(), "rb"); @@ -324,7 +324,7 @@ namespace VMAP if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn)) { WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name); - VMAP_DEBUG_LOG("maps", "StaticMapTree::InitMap() : loading %s", spawn.name.c_str()); + TC_LOG_DEBUG("maps", "StaticMapTree::InitMap() : loading %s", spawn.name.c_str()); if (model) { // assume that global model always is the first and only tree value (could be improved...) @@ -334,7 +334,7 @@ namespace VMAP else { success = false; - VMAP_ERROR_LOG("misc", "StaticMapTree::InitMap() : could not acquire WorldModel pointer for '%s'", spawn.name.c_str()); + TC_LOG_ERROR("misc", "StaticMapTree::InitMap() : could not acquire WorldModel pointer for '%s'", spawn.name.c_str()); } } @@ -385,7 +385,7 @@ namespace VMAP } if (!iTreeValues) { - VMAP_ERROR_LOG("misc", "StaticMapTree::LoadMapTile() : tree has not been initialized [%u, %u]", tileX, tileY); + TC_LOG_ERROR("misc", "StaticMapTree::LoadMapTile() : tree has not been initialized [%u, %u]", tileX, tileY); return false; } bool result = true; @@ -410,7 +410,7 @@ namespace VMAP // acquire model instance WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name); if (!model) - VMAP_ERROR_LOG("misc", "StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u, %u]", tileX, tileY); + TC_LOG_ERROR("misc", "StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u, %u]", tileX, tileY); // update tree auto spawnIndex = iSpawnIndices.find(spawn.ID); @@ -421,7 +421,7 @@ namespace VMAP { if (referencedVal >= iNTreeValues) { - VMAP_ERROR_LOG("maps", "StaticMapTree::LoadMapTile() : invalid tree element (%u/%u) referenced in tile %s", referencedVal, iNTreeValues, fileResult.Name.c_str()); + TC_LOG_ERROR("maps", "StaticMapTree::LoadMapTile() : invalid tree element (%u/%u) referenced in tile %s", referencedVal, iNTreeValues, fileResult.Name.c_str()); continue; } @@ -461,7 +461,7 @@ namespace VMAP loadedTileMap::iterator tile = iLoadedTiles.find(tileID); if (tile == iLoadedTiles.end()) { - VMAP_ERROR_LOG("misc", "StaticMapTree::UnloadMapTile() : trying to unload non-loaded tile - Map:%u X:%u Y:%u", iMapID, tileX, tileY); + TC_LOG_ERROR("misc", "StaticMapTree::UnloadMapTile() : trying to unload non-loaded tile - Map:%u X:%u Y:%u", iMapID, tileX, tileY); return; } if (tile->second) // file associated with tile @@ -494,7 +494,7 @@ namespace VMAP { uint32 referencedNode = spawnIndex->second; if (!iLoadedSpawns.count(referencedNode)) - VMAP_ERROR_LOG("misc", "StaticMapTree::UnloadMapTile() : trying to unload non-referenced model '%s' (ID:%u)", spawn.name.c_str(), spawn.ID); + TC_LOG_ERROR("misc", "StaticMapTree::UnloadMapTile() : trying to unload non-referenced model '%s' (ID:%u)", spawn.name.c_str(), spawn.ID); else if (--iLoadedSpawns[referencedNode] == 0) { iTreeValues[referencedNode].setUnloaded(); diff --git a/src/common/Collision/Models/GameObjectModel.cpp b/src/common/Collision/Models/GameObjectModel.cpp index 6863b67089d..c4b8922da59 100644 --- a/src/common/Collision/Models/GameObjectModel.cpp +++ b/src/common/Collision/Models/GameObjectModel.cpp @@ -43,14 +43,12 @@ ModelList model_list; void LoadGameObjectModelList(std::string const& dataPath) { -#ifndef NO_CORE_FUNCS uint32 oldMSTime = getMSTime(); -#endif FILE* model_list_file = fopen((dataPath + "vmaps/" + VMAP::GAMEOBJECT_MODELS).c_str(), "rb"); if (!model_list_file) { - VMAP_ERROR_LOG("misc", "Unable to open '%s' file.", VMAP::GAMEOBJECT_MODELS); + TC_LOG_ERROR("misc", "Unable to open '%s' file.", VMAP::GAMEOBJECT_MODELS); return; } @@ -69,13 +67,13 @@ void LoadGameObjectModelList(std::string const& dataPath) || fread(&v1, sizeof(Vector3), 1, model_list_file) != 1 || fread(&v2, sizeof(Vector3), 1, model_list_file) != 1) { - VMAP_ERROR_LOG("misc", "File '%s' seems to be corrupted!", VMAP::GAMEOBJECT_MODELS); + TC_LOG_ERROR("misc", "File '%s' seems to be corrupted!", VMAP::GAMEOBJECT_MODELS); break; } if (v1.isNaN() || v2.isNaN()) { - VMAP_ERROR_LOG("misc", "File '%s' Model '%s' has invalid v1%s v2%s values!", VMAP::GAMEOBJECT_MODELS, std::string(buff, name_length).c_str(), v1.toString().c_str(), v2.toString().c_str()); + TC_LOG_ERROR("misc", "File '%s' Model '%s' has invalid v1%s v2%s values!", VMAP::GAMEOBJECT_MODELS, std::string(buff, name_length).c_str(), v1.toString().c_str(), v2.toString().c_str()); continue; } @@ -86,7 +84,7 @@ void LoadGameObjectModelList(std::string const& dataPath) } fclose(model_list_file); - VMAP_INFO_LOG("server.loading", ">> Loaded %u GameObject models in %u ms", uint32(model_list.size()), GetMSTimeDiffToNow(oldMSTime)); + TC_LOG_INFO("server.loading", ">> Loaded %u GameObject models in %u ms", uint32(model_list.size()), GetMSTimeDiffToNow(oldMSTime)); } GameObjectModel::~GameObjectModel() @@ -105,7 +103,7 @@ bool GameObjectModel::initialize(std::unique_ptr<GameObjectModelOwnerBase> model // ignore models with no bounds if (mdl_box == G3D::AABox::zero()) { - VMAP_ERROR_LOG("misc", "GameObject model %s has zero bounds, loading skipped", it->second.name.c_str()); + TC_LOG_ERROR("misc", "GameObject model %s has zero bounds, loading skipped", it->second.name.c_str()); return false; } @@ -218,7 +216,7 @@ bool GameObjectModel::UpdatePosition() // ignore models with no bounds if (mdl_box == G3D::AABox::zero()) { - VMAP_ERROR_LOG("misc", "GameObject model %s has zero bounds, loading skipped", it->second.name.c_str()); + TC_LOG_ERROR("misc", "GameObject model %s has zero bounds, loading skipped", it->second.name.c_str()); return false; } diff --git a/src/common/Collision/VMapDefinitions.h b/src/common/Collision/VMapDefinitions.h index c8f3f2fdbe3..7bdabb528e7 100644 --- a/src/common/Collision/VMapDefinitions.h +++ b/src/common/Collision/VMapDefinitions.h @@ -33,15 +33,4 @@ namespace VMAP bool readChunk(FILE* rf, char *dest, const char *compare, uint32 len); } -// Set of helper macros for extractors (VMAP and MMAP) -#ifndef NO_CORE_FUNCS -#define VMAP_ERROR_LOG(FILTER, ...) TC_LOG_ERROR(FILTER, __VA_ARGS__) -#define VMAP_DEBUG_LOG(FILTER, ...) TC_LOG_DEBUG(FILTER, __VA_ARGS__) -#define VMAP_INFO_LOG(FILTER, ...) TC_LOG_INFO(FILTER, __VA_ARGS__) -#else -#define VMAP_ERROR_LOG(FILTER, ...) (void)sizeof(FILTER) -#define VMAP_DEBUG_LOG(FILTER, ...) (void)sizeof(FILTER) -#define VMAP_INFO_LOG(FILTER, ...) (void)sizeof(FILTER) -#endif - #endif |