diff --git a/source/glest_game/ai/path_finder.cpp b/source/glest_game/ai/path_finder.cpp index cde7a82e..6dec3479 100644 --- a/source/glest_game/ai/path_finder.cpp +++ b/source/glest_game/ai/path_finder.cpp @@ -763,7 +763,7 @@ void PathFinder::astarJPS(std::map cameFrom, Node *& node, if(addToOpenSet(unit, node, finalPos, newPath, nodeLimitReached, maxNodeCount,&newNode, false) == true) { //cameFrom = node->pos; cameFrom[newPath]=node->pos; - foundQuickRoute = true; + //foundQuickRoute = true; //printf("#2 add node - current node [%s] next possible node [%s] canUnitMoveToCell [%d] posOpen [%d] isFreeCell [%d]\n",node->pos.getString().c_str(),newPath.getString().c_str(),canUnitMoveToCell,posOpen,isFreeCell); } diff --git a/source/glest_game/graphics/particle_type.cpp b/source/glest_game/graphics/particle_type.cpp index e0fcd1aa..bfb31181 100644 --- a/source/glest_game/graphics/particle_type.cpp +++ b/source/glest_game/graphics/particle_type.cpp @@ -52,6 +52,16 @@ ParticleSystemType::ParticleSystemType() { minHp=0; maxHp=0; minmaxIsPercent=false; + + modelCycle=0; + size=0; + sizeNoEnergy=0; + speed=0; + gravity=0; + emissionRate=0; + energyMax=0; + energyVar=0; + } ParticleSystemType::ParticleSystemType(const ParticleSystemType &src) { diff --git a/source/glest_game/graphics/renderer.cpp b/source/glest_game/graphics/renderer.cpp index c073a669..c05ec077 100644 --- a/source/glest_game/graphics/renderer.cpp +++ b/source/glest_game/graphics/renderer.cpp @@ -1021,7 +1021,7 @@ void Renderer::setupLighting() { if(timeFlow->isTotalNight()) { VisibleQuadContainerCache &qCache = getQuadCache(); if(qCache.visibleQuadUnitList.empty() == false) { - bool modelRenderStarted = false; + //bool modelRenderStarted = false; for(int visibleUnitIndex = 0; visibleUnitIndex < qCache.visibleQuadUnitList.size() && lightCount < maxLights; ++visibleUnitIndex) { @@ -9324,46 +9324,10 @@ void Renderer::renderMapPreview( const MapPreview *map, bool renderAll, assertGl(); - std::auto_ptr vertices(new Vec2f[map->getMaxFactions() * 4]); - std::auto_ptr colors(new Vec3f[map->getMaxFactions() * 4]); + Vec2f *vertices = new Vec2f[map->getMaxFactions() * 4]; + Vec3f *colors = new Vec3f[map->getMaxFactions() * 4]; for (int i = 0; i < map->getMaxFactions(); i++) { -/* - switch (i) { - case 0: - glColor3f(1.f, 0.f, 0.f); - break; - case 1: - glColor3f(0.f, 0.f, 1.f); - break; - case 2: - glColor3f(0.f, 1.f, 0.f); - break; - case 3: - glColor3f(1.f, 1.f, 0.f); - break; - case 4: - glColor3f(1.f, 1.f, 1.f); - break; - case 5: - glColor3f(0.f, 1.f, 0.8f); - break; - case 6: - glColor3f(1.f, 0.5f, 0.f); - break; - case 7: - glColor3f(1.f, 0.5f, 1.f); - break; - } - - glBegin(GL_LINES); - glVertex2f((map->getStartLocationX(i) - 1) * cellSize, clientH - (map->getStartLocationY(i) - 1) * cellSize); - glVertex2f((map->getStartLocationX(i) + 1) * cellSize + playerCrossSize, clientH - (map->getStartLocationY(i) + 1) * cellSize - playerCrossSize); - glVertex2f((map->getStartLocationX(i) - 1) * cellSize, clientH - (map->getStartLocationY(i) + 1) * cellSize - playerCrossSize); - glVertex2f((map->getStartLocationX(i) + 1) * cellSize + playerCrossSize, clientH - (map->getStartLocationY(i) - 1) * cellSize); - glEnd(); -*/ - Vec3f color; switch (i) { case 0: @@ -9392,21 +9356,21 @@ void Renderer::renderMapPreview( const MapPreview *map, bool renderAll, break; } - colors.get()[i*4] = color; - colors.get()[(i*4)+1] = color; - colors.get()[(i*4)+2] = color; - colors.get()[(i*4)+3] = color; + colors[i*4] = color; + colors[(i*4)+1] = color; + colors[(i*4)+2] = color; + colors[(i*4)+3] = color; - vertices.get()[i*4] = Vec2f((map->getStartLocationX(i) - 1) * cellSize, clientH - (map->getStartLocationY(i) - 1) * cellSize); - vertices.get()[(i*4)+1] = Vec2f((map->getStartLocationX(i) + 1) * cellSize + playerCrossSize, clientH - (map->getStartLocationY(i) + 1) * cellSize - playerCrossSize); - vertices.get()[(i*4)+2] = Vec2f((map->getStartLocationX(i) - 1) * cellSize, clientH - (map->getStartLocationY(i) + 1) * cellSize - playerCrossSize); - vertices.get()[(i*4)+3] = Vec2f((map->getStartLocationX(i) + 1) * cellSize + playerCrossSize, clientH - (map->getStartLocationY(i) - 1) * cellSize); + vertices[i*4] = Vec2f((map->getStartLocationX(i) - 1) * cellSize, clientH - (map->getStartLocationY(i) - 1) * cellSize); + vertices[(i*4)+1] = Vec2f((map->getStartLocationX(i) + 1) * cellSize + playerCrossSize, clientH - (map->getStartLocationY(i) + 1) * cellSize - playerCrossSize); + vertices[(i*4)+2] = Vec2f((map->getStartLocationX(i) - 1) * cellSize, clientH - (map->getStartLocationY(i) + 1) * cellSize - playerCrossSize); + vertices[(i*4)+3] = Vec2f((map->getStartLocationX(i) + 1) * cellSize + playerCrossSize, clientH - (map->getStartLocationY(i) - 1) * cellSize); } glEnableClientState(GL_COLOR_ARRAY); - glColorPointer(3, GL_FLOAT, 0, &colors.get()[0]); + glColorPointer(3, GL_FLOAT, 0, &colors[0]); glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, GL_FLOAT, 0, &vertices.get()[0]); + glVertexPointer(2, GL_FLOAT, 0, &vertices[0]); glDrawArrays(GL_LINES, 0, 4 * map->getMaxFactions()); glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); @@ -9431,6 +9395,9 @@ void Renderer::renderMapPreview( const MapPreview *map, bool renderAll, assertGl(); } + delete [] vertices; + delete [] colors; + assertGl(); } diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp index fccee4be..e72f130a 100644 --- a/source/glest_game/gui/gui.cpp +++ b/source/glest_game/gui/gui.cpp @@ -625,7 +625,7 @@ void Gui::mouseDownDisplayUnitSkills(int posDisplay) { k=0; } const CommandType *ctype=display.getCommandType(k); - if(ctype->getClass() == ccAttack) + if(ctype != NULL && ctype->getClass() == ccAttack) { if(ctype != NULL && unit->getFaction()->reqsOk(ctype)) { posDisplay=k; diff --git a/source/glest_game/gui/selection.cpp b/source/glest_game/gui/selection.cpp index 85135827..527d1800 100644 --- a/source/glest_game/gui/selection.cpp +++ b/source/glest_game/gui/selection.cpp @@ -260,7 +260,7 @@ void Selection::unitEvent(UnitObserver::Event event, const Unit *unit) { //notify gui only if no more units to execute the command //of course the selection changed, but this doesn't matter in this case. - if( selectedUnits.size()<1 ){ + if( selectedUnits.empty() == true ){ gui->onSelectionChanged(); } diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index b525ea78..54928827 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -265,24 +265,9 @@ static void cleanupProcessObjects() { printf("Waiting for the following threads to exit [" MG_SIZE_T_SPECIFIER "]:\n",Thread::getThreadList().size()); - //std::auto_ptr baseThreadTest(new FileCRCPreCacheThread()); - for(int i = 0; i < Thread::getThreadList().size(); ++i) { - //Thread *thr = Thread::getThreadList()[i]; - //printf("#1 Lagging thread typeid: %d [%s]\n,",typeid(thr),typeid(thr).name()); - - //BaseThread *baseThread = dynamic_cast(Thread::getThreadList()[i]); BaseThread *baseThread = dynamic_cast(Thread::getThreadList()[i]); - printf("Thread index: %d ptr [%p] isBaseThread: %d, Name: [%s]\n",i,baseThread,(baseThread != NULL),(baseThread != NULL ? baseThread->getUniqueID().c_str() : "")); - //printf("#2 Lagging thread typeid: %d [%s]\n,",typeid(baseThread),typeid(baseThread).name()); - - //if(baseThread != NULL && baseThread->getRunningStatus() == false) { - // baseThread->kill(); - //} - //BaseThread *baseThread2 = dynamic_cast(baseThreadTest.get()); - //printf("#3 Thread index: %d isBaseThread: %d, Name: [%s]\n",i,(baseThread2 != NULL),(baseThread2 != NULL ? baseThread2->getUniqueID().c_str() : "")); - //printf("#3 Lagging thread typeid: %d [%s]\n,",typeid(baseThread2),typeid(baseThread2).name()); } } } @@ -3985,7 +3970,7 @@ int glestMain(int argc, char** argv) { if(paramPartTokens.size() >= 2 && paramPartTokens[1].length() > 0) { vector paramPartTokens2; Tokenize(paramPartTokens[1],paramPartTokens2,","); - if(paramPartTokens2.size() >= 1 && paramPartTokens2[0].length() > 0) { + if(paramPartTokens2.empty() == false && paramPartTokens2[0].length() > 0) { string newMaxSeconds = paramPartTokens2[0]; time_t newTimeMaxSeconds = strToInt(newMaxSeconds); AutoTest::setMaxGameTime(newTimeMaxSeconds); diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index e4012942..6cca2239 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -1454,7 +1454,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){ } // Only allow changes after we get game settings from the server - if(clientInterface->isConnected() == true) { + if(clientInterface != NULL && clientInterface->isConnected() == true) { int myCurrentIndex= -1; for(int i= 0; i < GameConstants::maxPlayers; ++i) {// find my current index by looking at editable listBoxes if(//listBoxFactions[i].getEditable() && @@ -1589,7 +1589,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){ } ClientInterface* clientInterface= NetworkManager::getInstance().getClientInterface(); - if(clientInterface->isConnected()) { + if(clientInterface != NULL && clientInterface->isConnected()) { clientInterface->setGameSettingsReceived(false); clientInterface->sendSwitchSetupRequest( listBoxFactions[clientInterface->getPlayerIndex()].getSelectedItem(), diff --git a/source/glest_game/menu/menu_state_masterserver.cpp b/source/glest_game/menu/menu_state_masterserver.cpp index c3ea8b44..bf952a36 100644 --- a/source/glest_game/menu/menu_state_masterserver.cpp +++ b/source/glest_game/menu/menu_state_masterserver.cpp @@ -612,7 +612,7 @@ void MenuStateMasterserver::mouseClick(int x, int y, MouseButton mouseButton){ if(!clicked && userScrollBar.getElementCount()!=0){ for(int i = userScrollBar.getVisibleStart(); i <= userScrollBar.getVisibleEnd(); ++i) { if(userButtons[i]->getEnabled() == true && userButtons[i]->mouseClick(x, y)) { - clicked=true; + //clicked=true; if(!chatManager.getEditEnabled()) { chatManager.switchOnEdit(); diff --git a/source/glest_game/menu/menu_state_options_graphics.cpp b/source/glest_game/menu/menu_state_options_graphics.cpp index 05c2f372..21288973 100644 --- a/source/glest_game/menu/menu_state_options_graphics.cpp +++ b/source/glest_game/menu/menu_state_options_graphics.cpp @@ -51,10 +51,10 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m int leftLabelStart=50; int leftColumnStart=leftLabelStart+180; int rightLabelStart=450; - int rightColumnStart=rightLabelStart+280; + //int rightColumnStart=rightLabelStart+280; int buttonRowPos=50; int buttonStartPos=170; - int captionOffset=75; + //int captionOffset=75; int currentLabelStart=leftLabelStart; int currentColumnStart=leftColumnStart; int currentLine=700; @@ -305,7 +305,7 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m // end // external server port - currentLine-=lineOffset; + //currentLine-=lineOffset; // buttons buttonOk.registerGraphicComponent(containerName,"buttonOk"); diff --git a/source/glest_game/menu/menu_state_options_network.cpp b/source/glest_game/menu/menu_state_options_network.cpp index 56441992..cdfddeb3 100644 --- a/source/glest_game/menu/menu_state_options_network.cpp +++ b/source/glest_game/menu/menu_state_options_network.cpp @@ -48,10 +48,10 @@ MenuStateOptionsNetwork::MenuStateOptionsNetwork(Program *program, MainMenu *mai int leftLabelStart=50; int leftColumnStart=leftLabelStart+280; int rightLabelStart=450; - int rightColumnStart=rightLabelStart+280; + //int rightColumnStart=rightLabelStart+280; int buttonRowPos=50; int buttonStartPos=170; - int captionOffset=75; + //int captionOffset=75; int currentLabelStart=leftLabelStart; int currentColumnStart=leftColumnStart; int currentLine=700; @@ -319,7 +319,7 @@ void MenuStateOptionsNetwork::showMessageBox(const string &text, const string &h void MenuStateOptionsNetwork::mouseClick(int x, int y, MouseButton mouseButton){ - Config &config= Config::getInstance(); + //Config &config= Config::getInstance(); CoreData &coreData= CoreData::getInstance(); SoundRenderer &soundRenderer= SoundRenderer::getInstance(); diff --git a/source/glest_game/menu/menu_state_options_sound.cpp b/source/glest_game/menu/menu_state_options_sound.cpp index af6879b9..addbf856 100644 --- a/source/glest_game/menu/menu_state_options_sound.cpp +++ b/source/glest_game/menu/menu_state_options_sound.cpp @@ -51,7 +51,7 @@ MenuStateOptionsSound::MenuStateOptionsSound(Program *program, MainMenu *mainMen int rightColumnStart=rightLabelStart+280; int buttonRowPos=50; int buttonStartPos=170; - int captionOffset=75; + //int captionOffset=75; int currentLabelStart=leftLabelStart; int currentColumnStart=leftColumnStart; int currentLine=700; @@ -158,9 +158,9 @@ MenuStateOptionsSound::MenuStateOptionsSound(Program *program, MainMenu *mainMen ///////// RIGHT SIDE ////////////////////////////////////////////////////////////////// - currentLine=700; // reset line pos - currentLabelStart=rightLabelStart; // set to right side - currentColumnStart=rightColumnStart; // set to right side + //currentLine=700; // reset line pos + //currentLabelStart=rightLabelStart; // set to right side + //currentColumnStart=rightColumnStart; // set to right side // buttons @@ -248,7 +248,7 @@ void MenuStateOptionsSound::showMessageBox(const string &text, const string &hea void MenuStateOptionsSound::mouseClick(int x, int y, MouseButton mouseButton){ - Config &config= Config::getInstance(); + //Config &config= Config::getInstance(); CoreData &coreData= CoreData::getInstance(); SoundRenderer &soundRenderer= SoundRenderer::getInstance(); diff --git a/source/glest_game/network/client_interface.cpp b/source/glest_game/network/client_interface.cpp index 74bd6c7a..2f473d25 100644 --- a/source/glest_game/network/client_interface.cpp +++ b/source/glest_game/network/client_interface.cpp @@ -257,7 +257,7 @@ ClientInterface::~ClientInterface() { //printf("C === Client destructor\n"); - Mutex *tempMutexPtr = networkCommandListThreadAccessor; + //Mutex *tempMutexPtr = networkCommandListThreadAccessor; networkCommandListThreadAccessor = NULL; safeMutex.ReleaseLock(false,true); @@ -393,7 +393,7 @@ void ClientInterface::update() { lastSentFrameCount = currentFrameCount; sendMessage(&networkMessageCommandList); lastNetworkCommandListSendTime = time(NULL); - lastSendElapsed = difftime((long int)time(NULL),lastNetworkCommandListSendTime); + //lastSendElapsed = difftime((long int)time(NULL),lastNetworkCommandListSendTime); if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 1) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took %lld msecs\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis()); } @@ -1426,7 +1426,7 @@ void ClientInterface::waitUntilReady(Checksum* checksum) { } } else if(networkMessageType == nmtCommandList) { - int waitCount = 0; + //int waitCount = 0; //make sure we read the message time_t receiveTimeElapsed = time(NULL); NetworkMessageCommandList networkMessageCommandList; diff --git a/source/glest_game/network/connection_slot.cpp b/source/glest_game/network/connection_slot.cpp index 092728af..6807ffc0 100644 --- a/source/glest_game/network/connection_slot.cpp +++ b/source/glest_game/network/connection_slot.cpp @@ -1257,7 +1257,7 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) { MutexSafeWrapper safeMutex(getServerSynchAccessor(),CODE_AT_LINE); int slotIdx = switchSetupRequest.getCurrentSlotIndex(); - int newSlotIdx = switchSetupRequest.getToSlotIndex(); + //int newSlotIdx = switchSetupRequest.getToSlotIndex(); //printf("slotIdx = %d newSlotIdx = %d\n",slotIdx,newSlotIdx); diff --git a/source/glest_game/network/network_interface.cpp b/source/glest_game/network/network_interface.cpp index c74e51fe..3884c00d 100644 --- a/source/glest_game/network/network_interface.cpp +++ b/source/glest_game/network/network_interface.cpp @@ -42,6 +42,12 @@ Vec3f MarkedCell::static_system_marker_color(MAGENTA.x,MAGENTA.y,MAGENTA.z); NetworkInterface::NetworkInterface() { networkAccessMutex = new Mutex(); + + networkGameDataSynchCheckOkMap=false; + networkGameDataSynchCheckOkTile=false; + networkGameDataSynchCheckOkTech=false; + receivedDataSynchCheck=false; + } NetworkInterface::~NetworkInterface() { diff --git a/source/glest_game/network/server_interface.cpp b/source/glest_game/network/server_interface.cpp index 8777603a..cdffd7c6 100644 --- a/source/glest_game/network/server_interface.cpp +++ b/source/glest_game/network/server_interface.cpp @@ -2160,7 +2160,7 @@ bool ServerInterface::launchGame(const GameSettings *gameSettings) { if(useInGameBlockingClientSockets == true) { if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); for(int i= 0; i < GameConstants::maxPlayers; ++i) { - int factionIndex = gameSettings->getFactionIndexForStartLocation(i); + //int factionIndex = gameSettings->getFactionIndexForStartLocation(i); MutexSafeWrapper safeMutexSlot(slotAccessorMutexes[i],CODE_AT_LINE_X(i)); ConnectionSlot *connectionSlot= slots[i]; if(connectionSlot != NULL && connectionSlot->isConnected()) { diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index bf7c2faf..2024b3ca 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -1816,17 +1816,7 @@ const CommandType *Unit::computeCommandType(const Vec2i &pos, const Unit *target targetUnit->getType() != NULL && targetUnit->getType()->getStore(this->getLoadType()) > 0) { - //const HarvestCommandType *previousHarvestCmd = this->getType()->getFirstHarvestCommand(this->getLoadType(),this->getFaction()); - //if(previousHarvestCmd != NULL) { - //printf("\n#1 return harvested resources\n\n"); - //this->setCurrSkill(previousHarvestCmd->getStopLoadedSkillType()); // make sure we use the right harvest animation commandType = type->getFirstHarvestEmergencyReturnCommand(); - //} - //else { - //printf("\n#2 return harvested resources\n\n"); - //this->setCurrSkill(hct->getStopLoadedSkillType()); - // commandType = type->getFirstHarvestEmergencyReturnCommand(); - //} } } } diff --git a/source/glest_game/types/command_type.cpp b/source/glest_game/types/command_type.cpp index 022f4322..69976d11 100644 --- a/source/glest_game/types/command_type.cpp +++ b/source/glest_game/types/command_type.cpp @@ -588,7 +588,7 @@ void HarvestEmergencyReturnCommandType::load(int id, const XmlNode *n, const str string HarvestEmergencyReturnCommandType::getDesc(const TotalUpgrade *totalUpgrade) const{ - Lang &lang= Lang::getInstance(); + //Lang &lang= Lang::getInstance(); string str; str=getName(true)+"\n"; diff --git a/source/glest_game/types/skill_type.cpp b/source/glest_game/types/skill_type.cpp index 4722be31..2bf67b35 100644 --- a/source/glest_game/types/skill_type.cpp +++ b/source/glest_game/types/skill_type.cpp @@ -30,7 +30,7 @@ namespace Glest{ namespace Game{ int SkillType::nextAttackBoostId = 0; -AttackBoost::AttackBoost() { +AttackBoost::AttackBoost() : boostUpgrade() { enabled = false; allowMultipleBoosts = false; radius = 0; diff --git a/source/glest_game/types/tileset_model_type.cpp b/source/glest_game/types/tileset_model_type.cpp index df213410..5bd08c5b 100644 --- a/source/glest_game/types/tileset_model_type.cpp +++ b/source/glest_game/types/tileset_model_type.cpp @@ -22,6 +22,7 @@ TilesetModelType::TilesetModelType() { model = NULL; height = 0; rotationAllowed = false; + smoothTwoFrameAnim = false; animSpeed = 0; } diff --git a/source/glest_game/world/tileset.h b/source/glest_game/world/tileset.h index 38b5bd63..1a9fa1e8 100644 --- a/source/glest_game/world/tileset.h +++ b/source/glest_game/world/tileset.h @@ -159,6 +159,10 @@ public: fogMode = 0; fogDensity = 0.0f; weather= wSunny; + + for(int index = 0; index < surfCount; ++index) { + partsArray[index] = 0; + } } ~Tileset(); Checksum loadTileset(const vector pathList, const string &tilesetName, diff --git a/source/shared_lib/sources/compression/compression_utils.cpp b/source/shared_lib/sources/compression/compression_utils.cpp index 4c97d971..5659576b 100644 --- a/source/shared_lib/sources/compression/compression_utils.cpp +++ b/source/shared_lib/sources/compression/compression_utils.cpp @@ -119,7 +119,9 @@ int zipfile_tool(int argc, const char *argv[]) { if ((file_loc < 0) || (file_loc > INT_MAX)) { // This is not a limitation of miniz or tinfl, but this example. - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("File is too large to be processed by this example.\n"); + printf("File is too large to be processed by this example.\n"); + + fclose(pInfile); return EXIT_FAILURE; } @@ -128,7 +130,9 @@ int zipfile_tool(int argc, const char *argv[]) { // Open output file. pOutfile = fopen(pDst_filename, "wb"); if (!pOutfile) { - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Failed opening output file!\n"); + printf("Failed opening output file!\n"); + + fclose(pInfile); return EXIT_FAILURE; } diff --git a/source/shared_lib/sources/graphics/gl/shader_gl.cpp b/source/shared_lib/sources/graphics/gl/shader_gl.cpp index d71754d9..bfdcbfb6 100644 --- a/source/shared_lib/sources/graphics/gl/shader_gl.cpp +++ b/source/shared_lib/sources/graphics/gl/shader_gl.cpp @@ -73,7 +73,7 @@ bool ShaderProgramGl::link(string &messages){ //bind attributes for(unsigned int i=0; i cleanupParticleSystemsList; + //vector cleanupParticleSystemsList; for(unsigned int i= 0; i < particleSystems.size(); i++){ ParticleSystem *ps= particleSystems[i]; if(ps != NULL){ diff --git a/source/shared_lib/sources/graphics/video_player.cpp b/source/shared_lib/sources/graphics/video_player.cpp index 4d4db608..1213f521 100644 --- a/source/shared_lib/sources/graphics/video_player.cpp +++ b/source/shared_lib/sources/graphics/video_player.cpp @@ -1318,10 +1318,11 @@ bool VideoPlayer::playFrame(bool swapBuffers) { return false; } - int action = 0, pause = 0, n = 0; if(successLoadingLib == true && ctxPtr != NULL && ctxPtr->isPlaying == true && finished == false && stop == false) { + + int action = 0, pause = 0, n = 0; action = 0; SDL_Event event; diff --git a/source/shared_lib/sources/platform/common/platform_common.cpp b/source/shared_lib/sources/platform/common/platform_common.cpp index 2258e36d..9acc70f1 100644 --- a/source/shared_lib/sources/platform/common/platform_common.cpp +++ b/source/shared_lib/sources/platform/common/platform_common.cpp @@ -813,7 +813,7 @@ time_t getFolderTreeContentsCheckSumRecursivelyLastGenerated(vector path std::pair cacheKeys = getFolderTreeContentsCheckSumCacheKey(paths, pathSearchString, filterFileExt); string cacheLookupId = cacheKeys.first; - std::map &crcTreeCache = CacheManager::getCachedItem< std::map >(cacheLookupId); + //std::map &crcTreeCache = CacheManager::getCachedItem< std::map >(cacheLookupId); string cacheKey = cacheKeys.second; string crcCacheFile = getFormattedCRCCacheFileName(cacheKeys); diff --git a/source/shared_lib/sources/platform/common/simple_threads.cpp b/source/shared_lib/sources/platform/common/simple_threads.cpp index 6c251b8b..07354442 100644 --- a/source/shared_lib/sources/platform/common/simple_threads.cpp +++ b/source/shared_lib/sources/platform/common/simple_threads.cpp @@ -91,7 +91,7 @@ void FileCRCPreCacheThread::execute() { techsPerWorker++; } - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] techsPerWorker = %d, MAX_FileCRCPreCacheThread_WORKER_THREADS = %d, techPaths.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,techsPerWorker,MAX_FileCRCPreCacheThread_WORKER_THREADS,(int)techPaths.size()); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] techsPerWorker = %u, MAX_FileCRCPreCacheThread_WORKER_THREADS = %d, techPaths.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,techsPerWorker,MAX_FileCRCPreCacheThread_WORKER_THREADS,(int)techPaths.size()); unsigned int consumedWorkers = 0; @@ -116,7 +116,7 @@ void FileCRCPreCacheThread::execute() { if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] Spawning CRC thread for Tech [%s] [%d of %d]\n",__FILE__,__FUNCTION__,__LINE__,techName.c_str(),idx+1,(int)techPaths.size()); } - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] workerIdx = %d, currentWorkerMax = %d, endConsumerIndex = %d\n",__FILE__,__FUNCTION__,__LINE__,workerIdx,currentWorkerMax,endConsumerIndex); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] workerIdx = %u, currentWorkerMax = %u, endConsumerIndex = %u\n",__FILE__,__FUNCTION__,__LINE__,workerIdx,currentWorkerMax,endConsumerIndex); // Pause before launching this worker thread time_t pauseTime = time(NULL); @@ -225,8 +225,8 @@ void FileCRCPreCacheThread::execute() { time_t elapsedTime = time(NULL); // Clear existing CRC to force a CRC refresh - string pathSearchString = string("/") + techName + string("/*"); - const string filterFileExt = ".xml"; + //string pathSearchString = string("/") + techName + string("/*"); + //const string filterFileExt = ".xml"; //clearFolderTreeContentsCheckSum(techDataPaths, pathSearchString, filterFileExt); //clearFolderTreeContentsCheckSumList(techDataPaths, pathSearchString, filterFileExt); diff --git a/source/shared_lib/sources/platform/posix/ircclient.cpp b/source/shared_lib/sources/platform/posix/ircclient.cpp index 24a8f5c5..f4db9d22 100644 --- a/source/shared_lib/sources/platform/posix/ircclient.cpp +++ b/source/shared_lib/sources/platform/posix/ircclient.cpp @@ -282,13 +282,13 @@ void dcc_file_recv_callback (irc_session_t * session, irc_dcc_t id, int status, if ( ctx ) { fwrite (data, 1, length, (FILE*) ctx); } - if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("File sent progress: %d\n", length); + if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("File sent progress: %u\n", length); } } void event_channel(irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) { //IRC: Event "433", origin: "leguin.freenode.net", params: 3 [*|softcoder|Nickname is already in use.] - if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf("In [%s::%s] Line: %d count = %d origin = %s\n",__FILE__,__FUNCTION__,__LINE__,count,(origin ? origin : "null")); + if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf("In [%s::%s] Line: %d count = %u origin = %s\n",__FILE__,__FUNCTION__,__LINE__,count,(origin ? origin : "null")); if ( count != 2 ) return; @@ -403,7 +403,7 @@ void event_leave(irc_session_t *session, const char *event, const char *origin, } void event_numeric(irc_session_t * session, unsigned int event, const char * origin, const char ** params, unsigned int count) { char buf[24]=""; - sprintf (buf, "%d", event); + sprintf (buf, "%u", event); if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC: Line: %d event = %u\n", __LINE__, event); @@ -453,7 +453,7 @@ void event_numeric(irc_session_t * session, unsigned int event, const char * ori { if(event == LIBIRC_RFC_RPL_NAMREPLY) { - if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC: LIBIRC_RFC_RPL_NAMREPLY count = %d\n", count); + if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC: LIBIRC_RFC_RPL_NAMREPLY count = %u\n", count); std::vector nickList; if(count >= 4) { diff --git a/source/shared_lib/sources/platform/posix/miniftpclient.cpp b/source/shared_lib/sources/platform/posix/miniftpclient.cpp index f7c03246..f6c2209d 100644 --- a/source/shared_lib/sources/platform/posix/miniftpclient.cpp +++ b/source/shared_lib/sources/platform/posix/miniftpclient.cpp @@ -609,7 +609,7 @@ pair FTPClientThread::getTilesetFromServer( for(unsigned int i = 0; i < wantDirListOnly.size(); ++i) { string fileFromList = wantDirListOnly[i]; - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("fileFromList [%s] i [%d]\n",fileFromList.c_str(),i); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("fileFromList [%s] i [%u]\n",fileFromList.c_str(),i); if( fileFromList != "models" && fileFromList != "textures" && fileFromList != "sounds") { diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index 7acb848e..2cb1dca3 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -668,7 +668,6 @@ std::vector Socket::getLocalIPAddressList() { /* get my host name */ char myhostname[101]=""; gethostname(myhostname,100); - char myhostaddr[101] = ""; struct hostent* myhostent = gethostbyname(myhostname); if(myhostent) { @@ -733,6 +732,7 @@ std::vector Socket::getLocalIPAddressList() { struct sockaddr_in *pSockAddr = (struct sockaddr_in *)&ifr.ifr_addr; if(pSockAddr != NULL) { + char myhostaddr[101] = ""; Ip::Inet_NtoA(SockAddrToUint32(&pSockAddr->sin_addr), myhostaddr); if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] szBuf [%s], myhostaddr = [%s], ifr.ifr_flags = %d, ifrA.ifr_flags = %d, ifr.ifr_name [%s]\n",__FILE__,__FUNCTION__,__LINE__,szBuf,myhostaddr,ifr.ifr_flags,ifrA.ifr_flags,ifr.ifr_name);