From a56eb83c91da45c3473db01d81fa5a559d5c8de8 Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Mon, 16 Dec 2013 23:54:33 -0800 Subject: [PATCH] - moved map path into config class - proper render performance calc compare --- source/glest_game/game/game.cpp | 7 +++-- source/glest_game/global/config.cpp | 28 +++++++++++++++++++ source/glest_game/global/config.h | 2 ++ source/glest_game/main/main.cpp | 2 +- .../menu/menu_state_connected_game.cpp | 16 +++++------ .../menu/menu_state_custom_game.cpp | 22 +++++++-------- .../glest_game/network/client_interface.cpp | 12 ++++---- source/glest_game/network/connection_slot.cpp | 12 ++++---- source/glest_game/network/connection_slot.h | 5 ++-- source/glest_game/network/network_message.cpp | 11 +++----- source/glest_game/network/network_message.h | 1 + .../glest_game/network/server_interface.cpp | 15 +++++----- source/glest_game/world/map.cpp | 28 ------------------- source/glest_game/world/map.h | 1 - 14 files changed, 82 insertions(+), 80 deletions(-) diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp index a05f3b84..6afc25c9 100644 --- a/source/glest_game/game/game.cpp +++ b/source/glest_game/game/game.cpp @@ -1145,7 +1145,7 @@ void Game::load(int loadTypes) { //map if((loadTypes & lgt_Map) == lgt_Map) { if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); - world.loadMap(Map::getMapPath(mapName,scenarioDir), &checksum); + world.loadMap(Config::getMapPath(mapName,scenarioDir), &checksum); } if(showPerfStats) { @@ -2763,9 +2763,12 @@ string Game::getGamePerformanceCounts(bool displayWarnings) const { for(std::map::const_iterator iterMap = gamePerformanceCounts.begin(); iterMap != gamePerformanceCounts.end(); ++iterMap) { if(iterMap->first == ProgramState::MAIN_PROGRAM_RENDER_KEY) { - if(iterMap->second > WARNING_RENDER_MILLIS) { + if(iterMap->second < WARNING_RENDER_MILLIS) { continue; } + //else { + // printf("iterMap->second: " MG_I64_SPECIFIER " WARNING_RENDER_MILLIS = %d\n",iterMap->second,WARNING_RENDER_MILLIS); + //} } else if(iterMap->second < WARNING_MILLIS) { continue; diff --git a/source/glest_game/global/config.cpp b/source/glest_game/global/config.cpp index 703abcef..f0672e97 100644 --- a/source/glest_game/global/config.cpp +++ b/source/glest_game/global/config.cpp @@ -860,4 +860,32 @@ string Config::findValidLocalFileFromPath(string fileName) { } +// static +string Config::getMapPath(const string &mapName, string scenarioDir, bool errorOnNotFound) { + + Config &config = Config::getInstance(); + vector pathList = config.getPathListForType(ptMaps,scenarioDir); + + for(int idx = 0; idx < (int)pathList.size(); idx++) { + string map_path = pathList[idx]; + endPathWithSlash(map_path); + + const string mega = map_path + mapName + ".mgm"; + const string glest = map_path + mapName + ".gbm"; + if (fileExists(mega)) { + return mega; + } + else if (fileExists(glest)) { + return glest; + } + } + + if(errorOnNotFound == true) { + //abort(); + throw megaglest_runtime_error("Map not found [" + mapName + "]\nScenario [" + scenarioDir + "]"); + } + + return ""; +} + }}// end namespace diff --git a/source/glest_game/global/config.h b/source/glest_game/global/config.h index 1364e19f..788b1a3e 100644 --- a/source/glest_game/global/config.h +++ b/source/glest_game/global/config.h @@ -121,6 +121,8 @@ public: static void setCustomRuntimeProperty(string key, string value) { customRuntimeProperties[key] = value; } static string findValidLocalFileFromPath(string fileName); + + static string getMapPath(const string &mapName, string scenarioDir="", bool errorOnNotFound=true); }; }}//end namespace diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 471c9004..e29de352 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -3461,7 +3461,7 @@ int handleShowCRCValuesCommand(int argc, char** argv) { if(paramPartTokens.size() >= 2 && paramPartTokens[1].length() > 0) { string itemName = paramPartTokens[1]; - string file = Map::getMapPath(itemName,"",false); + string file = Config::getMapPath(itemName,"",false); if(file != "") { Checksum checksum; checksum.addFile(file); diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index 9e357f27..353c76cc 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -1692,7 +1692,7 @@ void MenuStateConnectedGame::mouseClickAdmin(int x, int y, MouseButton mouseButt if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s\n", getCurrentMapFile().c_str()); - if(loadMapInfo(Map::getMapPath(getCurrentMapFile(),"",false), &mapInfo, true) == true) { + if(loadMapInfo(Config::getMapPath(getCurrentMapFile(),"",false), &mapInfo, true) == true) { labelMapInfo.setText(mapInfo.desc); } else { @@ -2217,7 +2217,7 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) { if(gameSettings->getMap() != "") { if(lastCheckedCRCMapName != gameSettings->getMap()) { Checksum checksum; - string file = Map::getMapPath(gameSettings->getMap(),"",false); + string file = Config::getMapPath(gameSettings->getMap(),"",false); //console.addLine("Checking map CRC [" + file + "]"); checksum.addFile(file); lastCheckedCRCMapValue = checksum.getSum(); @@ -2852,7 +2852,7 @@ void MenuStateConnectedGame::update() { if(lastCheckedCRCMapName != gameSettings->getMap() && gameSettings->getMap() != "") { Checksum checksum; - string file = Map::getMapPath(gameSettings->getMap(),"",false); + string file = Config::getMapPath(gameSettings->getMap(),"",false); //console.addLine("Checking map CRC [" + file + "]"); checksum.addFile(file); mapCRC = checksum.getSum(); @@ -3889,7 +3889,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName, if(result.first == ftp_crt_SUCCESS) { // Clear the CRC file Cache - string file = Map::getMapPath(itemName,"",false); + string file = Config::getMapPath(itemName,"",false); if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Got map itemName [%s] file [%s] lastCheckedCRCMapName [%s] gameSettings->getMap() [%s]\n", itemName.c_str(),file.c_str(),lastCheckedCRCMapName.c_str(),gameSettings->getMap().c_str()); @@ -4451,7 +4451,7 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings, if(currentMap != gameSettings->getMap()) {// load the setup again currentMap = gameSettings->getMap(); } - bool mapLoaded = loadMapInfo(Map::getMapPath(currentMap,scenarioDir,false), &mapInfo, true); + bool mapLoaded = loadMapInfo(Config::getMapPath(currentMap,scenarioDir,false), &mapInfo, true); if(mapLoaded == true) { if(find(maps.begin(),maps.end(),formatString(gameSettings->getMap())) == maps.end()) { maps.push_back(formatString(gameSettings->getMap())); @@ -4809,11 +4809,11 @@ int MenuStateConnectedGame::setupMapList(string scenario) { formattedMapFiles.clear(); for(int i= 0; i < (int)mapFiles.size(); i++){// fetch info and put map in right list - loadMapInfo(Map::getMapPath(mapFiles.at(i), scenarioDir, false), &mapInfo, false); + loadMapInfo(Config::getMapPath(mapFiles.at(i), scenarioDir, false), &mapInfo, false); if(GameConstants::maxPlayers+1 <= mapInfo.players) { char szBuf[8096]=""; - snprintf(szBuf,8096,"Sorted map list [%d] does not match\ncurrent map playercount [%d]\nfor file [%s]\nmap [%s]",GameConstants::maxPlayers+1,mapInfo.players,Map::getMapPath(mapFiles.at(i), "", false).c_str(),mapInfo.desc.c_str()); + snprintf(szBuf,8096,"Sorted map list [%d] does not match\ncurrent map playercount [%d]\nfor file [%s]\nmap [%s]",GameConstants::maxPlayers+1,mapInfo.players,Config::getMapPath(mapFiles.at(i), "", false).c_str(),mapInfo.desc.c_str()); throw megaglest_runtime_error(szBuf); } playerSortedMaps[mapInfo.players].push_back(mapFiles.at(i)); @@ -4828,7 +4828,7 @@ int MenuStateConnectedGame::setupMapList(string scenario) { string file = Scenario::getScenarioPath(dirList, scenario); loadScenarioInfo(file, &scenarioInfo); - loadMapInfo(Map::getMapPath(scenarioInfo.mapName, scenarioDir, true), &mapInfo, false); + loadMapInfo(Config::getMapPath(scenarioInfo.mapName, scenarioDir, true), &mapInfo, false); if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] listBoxMap.getSelectedItemIndex() = %d, mapFiles.size() = " MG_SIZE_T_SPECIFIER ", mapInfo.players = %d, formattedPlayerSortedMaps[mapInfo.players].size() = " MG_SIZE_T_SPECIFIER ", scenarioInfo.mapName [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,listBoxMap.getSelectedItemIndex(),mapFiles.size(),mapInfo.players,formattedPlayerSortedMaps[mapInfo.players].size(),scenarioInfo.mapName.c_str()); listBoxMap.setItems(formattedPlayerSortedMaps[mapInfo.players]); diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index ce4adab9..b7b2c873 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -609,7 +609,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, labelNetStatus[i].setText(""); } - loadMapInfo(Map::getMapPath(getCurrentMapFile()), &mapInfo, true); + loadMapInfo(Config::getMapPath(getCurrentMapFile()), &mapInfo, true); labelMapInfo.setText(mapInfo.desc); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); @@ -1081,7 +1081,7 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton) { MutexSafeWrapper safeMutex((publishToMasterserverThread != NULL ? publishToMasterserverThread->getMutexThreadObjectAccessor() : NULL),string(__FILE__) + "_" + intToStr(__LINE__)); MutexSafeWrapper safeMutexCLI((publishToClientsThread != NULL ? publishToClientsThread->getMutexThreadObjectAccessor() : NULL),string(__FILE__) + "_" + intToStr(__LINE__)); - loadMapInfo(Map::getMapPath(getCurrentMapFile(),"",false), &mapInfo, true); + loadMapInfo(Config::getMapPath(getCurrentMapFile(),"",false), &mapInfo, true); labelMapInfo.setText(mapInfo.desc); updateControlers(); updateNetworkSlots(); @@ -1224,7 +1224,7 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton) { if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s\n", getCurrentMapFile().c_str()); - loadMapInfo(Map::getMapPath(getCurrentMapFile()), &mapInfo, true); + loadMapInfo(Config::getMapPath(getCurrentMapFile()), &mapInfo, true); labelMapInfo.setText(mapInfo.desc); updateControlers(); updateNetworkSlots(); @@ -3672,7 +3672,7 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force if(lastCheckedCRCMapName != gameSettings->getMap()) { Checksum checksum; - string file = Map::getMapPath(gameSettings->getMap(),"",false); + string file = Config::getMapPath(gameSettings->getMap(),"",false); //console.addLine("Checking map CRC [" + file + "]"); checksum.addFile(file); lastCheckedCRCMapValue = checksum.getSum(); @@ -3821,7 +3821,7 @@ void MenuStateCustomGame::setupUIFromGameSettings(const GameSettings &gameSettin //loadScenarioInfo(file, &scenarioInfo); //printf("#6.1 about to load map [%s]\n",scenarioInfo.mapName.c_str()); - //loadMapInfo(Map::getMapPath(scenarioInfo.mapName, scenarioDir, true), &mapInfo, false); + //loadMapInfo(Config::getMapPath(scenarioInfo.mapName, scenarioDir, true), &mapInfo, false); //printf("#6.2\n"); listBoxMapFilter.setSelectedItemIndex(0); @@ -3845,7 +3845,7 @@ void MenuStateCustomGame::setupUIFromGameSettings(const GameSettings &gameSettin mapFile = formatString(mapFile); listBoxMap.setSelectedItem(mapFile); - loadMapInfo(Map::getMapPath(getCurrentMapFile(),scenarioDir,true), &mapInfo, true); + loadMapInfo(Config::getMapPath(getCurrentMapFile(),scenarioDir,true), &mapInfo, true); labelMapInfo.setText(mapInfo.desc); } @@ -4509,7 +4509,7 @@ void MenuStateCustomGame::processScenario() { setupMapList(scenarioInfo.name); listBoxMap.setSelectedItem(formatString(scenarioInfo.mapName)); - loadMapInfo(Map::getMapPath(getCurrentMapFile(),scenarioDir,true), &mapInfo, true); + loadMapInfo(Config::getMapPath(getCurrentMapFile(),scenarioDir,true), &mapInfo, true); labelMapInfo.setText(mapInfo.desc); //printf("scenarioInfo.name [%s] [%s]\n",scenarioInfo.name.c_str(),listBoxMap.getSelectedItem().c_str()); @@ -4638,7 +4638,7 @@ void MenuStateCustomGame::processScenario() { else { setupMapList(""); listBoxMap.setSelectedItem(formatString(formattedPlayerSortedMaps[0][0])); - loadMapInfo(Map::getMapPath(getCurrentMapFile(),"",true), &mapInfo, true); + loadMapInfo(Config::getMapPath(getCurrentMapFile(),"",true), &mapInfo, true); labelMapInfo.setText(mapInfo.desc); setupTechList("", false); @@ -4746,11 +4746,11 @@ int MenuStateCustomGame::setupMapList(string scenario) { //printf("#5\n"); for(int i= 0; i < (int)mapFiles.size(); i++){// fetch info and put map in right list - loadMapInfo(Map::getMapPath(mapFiles.at(i), scenarioDir, false), &mapInfo, false); + loadMapInfo(Config::getMapPath(mapFiles.at(i), scenarioDir, false), &mapInfo, false); if(GameConstants::maxPlayers+1 <= mapInfo.players) { char szBuf[8096]=""; - snprintf(szBuf,8096,"Sorted map list [%d] does not match\ncurrent map playercount [%d]\nfor file [%s]\nmap [%s]",GameConstants::maxPlayers+1,mapInfo.players,Map::getMapPath(mapFiles.at(i), "", false).c_str(),mapInfo.desc.c_str()); + snprintf(szBuf,8096,"Sorted map list [%d] does not match\ncurrent map playercount [%d]\nfor file [%s]\nmap [%s]",GameConstants::maxPlayers+1,mapInfo.players,Config::getMapPath(mapFiles.at(i), "", false).c_str(),mapInfo.desc.c_str()); throw megaglest_runtime_error(szBuf); } playerSortedMaps[mapInfo.players].push_back(mapFiles.at(i)); @@ -4766,7 +4766,7 @@ int MenuStateCustomGame::setupMapList(string scenario) { loadScenarioInfo(file, &scenarioInfo); //printf("#6.1 about to load map [%s]\n",scenarioInfo.mapName.c_str()); - loadMapInfo(Map::getMapPath(scenarioInfo.mapName, scenarioDir, true), &mapInfo, false); + loadMapInfo(Config::getMapPath(scenarioInfo.mapName, scenarioDir, true), &mapInfo, false); //printf("#6.2\n"); listBoxMapFilter.setSelectedItem(intToStr(mapInfo.players)); listBoxMap.setItems(formattedPlayerSortedMaps[mapInfo.players]); diff --git a/source/glest_game/network/client_interface.cpp b/source/glest_game/network/client_interface.cpp index 119bc040..05fccf30 100644 --- a/source/glest_game/network/client_interface.cpp +++ b/source/glest_game/network/client_interface.cpp @@ -11,18 +11,18 @@ #include "client_interface.h" -#include -#include +#include "logger.h" +#include "window.h" #include "platform_util.h" #include "game_util.h" #include "conversion.h" #include "config.h" #include "lang.h" -#include "map.h" #include "config.h" -#include "logger.h" -#include "window.h" +#include +#include + #include "leak_dumper.h" using namespace std; @@ -741,7 +741,7 @@ void ClientInterface::updateLobby() { //map Checksum checksum; - string file = Map::getMapPath(networkMessageSynchNetworkGameData.getMap(),scenarioDir, false); + string file = Config::getMapPath(networkMessageSynchNetworkGameData.getMap(),scenarioDir, false); if(file != "") { checksum.addFile(file); mapCRC = checksum.getSum(); diff --git a/source/glest_game/network/connection_slot.cpp b/source/glest_game/network/connection_slot.cpp index 0755823a..6dd6260f 100644 --- a/source/glest_game/network/connection_slot.cpp +++ b/source/glest_game/network/connection_slot.cpp @@ -11,17 +11,15 @@ #include "connection_slot.h" -#include - #include "conversion.h" #include "game_util.h" #include "config.h" #include "server_interface.h" #include "network_message.h" -#include "leak_dumper.h" - #include "platform_util.h" -#include "map.h" +#include + +#include "leak_dumper.h" using namespace std; using namespace Shared::Util; @@ -1190,7 +1188,7 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) { uint32 tilesetCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTilesets,scenarioDir), string("/") + serverInterface->getGameSettings()->getTileset() + string("/*"), ".xml", NULL); uint32 techCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,scenarioDir), "/" + serverInterface->getGameSettings()->getTech() + "/*", ".xml", NULL); Checksum checksum; - string file = Map::getMapPath(serverInterface->getGameSettings()->getMap(),scenarioDir,false); + string file = Config::getMapPath(serverInterface->getGameSettings()->getMap(),scenarioDir,false); checksum.addFile(file); uint32 mapCRC = checksum.getSum(); @@ -1247,7 +1245,7 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) { this->setNetworkGameDataSynchCheckTechMismatchReport(report); } if(networkGameDataSynchCheckOkMap == false) { - vctFileList.push_back(std::pair(Map::getMapPath(serverInterface->getGameSettings()->getMap(),scenarioDir,false),mapCRC)); + vctFileList.push_back(std::pair(Config::getMapPath(serverInterface->getGameSettings()->getMap(),scenarioDir,false),mapCRC)); } //for(int i = 0; i < vctFileList.size(); i++) diff --git a/source/glest_game/network/connection_slot.h b/source/glest_game/network/connection_slot.h index 33b62c8e..bda11f69 100644 --- a/source/glest_game/network/connection_slot.h +++ b/source/glest_game/network/connection_slot.h @@ -12,11 +12,12 @@ #ifndef _GLEST_GAME_CONNECTIONSLOT_H_ #define _GLEST_GAME_CONNECTIONSLOT_H_ -#include #include "socket.h" #include "network_interface.h" -#include #include "base_thread.h" +#include +#include + #include "leak_dumper.h" using Shared::Platform::ServerSocket; diff --git a/source/glest_game/network/network_message.cpp b/source/glest_game/network/network_message.cpp index 2af29c37..5d27348f 100644 --- a/source/glest_game/network/network_message.cpp +++ b/source/glest_game/network/network_message.cpp @@ -11,19 +11,16 @@ #include "network_message.h" -#include -#include - #include "data_types.h" #include "util.h" #include "game_settings.h" - #include "checksum.h" -#include "map.h" #include "platform_util.h" #include "config.h" -#include #include "network_protocol.h" +#include +#include +#include #include "leak_dumper.h" @@ -1887,7 +1884,7 @@ NetworkMessageSynchNetworkGameData::NetworkMessageSynchNetworkGameData(const Gam //map Checksum checksum; - string file = Map::getMapPath(gameSettings->getMap(),scenarioDir,false); + string file = Config::getMapPath(gameSettings->getMap(),scenarioDir,false); checksum.addFile(file); data.header.mapCRC = checksum.getSum(); diff --git a/source/glest_game/network/network_message.h b/source/glest_game/network/network_message.h index 8b14bc80..38c1db8f 100644 --- a/source/glest_game/network/network_message.h +++ b/source/glest_game/network/network_message.h @@ -16,6 +16,7 @@ #include "game_constants.h" #include "network_types.h" #include "byte_order.h" + #include "leak_dumper.h" using Shared::Platform::Socket; diff --git a/source/glest_game/network/server_interface.cpp b/source/glest_game/network/server_interface.cpp index 03f0eb13..9f6ba127 100644 --- a/source/glest_game/network/server_interface.cpp +++ b/source/glest_game/network/server_interface.cpp @@ -13,22 +13,23 @@ #include +#include "window.h" +#include "logger.h" + #include "platform_util.h" #include "conversion.h" #include "config.h" #include "lang.h" -#include "logger.h" -#include #include "util.h" #include "game_util.h" -#include "map.h" #include "miniftpserver.h" -#include "window.h" +#include "map_preview.h" +#include "stats.h" +#include #include #include -#include "map_preview.h" #include -#include "stats.h" + #include "leak_dumper.h" using namespace std; @@ -2606,7 +2607,7 @@ void ServerInterface::validateGameSettings(GameSettings *serverGameSettings) { serverGameSettings->setMapFilterIndex(gameSettings.getMapFilterIndex()); Checksum checksum; - string file = Map::getMapPath(serverGameSettings->getMap(),"",false); + string file = Config::getMapPath(serverGameSettings->getMap(),"",false); checksum.addFile(file); serverGameSettings->setMapCRC(checksum.getSum()); } diff --git a/source/glest_game/world/map.cpp b/source/glest_game/world/map.cpp index 9e336fb5..ff5090fd 100644 --- a/source/glest_game/world/map.cpp +++ b/source/glest_game/world/map.cpp @@ -1704,34 +1704,6 @@ void Map::computeCellColors(){ } } -// static -string Map::getMapPath(const string &mapName, string scenarioDir, bool errorOnNotFound) { - - Config &config = Config::getInstance(); - vector pathList = config.getPathListForType(ptMaps,scenarioDir); - - for(int idx = 0; idx < (int)pathList.size(); idx++) { - string map_path = pathList[idx]; - endPathWithSlash(map_path); - - const string mega = map_path + mapName + ".mgm"; - const string glest = map_path + mapName + ".gbm"; - if (fileExists(mega)) { - return mega; - } - else if (fileExists(glest)) { - return glest; - } - } - - if(errorOnNotFound == true) { - //abort(); - throw megaglest_runtime_error("Map not found [" + mapName + "]\nScenario [" + scenarioDir + "]"); - } - - return ""; -} - void Map::saveGame(XmlNode *rootNode) const { std::map mapTagReplacements; XmlNode *mapNode = rootNode->addChild("Map"); diff --git a/source/glest_game/world/map.h b/source/glest_game/world/map.h index b5684828..9e650c0a 100644 --- a/source/glest_game/world/map.h +++ b/source/glest_game/world/map.h @@ -362,7 +362,6 @@ public: //static inline static Vec2i toSurfCoords(const Vec2i &unitPos) {return unitPos / cellScale;} inline static Vec2i toUnitCoords(const Vec2i &surfPos) {return surfPos * cellScale;} - static string getMapPath(const string &mapName, string scenarioDir="", bool errorOnNotFound=true); inline bool isFreeCellOrMightBeFreeSoon(Vec2i originPos, const Vec2i &pos, Field field) const { return