int VMapManager::loadMap(const char* pBasePath, unsigned int pMapId, int x, int y) { int result = VMAP_LOAD_RESULT_IGNORED; if(isMapLoadingEnabled() && !iIgnoreMapIds.containsKey(pMapId)) { bool loaded = _loadMap(pBasePath, pMapId, x, y, false); if(!loaded) { // if we can't load the map it might be splitted into tiles. Try that one and store the result loaded = _loadMap(pBasePath, pMapId, x, y, true); if(loaded) { iMapsSplitIntoTiles.set(pMapId, true); } } if(loaded) { result = VMAP_LOAD_RESULT_OK; // just for debugging #ifdef _VMAP_LOG_DEBUG Command c = Command(); c.fillLoadTileCmd(x, y, pMapId); iCommandLogger.appendCmd(c); #endif } else { result = VMAP_LOAD_RESULT_ERROR; } } return result; }
VMAPLoadResult VMapManager2::loadMap(const char* pBasePath, unsigned int pMapId, int x, int y) { VMAPLoadResult result = VMAP_LOAD_RESULT_IGNORED; if (isMapLoadingEnabled()) { if (_loadMap(pMapId, pBasePath, x, y)) result = VMAP_LOAD_RESULT_OK; else result = VMAP_LOAD_RESULT_ERROR; } return result; }
int VMapManager2::loadMap(const char* basePath, unsigned int mapId, int x, int y) { int result = VMAP_LOAD_RESULT_IGNORED; if (isMapLoadingEnabled()) { if (loadSingleMap(mapId, basePath, x, y)) { result = VMAP_LOAD_RESULT_OK; auto childMaps = iChildMapData.find(mapId); if (childMaps != iChildMapData.end()) for (uint32 childMapId : childMaps->second) if (!loadSingleMap(childMapId, basePath, x, y)) result = VMAP_LOAD_RESULT_ERROR; } else result = VMAP_LOAD_RESULT_ERROR; } return result; }