From 2ab041813fac5cdb45df5636fc21447b06df94c6 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Thu, 5 Apr 2012 03:53:59 +0000 Subject: [PATCH] - code cleanup based on cppcheck report --- source/glest_game/game/script_manager.cpp | 18 ------------------ source/glest_game/gui/gui.cpp | 1 - source/glest_game/main/main.cpp | 2 -- source/glest_game/types/resource_type.cpp | 1 + 4 files changed, 1 insertion(+), 21 deletions(-) diff --git a/source/glest_game/game/script_manager.cpp b/source/glest_game/game/script_manager.cpp index d60ae60a..a30695b3 100644 --- a/source/glest_game/game/script_manager.cpp +++ b/source/glest_game/game/script_manager.cpp @@ -677,41 +677,23 @@ string ScriptManager::wrapString(const string &str, int wrapCount){ void ScriptManager::networkShowMessageForFaction(const string &text, const string &header,int factionIndex) { ScriptManager_STREFLOP_Wrapper streflopWrapper; - Lang &lang= Lang::getInstance(); messageQueue.push_back(ScriptManagerMessage(text, header, factionIndex)); onMessageBoxOk(false); -// if(factionIndex == this->world->getThisFactionIndex()) { -// messageBox.setEnabled(true); -// messageBox.setText(wrapString(lang.getScenarioString(messageQueue.front().getText()), messageWrapCount)); -// messageBox.setHeader(lang.getScenarioString(messageQueue.front().getHeader())); -// } } void ScriptManager::networkShowMessageForTeam(const string &text, const string &header,int teamIndex) { ScriptManager_STREFLOP_Wrapper streflopWrapper; - Lang &lang= Lang::getInstance(); - // Team indexes are 0 based internally (but 1 based in the lua script) so convert teamIndex--; messageQueue.push_back(ScriptManagerMessage(text, header, -1, teamIndex)); onMessageBoxOk(false); -// if(teamIndex == this->world->getThisTeamIndex()) { -// messageBox.setEnabled(true); -// messageBox.setText(wrapString(lang.getScenarioString(messageQueue.front().getText()), messageWrapCount)); -// messageBox.setHeader(lang.getScenarioString(messageQueue.front().getHeader())); -// } } void ScriptManager::showMessage(const string &text, const string &header){ ScriptManager_STREFLOP_Wrapper streflopWrapper; - Lang &lang= Lang::getInstance(); - messageQueue.push_back(ScriptManagerMessage(text, header)); onMessageBoxOk(false); -// messageBox.setEnabled(true); -// messageBox.setText(wrapString(lang.getScenarioString(messageQueue.front().getText()), messageWrapCount)); -// messageBox.setHeader(lang.getScenarioString(messageQueue.front().getHeader())); } void ScriptManager::clearDisplayText(){ diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp index 9fa6ea4c..8982f6ab 100644 --- a/source/glest_game/gui/gui.cpp +++ b/source/glest_game/gui/gui.cpp @@ -1176,7 +1176,6 @@ bool Gui::computeTarget(const Vec2i &screenPos, Vec2i &targetPos, const Unit *&t else{ targetUnit= NULL; if(renderer.computePosition(screenPos, targetPos)){ - const Object* resourceObject; validPosObjWorld= true; posObjWorld= targetPos; diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index e4bf1f9e..2c868651 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -2434,10 +2434,8 @@ void runTilesetValidationReport(int argc, char** argv) { //disableBacktrace=true; printf("====== Started Validation ======\n"); - bool purgeDuplicateFiles = false; bool showDuplicateFiles = true; bool purgeUnusedFiles = false; - bool svnPurgeFiles = false; double purgedMegaBytes=0; Config &config = Config::getInstance(); diff --git a/source/glest_game/types/resource_type.cpp b/source/glest_game/types/resource_type.cpp index fe780305..7824ff0a 100644 --- a/source/glest_game/types/resource_type.cpp +++ b/source/glest_game/types/resource_type.cpp @@ -38,6 +38,7 @@ ResourceType::ResourceType() { defResPerPatch=0; recoup_cost = false; model = NULL; + displayInHud = false; } ResourceType::~ResourceType(){