- phase 3 of cppcheck verbose fixes
This commit is contained in:
parent
57afc2d715
commit
bb68106912
|
@ -587,7 +587,7 @@ void MainWindow::onPaint(wxPaintEvent &event) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(modelPathList.size() == 0 && haveLoadedParticles) {
|
else if(modelPathList.empty() == true && haveLoadedParticles) {
|
||||||
if(renderer->hasActiveParticleSystem(ParticleSystem::pst_ProjectileParticleSystem) == false &&
|
if(renderer->hasActiveParticleSystem(ParticleSystem::pst_ProjectileParticleSystem) == false &&
|
||||||
renderer->hasActiveParticleSystem(ParticleSystem::pst_SplashParticleSystem) == false) {
|
renderer->hasActiveParticleSystem(ParticleSystem::pst_SplashParticleSystem) == false) {
|
||||||
|
|
||||||
|
|
|
@ -640,7 +640,7 @@ void Ai::massiveAttack(const Vec2i &pos, Field field, bool ultraAttack){
|
||||||
void Ai::returnBase(int unitIndex) {
|
void Ai::returnBase(int unitIndex) {
|
||||||
Vec2i pos;
|
Vec2i pos;
|
||||||
CommandResult r;
|
CommandResult r;
|
||||||
int fi= aiInterface->getFactionIndex();
|
aiInterface->getFactionIndex();
|
||||||
pos= Vec2i(
|
pos= Vec2i(
|
||||||
random.randRange(-villageRadius, villageRadius), random.randRange(-villageRadius, villageRadius)) +
|
random.randRange(-villageRadius, villageRadius), random.randRange(-villageRadius, villageRadius)) +
|
||||||
getRandomHomePosition();
|
getRandomHomePosition();
|
||||||
|
|
|
@ -41,7 +41,7 @@ Cartographer::Cartographer(World *world)
|
||||||
Logger::getInstance().add("Cartographer", true);
|
Logger::getInstance().add("Cartographer", true);
|
||||||
|
|
||||||
cellMap = world->getMap();
|
cellMap = world->getMap();
|
||||||
int w = cellMap->getW(), h = cellMap->getH();
|
//int w = cellMap->getW(), h = cellMap->getH();
|
||||||
|
|
||||||
routePlanner = world->getRoutePlanner();
|
routePlanner = world->getRoutePlanner();
|
||||||
masterMap = new AnnotatedMap(world);
|
masterMap = new AnnotatedMap(world);
|
||||||
|
|
|
@ -80,7 +80,7 @@ ClusterMap::~ClusterMap() {
|
||||||
#define LOG(x) {}
|
#define LOG(x) {}
|
||||||
|
|
||||||
void ClusterMap::assertValid() {
|
void ClusterMap::assertValid() {
|
||||||
bool valid[fieldCount];
|
//bool valid[fieldCount];
|
||||||
bool inUse[fieldCount];
|
bool inUse[fieldCount];
|
||||||
int numNodes[fieldCount];
|
int numNodes[fieldCount];
|
||||||
int numEdges[fieldCount];
|
int numEdges[fieldCount];
|
||||||
|
@ -94,7 +94,7 @@ void ClusterMap::assertValid() {
|
||||||
|
|
||||||
TKMap tkMap;
|
TKMap tkMap;
|
||||||
|
|
||||||
valid[f] = true;
|
//valid[f] = true;
|
||||||
numNodes[f] = 0;
|
numNodes[f] = 0;
|
||||||
numEdges[f] = 0;
|
numEdges[f] = 0;
|
||||||
inUse[f] = aMap->maxClearance[f] != 0;
|
inUse[f] = aMap->maxClearance[f] != 0;
|
||||||
|
@ -111,13 +111,13 @@ void ClusterMap::assertValid() {
|
||||||
const Transition *t = b->transitions[f].transitions[j];
|
const Transition *t = b->transitions[f].transitions[j];
|
||||||
if (tSet.find(t) != tSet.end()) {
|
if (tSet.find(t) != tSet.end()) {
|
||||||
LOG("single transition on multiple borders.\n");
|
LOG("single transition on multiple borders.\n");
|
||||||
valid[f] = false;
|
//valid[f] = false;
|
||||||
} else {
|
} else {
|
||||||
tSet.insert(t);
|
tSet.insert(t);
|
||||||
TKey key(t->nwPos, t->vertical);
|
TKey key(t->nwPos, t->vertical);
|
||||||
if (tkMap.find(key) != tkMap.end()) {
|
if (tkMap.find(key) != tkMap.end()) {
|
||||||
LOG("seperate transitions of same orientation on same cell.\n");
|
LOG("seperate transitions of same orientation on same cell.\n");
|
||||||
valid[f] = false;
|
//valid[f] = false;
|
||||||
} else {
|
} else {
|
||||||
tkMap[key] = t;
|
tkMap[key] = t;
|
||||||
}
|
}
|
||||||
|
@ -131,13 +131,13 @@ void ClusterMap::assertValid() {
|
||||||
const Transition *t = b->transitions[f].transitions[j];
|
const Transition *t = b->transitions[f].transitions[j];
|
||||||
if (tSet.find(t) != tSet.end()) {
|
if (tSet.find(t) != tSet.end()) {
|
||||||
LOG("single transition on multiple borders.\n");
|
LOG("single transition on multiple borders.\n");
|
||||||
valid[f] = false;
|
//valid[f] = false;
|
||||||
} else {
|
} else {
|
||||||
tSet.insert(t);
|
tSet.insert(t);
|
||||||
TKey key(t->nwPos, t->vertical);
|
TKey key(t->nwPos, t->vertical);
|
||||||
if (tkMap.find(key) != tkMap.end()) {
|
if (tkMap.find(key) != tkMap.end()) {
|
||||||
LOG("seperate transitions of same orientation on same cell.\n");
|
LOG("seperate transitions of same orientation on same cell.\n");
|
||||||
valid[f] = false;
|
//valid[f] = false;
|
||||||
} else {
|
} else {
|
||||||
tkMap[key] = t;
|
tkMap[key] = t;
|
||||||
}
|
}
|
||||||
|
@ -153,11 +153,11 @@ void ClusterMap::assertValid() {
|
||||||
TSet::iterator it2 = tSet.find((*eit)->transition());
|
TSet::iterator it2 = tSet.find((*eit)->transition());
|
||||||
if (it2 == tSet.end()) {
|
if (it2 == tSet.end()) {
|
||||||
LOG("Invalid edge.\n");
|
LOG("Invalid edge.\n");
|
||||||
valid[f] = false;
|
//valid[f] = false;
|
||||||
} else {
|
} else {
|
||||||
if (*it == *it2) {
|
if (*it == *it2) {
|
||||||
LOG("self referential transition.\n");
|
LOG("self referential transition.\n");
|
||||||
valid[f] = false;
|
//valid[f] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
++numEdges[f];
|
++numEdges[f];
|
||||||
|
@ -507,7 +507,7 @@ void ClusterMap::update() {
|
||||||
/** compute intra-cluster path lengths */
|
/** compute intra-cluster path lengths */
|
||||||
void ClusterMap::evalCluster(const Vec2i &cluster) {
|
void ClusterMap::evalCluster(const Vec2i &cluster) {
|
||||||
//_PROFILE_FUNCTION();
|
//_PROFILE_FUNCTION();
|
||||||
int linePathSuccess = 0, linePathFail = 0;
|
//int linePathSuccess = 0, linePathFail = 0;
|
||||||
SearchEngine<NodePool> *se = carto->getRoutePlanner()->getSearchEngine();
|
SearchEngine<NodePool> *se = carto->getRoutePlanner()->getSearchEngine();
|
||||||
se->getNeighbourFunc().setSearchCluster(cluster);
|
se->getNeighbourFunc().setSearchCluster(cluster);
|
||||||
Transitions transitions;
|
Transitions transitions;
|
||||||
|
|
|
@ -109,15 +109,17 @@ public:
|
||||||
}
|
}
|
||||||
//only for infuence_map_test.cpp:249
|
//only for infuence_map_test.cpp:249
|
||||||
PatchMap<bits> &operator=(const PatchMap<bits> &op){
|
PatchMap<bits> &operator=(const PatchMap<bits> &op){
|
||||||
//FIXME: better when moved to InfluenceMap::operator=...
|
if(&op != this) {
|
||||||
this->def = op.def;
|
//FIXME: better when moved to InfluenceMap::operator=...
|
||||||
this->x = op.x; this->y = op.y; this->w = op.w; this->h = op.h;
|
this->def = op.def;
|
||||||
//
|
this->x = op.x; this->y = op.y; this->w = op.w; this->h = op.h;
|
||||||
|
//
|
||||||
|
|
||||||
sectionsPerRow = op.sectionsPerRow;
|
sectionsPerRow = op.sectionsPerRow;
|
||||||
delete[] data;
|
delete[] data;
|
||||||
data = new uint32[op.h * sectionsPerRow];
|
data = new uint32[op.h * sectionsPerRow];
|
||||||
memcpy(data, op.data, op.h * sectionsPerRow);
|
memcpy(data, op.data, op.h * sectionsPerRow);
|
||||||
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
~PatchMap() { delete [] data; }
|
~PatchMap() { delete [] data; }
|
||||||
|
|
|
@ -107,6 +107,9 @@ RoutePlanner::RoutePlanner(World *world)
|
||||||
, nodeStore(NULL)
|
, nodeStore(NULL)
|
||||||
, tSearchEngine(NULL)
|
, tSearchEngine(NULL)
|
||||||
, tNodeStore(NULL) {
|
, tNodeStore(NULL) {
|
||||||
|
#ifdef _GAE_DEBUG_EDITION_
|
||||||
|
debug_texture_action=SHOW_PATH_ONLY;
|
||||||
|
#endif
|
||||||
const int &w = world->getMap()->getW();
|
const int &w = world->getMap()->getW();
|
||||||
const int &h = world->getMap()->getH();
|
const int &h = world->getMap()->getH();
|
||||||
|
|
||||||
|
@ -420,7 +423,7 @@ HAAStarResult RoutePlanner::findWaypointPathUnExplored(Unit *unit, const Vec2i &
|
||||||
if (res == hsrFailed) {
|
if (res == hsrFailed) {
|
||||||
return hsrFailed;
|
return hsrFailed;
|
||||||
}
|
}
|
||||||
bool startTrap = res == hsrStartTrap;
|
//bool startTrap = res == hsrStartTrap;
|
||||||
UnexploredGoal goal(world->getMap(), unit->getTeam());
|
UnexploredGoal goal(world->getMap(), unit->getTeam());
|
||||||
UnexploredCost cost(unit->getCurrField(), unit->getType()->getSize(), unit->getTeam(), world->getMap());
|
UnexploredCost cost(unit->getCurrField(), unit->getType()->getSize(), unit->getTeam(), world->getMap());
|
||||||
TransitionHeuristic heuristic(dest);
|
TransitionHeuristic heuristic(dest);
|
||||||
|
@ -848,7 +851,7 @@ TravelState RoutePlanner::customGoalSearch(PMap1Goal &goal, Unit *unit, const Ve
|
||||||
}
|
}
|
||||||
|
|
||||||
UnitPath &path = *advPath;
|
UnitPath &path = *advPath;
|
||||||
WaypointPath &wpPath = *unit->getWaypointPath();
|
//WaypointPath &wpPath = *unit->getWaypointPath();
|
||||||
const Vec2i &start = unit->getPos();
|
const Vec2i &start = unit->getPos();
|
||||||
|
|
||||||
// setup search
|
// setup search
|
||||||
|
|
|
@ -377,7 +377,7 @@ void DebugRenderer::renderArrow(
|
||||||
const float arrowEndSize = 0.5f;
|
const float arrowEndSize = 0.5f;
|
||||||
|
|
||||||
Vec3f dir = Vec3f(_pos2 - pos1);
|
Vec3f dir = Vec3f(_pos2 - pos1);
|
||||||
float len = dir.length();
|
//float len = dir.length();
|
||||||
float alphaFactor = 0.3f;
|
float alphaFactor = 0.3f;
|
||||||
|
|
||||||
dir.normalize();
|
dir.normalize();
|
||||||
|
|
|
@ -2909,7 +2909,7 @@ void Renderer::MapRenderer::render(const Map* map,float coordStep,VisibleQuadCon
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::MapRenderer::destroy() {
|
void Renderer::MapRenderer::destroy() {
|
||||||
while(layers.size()) {
|
while(layers.empty() == false) {
|
||||||
delete layers.back();
|
delete layers.back();
|
||||||
layers.pop_back();
|
layers.pop_back();
|
||||||
}
|
}
|
||||||
|
@ -5370,7 +5370,7 @@ void Renderer::renderUnitsFast(bool renderingShadows) {
|
||||||
|
|
||||||
//render objects for selection purposes
|
//render objects for selection purposes
|
||||||
void Renderer::renderObjectsFast(bool renderingShadows, bool resourceOnly) {
|
void Renderer::renderObjectsFast(bool renderingShadows, bool resourceOnly) {
|
||||||
const World *world= game->getWorld();
|
//const World *world= game->getWorld();
|
||||||
//const Map *map= world->getMap();
|
//const Map *map= world->getMap();
|
||||||
|
|
||||||
assertGl();
|
assertGl();
|
||||||
|
@ -6077,7 +6077,7 @@ void Renderer::renderUnitTitles3D(Font3D *font, Vec3f color) {
|
||||||
const Unit *unit = visibleFrameUnitList[idx];
|
const Unit *unit = visibleFrameUnitList[idx];
|
||||||
if(unit != NULL) {
|
if(unit != NULL) {
|
||||||
if(unit->getVisible() == true) {
|
if(unit->getVisible() == true) {
|
||||||
if(unit != NULL && unit->getCurrentUnitTitle() != "") {
|
if(unit->getCurrentUnitTitle() != "") {
|
||||||
//get the screen coordinates
|
//get the screen coordinates
|
||||||
Vec3f screenPos = unit->getScreenPos();
|
Vec3f screenPos = unit->getScreenPos();
|
||||||
#ifdef USE_STREFLOP
|
#ifdef USE_STREFLOP
|
||||||
|
|
|
@ -128,17 +128,17 @@ void BattleEnd::render() {
|
||||||
renderer.reset2d();
|
renderer.reset2d();
|
||||||
renderer.renderBackground(CoreData::getInstance().getBackgroundTexture());
|
renderer.renderBackground(CoreData::getInstance().getBackgroundTexture());
|
||||||
|
|
||||||
int winnerIndex = -1;
|
//int winnerIndex = -1;
|
||||||
int bestScore = -1;
|
int bestScore = -1;
|
||||||
int mostKillsIndex = -1;
|
//int mostKillsIndex = -1;
|
||||||
int bestKills = -1;
|
int bestKills = -1;
|
||||||
int mostEnemyKillsIndex = -1;
|
//int mostEnemyKillsIndex = -1;
|
||||||
int bestEnemyKills = -1;
|
int bestEnemyKills = -1;
|
||||||
int leastDeathsIndex = -1;
|
//int leastDeathsIndex = -1;
|
||||||
int leastDeaths = -1;
|
int leastDeaths = -1;
|
||||||
int mostUnitsProducedIndex = -1;
|
//int mostUnitsProducedIndex = -1;
|
||||||
int bestUnitsProduced = -1;
|
int bestUnitsProduced = -1;
|
||||||
int mostResourcesHarvestedIndex = -1;
|
//int mostResourcesHarvestedIndex = -1;
|
||||||
int bestResourcesHarvested = -1;
|
int bestResourcesHarvested = -1;
|
||||||
|
|
||||||
for(int i=0; i<stats.getFactionCount(); ++i) {
|
for(int i=0; i<stats.getFactionCount(); ++i) {
|
||||||
|
@ -150,38 +150,38 @@ void BattleEnd::render() {
|
||||||
int kills= stats.getKills(i);
|
int kills= stats.getKills(i);
|
||||||
if(kills > bestKills) {
|
if(kills > bestKills) {
|
||||||
bestKills = kills;
|
bestKills = kills;
|
||||||
mostKillsIndex = i;
|
//mostKillsIndex = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int enemykills= stats.getEnemyKills(i);
|
int enemykills= stats.getEnemyKills(i);
|
||||||
if(enemykills > bestEnemyKills) {
|
if(enemykills > bestEnemyKills) {
|
||||||
bestEnemyKills = enemykills;
|
bestEnemyKills = enemykills;
|
||||||
mostEnemyKillsIndex = i;
|
//mostEnemyKillsIndex = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int deaths= stats.getDeaths(i);
|
int deaths= stats.getDeaths(i);
|
||||||
if(deaths < leastDeaths || leastDeaths < 0) {
|
if(deaths < leastDeaths || leastDeaths < 0) {
|
||||||
leastDeaths = deaths;
|
leastDeaths = deaths;
|
||||||
leastDeathsIndex = i;
|
//leastDeathsIndex = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int unitsProduced= stats.getUnitsProduced(i);
|
int unitsProduced= stats.getUnitsProduced(i);
|
||||||
if(unitsProduced > bestUnitsProduced) {
|
if(unitsProduced > bestUnitsProduced) {
|
||||||
bestUnitsProduced = unitsProduced;
|
bestUnitsProduced = unitsProduced;
|
||||||
mostUnitsProducedIndex = i;
|
//mostUnitsProducedIndex = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int resourcesHarvested = stats.getResourcesHarvested(i);
|
int resourcesHarvested = stats.getResourcesHarvested(i);
|
||||||
if(resourcesHarvested > bestResourcesHarvested) {
|
if(resourcesHarvested > bestResourcesHarvested) {
|
||||||
bestResourcesHarvested = resourcesHarvested;
|
bestResourcesHarvested = resourcesHarvested;
|
||||||
mostResourcesHarvestedIndex = i;
|
//mostResourcesHarvestedIndex = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int score= enemykills*100 + unitsProduced*50 + resourcesHarvested/10;
|
int score= enemykills*100 + unitsProduced*50 + resourcesHarvested/10;
|
||||||
|
|
||||||
if(score > bestScore) {
|
if(score > bestScore) {
|
||||||
bestScore = score;
|
bestScore = score;
|
||||||
winnerIndex = i;
|
//winnerIndex = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1376,7 +1376,7 @@ void runTechValidationForPath(string techPath, string techName,
|
||||||
Checksum checksum;
|
Checksum checksum;
|
||||||
set<string> factions;
|
set<string> factions;
|
||||||
for(int j = 0; j < factionsList.size(); ++j) {
|
for(int j = 0; j < factionsList.size(); ++j) {
|
||||||
if( filteredFactionList.size() == 0 ||
|
if( filteredFactionList.empty() == true ||
|
||||||
std::find(filteredFactionList.begin(),filteredFactionList.end(),factionsList[j]) != filteredFactionList.end()) {
|
std::find(filteredFactionList.begin(),filteredFactionList.end(),factionsList[j]) != filteredFactionList.end()) {
|
||||||
factions.insert(factionsList[j]);
|
factions.insert(factionsList[j]);
|
||||||
}
|
}
|
||||||
|
@ -1385,7 +1385,7 @@ void runTechValidationForPath(string techPath, string techName,
|
||||||
printf("\n----------------------------------------------------------------");
|
printf("\n----------------------------------------------------------------");
|
||||||
printf("\nChecking techPath [%s] techName [%s] total faction count = %d\n",techPath.c_str(), techName.c_str(),(int)factionsList.size());
|
printf("\nChecking techPath [%s] techName [%s] total faction count = %d\n",techPath.c_str(), techName.c_str(),(int)factionsList.size());
|
||||||
for(int j = 0; j < factionsList.size(); ++j) {
|
for(int j = 0; j < factionsList.size(); ++j) {
|
||||||
if( filteredFactionList.size() == 0 ||
|
if( filteredFactionList.empty() == true ||
|
||||||
std::find(filteredFactionList.begin(),filteredFactionList.end(),factionsList[j]) != filteredFactionList.end()) {
|
std::find(filteredFactionList.begin(),filteredFactionList.end(),factionsList[j]) != filteredFactionList.end()) {
|
||||||
printf("Using faction [%s]\n",factionsList[j].c_str());
|
printf("Using faction [%s]\n",factionsList[j].c_str());
|
||||||
}
|
}
|
||||||
|
@ -1989,7 +1989,7 @@ void runTechValidationReport(int argc, char** argv) {
|
||||||
for(int idx2 = 0; idx2 < techTreeFiles.size(); idx2++) {
|
for(int idx2 = 0; idx2 < techTreeFiles.size(); idx2++) {
|
||||||
string &techName = techTreeFiles[idx2];
|
string &techName = techTreeFiles[idx2];
|
||||||
|
|
||||||
if( filteredTechTreeList.size() == 0 ||
|
if( filteredTechTreeList.empty() == true ||
|
||||||
std::find(filteredTechTreeList.begin(),filteredTechTreeList.end(),techName) != filteredTechTreeList.end()) {
|
std::find(filteredTechTreeList.begin(),filteredTechTreeList.end(),techName) != filteredTechTreeList.end()) {
|
||||||
|
|
||||||
runTechValidationForPath(techPath, techName, filteredFactionList,
|
runTechValidationForPath(techPath, techName, filteredFactionList,
|
||||||
|
|
|
@ -2005,7 +2005,7 @@ bool MenuStateConnectedGame::loadFactions(const GameSettings *gameSettings, bool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(results.size() == 0) {
|
if(results.empty() == true) {
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
NetworkManager &networkManager= NetworkManager::getInstance();
|
NetworkManager &networkManager= NetworkManager::getInstance();
|
||||||
|
|
|
@ -1523,7 +1523,7 @@ void MenuStateCustomGame::update() {
|
||||||
ServerInterface* serverInterface= NetworkManager::getInstance().getServerInterface();
|
ServerInterface* serverInterface= NetworkManager::getInstance().getServerInterface();
|
||||||
Lang& lang= Lang::getInstance();
|
Lang& lang= Lang::getInstance();
|
||||||
|
|
||||||
bool haveAtLeastOneNetworkClientConnected = false;
|
//bool haveAtLeastOneNetworkClientConnected = false;
|
||||||
bool hasOneNetworkSlotOpen = false;
|
bool hasOneNetworkSlotOpen = false;
|
||||||
int currentConnectionCount=0;
|
int currentConnectionCount=0;
|
||||||
Config &config = Config::getInstance();
|
Config &config = Config::getInstance();
|
||||||
|
@ -1696,7 +1696,7 @@ void MenuStateCustomGame::update() {
|
||||||
|
|
||||||
//printf("FYI we have at least 1 client connected, slot = %d'\n",i);
|
//printf("FYI we have at least 1 client connected, slot = %d'\n",i);
|
||||||
|
|
||||||
haveAtLeastOneNetworkClientConnected = true;
|
//haveAtLeastOneNetworkClientConnected = true;
|
||||||
if(serverInterface->getSlot(i) != NULL &&
|
if(serverInterface->getSlot(i) != NULL &&
|
||||||
serverInterface->getSlot(i)->getConnectHasHandshaked()) {
|
serverInterface->getSlot(i)->getConnectHasHandshaked()) {
|
||||||
currentConnectionCount++;
|
currentConnectionCount++;
|
||||||
|
@ -2023,7 +2023,7 @@ void MenuStateCustomGame::simpleTask(BaseThread *callingThread) {
|
||||||
//printf("-=-=-=-=- IN MenuStateCustomGame simpleTask - B\n");
|
//printf("-=-=-=-=- IN MenuStateCustomGame simpleTask - B\n");
|
||||||
|
|
||||||
MutexSafeWrapper safeMutex(callingThread->getMutexThreadObjectAccessor(),string(__FILE__) + "_" + intToStr(__LINE__));
|
MutexSafeWrapper safeMutex(callingThread->getMutexThreadObjectAccessor(),string(__FILE__) + "_" + intToStr(__LINE__));
|
||||||
bool republish = (needToRepublishToMasterserver == true && publishToServerInfo.size() != 0);
|
bool republish = (needToRepublishToMasterserver == true && publishToServerInfo.empty() == false);
|
||||||
needToRepublishToMasterserver = false;
|
needToRepublishToMasterserver = false;
|
||||||
std::map<string,string> newPublishToServerInfo = publishToServerInfo;
|
std::map<string,string> newPublishToServerInfo = publishToServerInfo;
|
||||||
publishToServerInfo.clear();
|
publishToServerInfo.clear();
|
||||||
|
@ -2336,11 +2336,10 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings) {
|
||||||
factionCRCList.clear();
|
factionCRCList.clear();
|
||||||
for(unsigned int factionIdx = 0; factionIdx < factionFiles.size(); ++factionIdx) {
|
for(unsigned int factionIdx = 0; factionIdx < factionFiles.size(); ++factionIdx) {
|
||||||
string factionName = factionFiles[factionIdx];
|
string factionName = factionFiles[factionIdx];
|
||||||
int32 factionCRC = 0;
|
|
||||||
if(factionName != GameConstants::RANDOMFACTION_SLOTNAME &&
|
if(factionName != GameConstants::RANDOMFACTION_SLOTNAME &&
|
||||||
factionName != GameConstants::OBSERVER_SLOTNAME) {
|
factionName != GameConstants::OBSERVER_SLOTNAME) {
|
||||||
//factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + gameSettings->getTech() + "/factions/" + factionName + "/*", ".xml", NULL, true);
|
//factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + gameSettings->getTech() + "/factions/" + factionName + "/*", ".xml", NULL, true);
|
||||||
factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + gameSettings->getTech() + "/factions/" + factionName + "/*", ".xml", NULL);
|
int32 factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + gameSettings->getTech() + "/factions/" + factionName + "/*", ".xml", NULL);
|
||||||
if(factionCRC == 0) {
|
if(factionCRC == 0) {
|
||||||
factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + gameSettings->getTech() + "/factions/" + factionName + "/*", ".xml", NULL, true);
|
factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + gameSettings->getTech() + "/factions/" + factionName + "/*", ".xml", NULL, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1780,7 +1780,7 @@ void ServerInterface::simpleTask(BaseThread *callingThread) {
|
||||||
|
|
||||||
CURL *handle = SystemFlags::initHTTP();
|
CURL *handle = SystemFlags::initHTTP();
|
||||||
for(std::map<string,string>::const_iterator iterMap = newPublishToServerInfo.begin();
|
for(std::map<string,string>::const_iterator iterMap = newPublishToServerInfo.begin();
|
||||||
iterMap != newPublishToServerInfo.end(); iterMap++) {
|
iterMap != newPublishToServerInfo.end(); ++iterMap) {
|
||||||
|
|
||||||
request += iterMap->first;
|
request += iterMap->first;
|
||||||
request += "=";
|
request += "=";
|
||||||
|
|
|
@ -2147,7 +2147,7 @@ string Unit::getDescExtension() const{
|
||||||
str+= "\n" + lang.get("OrdersOnQueue") + ": ";
|
str+= "\n" + lang.get("OrdersOnQueue") + ": ";
|
||||||
}
|
}
|
||||||
str+= "\n#" + intToStr(i + 1) + " " + ct->getName();
|
str+= "\n#" + intToStr(i + 1) + " " + ct->getName();
|
||||||
it++;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ bool AttackBoost::isAffected(const Unit *source, const Unit *dest) const {
|
||||||
bool destUnitMightApply = false;
|
bool destUnitMightApply = false;
|
||||||
// All units are affected (including enemies)
|
// All units are affected (including enemies)
|
||||||
if(targetType == abtAll) {
|
if(targetType == abtAll) {
|
||||||
destUnitMightApply = (boostUnitList.size() == 0);
|
destUnitMightApply = (boostUnitList.empty() == true);
|
||||||
|
|
||||||
// Specify which units are affected
|
// Specify which units are affected
|
||||||
for(unsigned int i = 0; i < boostUnitList.size(); ++i) {
|
for(unsigned int i = 0; i < boostUnitList.size(); ++i) {
|
||||||
|
@ -66,10 +66,10 @@ bool AttackBoost::isAffected(const Unit *source, const Unit *dest) const {
|
||||||
}
|
}
|
||||||
// Only same faction units are affected
|
// Only same faction units are affected
|
||||||
else if(targetType == abtFaction) {
|
else if(targetType == abtFaction) {
|
||||||
//if(boostUnitList.size() == 0) {
|
//if(boostUnitList.empty() == true) {
|
||||||
if(source->getFactionIndex() == dest->getFactionIndex()) {
|
if(source->getFactionIndex() == dest->getFactionIndex()) {
|
||||||
//destUnitMightApply = true;
|
//destUnitMightApply = true;
|
||||||
destUnitMightApply = (boostUnitList.size() == 0);
|
destUnitMightApply = (boostUnitList.empty() == true);
|
||||||
|
|
||||||
// Specify which units are affected
|
// Specify which units are affected
|
||||||
for(unsigned int i = 0; i < boostUnitList.size(); ++i) {
|
for(unsigned int i = 0; i < boostUnitList.size(); ++i) {
|
||||||
|
@ -85,10 +85,10 @@ bool AttackBoost::isAffected(const Unit *source, const Unit *dest) const {
|
||||||
}
|
}
|
||||||
// Only ally units are affected
|
// Only ally units are affected
|
||||||
else if(targetType == abtAlly) {
|
else if(targetType == abtAlly) {
|
||||||
//if(boostUnitList.size() == 0) {
|
//if(boostUnitList.empty() == true) {
|
||||||
if(source->isAlly(dest) == true) {
|
if(source->isAlly(dest) == true) {
|
||||||
//destUnitMightApply = true;
|
//destUnitMightApply = true;
|
||||||
destUnitMightApply = (boostUnitList.size() == 0);
|
destUnitMightApply = (boostUnitList.empty() == true);
|
||||||
|
|
||||||
// Specify which units are affected
|
// Specify which units are affected
|
||||||
for(unsigned int i = 0; i < boostUnitList.size(); ++i) {
|
for(unsigned int i = 0; i < boostUnitList.size(); ++i) {
|
||||||
|
@ -103,10 +103,10 @@ bool AttackBoost::isAffected(const Unit *source, const Unit *dest) const {
|
||||||
}
|
}
|
||||||
// Only foe units are affected
|
// Only foe units are affected
|
||||||
else if(targetType == abtFoe) {
|
else if(targetType == abtFoe) {
|
||||||
//if(boostUnitList.size() == 0) {
|
//if(boostUnitList.empty() == true) {
|
||||||
if(source->isAlly(dest) == false) {
|
if(source->isAlly(dest) == false) {
|
||||||
//destUnitMightApply = true;
|
//destUnitMightApply = true;
|
||||||
destUnitMightApply = (boostUnitList.size() == 0);
|
destUnitMightApply = (boostUnitList.empty() == true);
|
||||||
|
|
||||||
// Specify which units are affected
|
// Specify which units are affected
|
||||||
for(unsigned int i = 0; i < boostUnitList.size(); ++i) {
|
for(unsigned int i = 0; i < boostUnitList.size(); ++i) {
|
||||||
|
@ -209,7 +209,7 @@ void SkillType::load(const XmlNode *sn, const string &dir, const TechTree *tt,
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line %d] WARNING CANNOT LOAD MODEL [%s] for parentLoader [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str(),parentLoader.c_str());
|
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line %d] WARNING CANNOT LOAD MODEL [%s] for parentLoader [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str(),parentLoader.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(animations.size() <= 0) {
|
if(animations.empty() == true) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"Error no animations found for skill [%s] for parentLoader [%s]",name.c_str(),parentLoader.c_str());
|
sprintf(szBuf,"Error no animations found for skill [%s] for parentLoader [%s]",name.c_str(),parentLoader.c_str());
|
||||||
throw runtime_error(szBuf);
|
throw runtime_error(szBuf);
|
||||||
|
|
|
@ -208,12 +208,12 @@ std::vector<std::string> TechTree::validateFactionTypes() {
|
||||||
std::vector<std::string> results;
|
std::vector<std::string> results;
|
||||||
for (int i = 0; i < factionTypes.size(); ++i) {
|
for (int i = 0; i < factionTypes.size(); ++i) {
|
||||||
std::vector<std::string> factionResults = factionTypes[i].validateFactionType();
|
std::vector<std::string> factionResults = factionTypes[i].validateFactionType();
|
||||||
if(factionResults.size() > 0) {
|
if(factionResults.empty() == false) {
|
||||||
results.insert(results.end(), factionResults.begin(), factionResults.end());
|
results.insert(results.end(), factionResults.begin(), factionResults.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
factionResults = factionTypes[i].validateFactionTypeUpgradeTypes();
|
factionResults = factionTypes[i].validateFactionTypeUpgradeTypes();
|
||||||
if(factionResults.size() > 0) {
|
if(factionResults.empty() == false) {
|
||||||
results.insert(results.end(), factionResults.begin(), factionResults.end());
|
results.insert(results.end(), factionResults.begin(), factionResults.end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,7 @@ std::vector<std::string> TechTree::validateResourceTypes() {
|
||||||
//printf("Validating [%d / %d] faction [%s]\n",i,(int)factionTypes.size(),factionTypes[i].getName().c_str());
|
//printf("Validating [%d / %d] faction [%s]\n",i,(int)factionTypes.size(),factionTypes[i].getName().c_str());
|
||||||
|
|
||||||
std::vector<std::string> factionResults = factionTypes[i].validateFactionTypeResourceTypes(resourceTypes);
|
std::vector<std::string> factionResults = factionTypes[i].validateFactionTypeResourceTypes(resourceTypes);
|
||||||
if(factionResults.size() > 0) {
|
if(factionResults.empty() == false) {
|
||||||
results.insert(results.end(), factionResults.begin(), factionResults.end());
|
results.insert(results.end(), factionResults.begin(), factionResults.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ std::vector<std::string> TechTree::validateResourceTypes() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(resourceTypesNotUsed.size() > 0) {
|
if(resourceTypesNotUsed.empty() == false) {
|
||||||
//printf("FOUND unused resource Types [%d]\n",(int)resourceTypesNotUsed.size());
|
//printf("FOUND unused resource Types [%d]\n",(int)resourceTypesNotUsed.size());
|
||||||
|
|
||||||
for (unsigned int i = 0; i < resourceTypesNotUsed.size(); ++i) {
|
for (unsigned int i = 0; i < resourceTypesNotUsed.size(); ++i) {
|
||||||
|
|
|
@ -1280,7 +1280,7 @@ void World::initFactionTypes(GameSettings *gs) {
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(factions.size() > 0) {
|
if(factions.empty() == false) {
|
||||||
thisTeamIndex= getFaction(thisFactionIndex)->getTeam();
|
thisTeamIndex= getFaction(thisFactionIndex)->getTeam();
|
||||||
}
|
}
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
|
@ -81,6 +81,22 @@ MainWindow::MainWindow(string appPath)
|
||||||
, glCanvas(NULL)
|
, glCanvas(NULL)
|
||||||
, program(NULL), boxsizer(NULL), startupSettingsInited(false) {
|
, program(NULL), boxsizer(NULL), startupSettingsInited(false) {
|
||||||
|
|
||||||
|
menuFile=NULL;
|
||||||
|
menuEdit=NULL;
|
||||||
|
menuEditMirror=NULL;
|
||||||
|
menuView=NULL;
|
||||||
|
menuBrush=NULL;
|
||||||
|
menuBrushHeight=NULL;
|
||||||
|
menuBrushGradient=NULL;
|
||||||
|
menuBrushSurface=NULL;
|
||||||
|
menuBrushObject=NULL;
|
||||||
|
menuBrushResource=NULL;
|
||||||
|
menuBrushStartLocation=NULL;
|
||||||
|
menuRadius=NULL;
|
||||||
|
fileDialog=NULL;
|
||||||
|
resourceUnderMouse=0;
|
||||||
|
objectUnderMouse=0;
|
||||||
|
|
||||||
this->appPath = appPath;
|
this->appPath = appPath;
|
||||||
Properties::setApplicationPath(executable_path(appPath));
|
Properties::setApplicationPath(executable_path(appPath));
|
||||||
|
|
||||||
|
@ -523,12 +539,11 @@ void MainWindow::onMouseMove(wxMouseEvent &event, int x, int y) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bool repaint = false;
|
bool repaint = false;
|
||||||
int dif;
|
|
||||||
if (event.LeftIsDown()) {
|
if (event.LeftIsDown()) {
|
||||||
change(x, y);
|
change(x, y);
|
||||||
repaint = true;
|
repaint = true;
|
||||||
} else if (event.MiddleIsDown()) {
|
} else if (event.MiddleIsDown()) {
|
||||||
dif = (y - lastY);
|
int dif = (y - lastY);
|
||||||
if (dif != 0) {
|
if (dif != 0) {
|
||||||
program->incCellSize(dif / abs(dif));
|
program->incCellSize(dif / abs(dif));
|
||||||
repaint = true;
|
repaint = true;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user