diff --git a/mk/windoze/g3d_viewer.vcproj b/mk/windoze/g3d_viewer.vcproj index 0f205176e..5bea94f94 100755 --- a/mk/windoze/g3d_viewer.vcproj +++ b/mk/windoze/g3d_viewer.vcproj @@ -45,6 +45,7 @@ MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" + EnableEnhancedInstructionSet="1" UsePrecompiledHeader="0" PrecompiledHeaderThrough="" PrecompiledHeaderFile="" diff --git a/mk/windoze/glest_editor.vcproj b/mk/windoze/glest_editor.vcproj index 3ffc9b1f2..e421fe1d7 100755 --- a/mk/windoze/glest_editor.vcproj +++ b/mk/windoze/glest_editor.vcproj @@ -45,6 +45,7 @@ MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" + EnableEnhancedInstructionSet="1" UsePrecompiledHeader="0" PrecompiledHeaderThrough="" PrecompiledHeaderFile="" diff --git a/mk/windoze/glest_game.vcproj b/mk/windoze/glest_game.vcproj index 62fcc66c1..6c191b8c1 100755 --- a/mk/windoze/glest_game.vcproj +++ b/mk/windoze/glest_game.vcproj @@ -52,11 +52,11 @@ BasicRuntimeChecks="3" SmallerTypeCheck="true" RuntimeLibrary="1" - EnableEnhancedInstructionSet="2" + EnableEnhancedInstructionSet="1" FloatingPointModel="2" UsePrecompiledHeader="0" PrecompiledHeaderThrough="" - PrecompiledHeaderFile="c:\temp\glest\$(TargetName).pch" + PrecompiledHeaderFile="" ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb" BrowseInformation="1" WarningLevel="2" diff --git a/mk/windoze/libstreflop.vcproj b/mk/windoze/libstreflop.vcproj index a7d89df4b..4e88b1d90 100644 --- a/mk/windoze/libstreflop.vcproj +++ b/mk/windoze/libstreflop.vcproj @@ -45,6 +45,7 @@ MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" + EnableEnhancedInstructionSet="1" ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb" WarningLevel="3" DebugInformationFormat="4" diff --git a/mk/windoze/shared_lib.vcproj b/mk/windoze/shared_lib.vcproj index 32c15f4a1..8179adbc2 100755 --- a/mk/windoze/shared_lib.vcproj +++ b/mk/windoze/shared_lib.vcproj @@ -48,11 +48,12 @@ SmallerTypeCheck="true" RuntimeLibrary="1" EnableFunctionLevelLinking="true" + EnableEnhancedInstructionSet="1" FloatingPointModel="2" RuntimeTypeInfo="true" UsePrecompiledHeader="0" PrecompiledHeaderThrough="" - PrecompiledHeaderFile="c:\temp\glest\$(TargetName).pch" + PrecompiledHeaderFile="" ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb" WarningLevel="2" DebugInformationFormat="4" diff --git a/source/glest_game/graphics/renderer.cpp b/source/glest_game/graphics/renderer.cpp index 02685ebab..371b668d8 100644 --- a/source/glest_game/graphics/renderer.cpp +++ b/source/glest_game/graphics/renderer.cpp @@ -1338,7 +1338,7 @@ void Renderer::renderSurface(const int renderFps, const int worldFrameCount) { glEnd(); } } - glEnd(); + //glEnd(); //Restore static_cast(modelRenderer)->setDuplicateTexCoords(false); diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index 7b1712c97..8a1de47a4 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -1141,7 +1141,7 @@ void MenuStateCustomGame::update() { { GameSettings gameSettings; loadGameSettings(&gameSettings); - serverInterface->setGameSettings(&gameSettings); + serverInterface->setGameSettings(&gameSettings,false); needToSetChangedGameSettings = false; } @@ -1343,7 +1343,7 @@ void MenuStateCustomGame::simpleTask() { loadGameSettings(&gameSettings); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); - serverInterface->setGameSettings(&gameSettings); + serverInterface->setGameSettings(&gameSettings,false); safeMutex2.ReleaseLock(); if(hasClientConnection == true) { diff --git a/source/glest_game/network/network_manager.cpp b/source/glest_game/network/network_manager.cpp index 5b984de7a..b1cbc0651 100644 --- a/source/glest_game/network/network_manager.cpp +++ b/source/glest_game/network/network_manager.cpp @@ -80,13 +80,13 @@ GameNetworkInterface* NetworkManager::getGameNetworkInterface(){ ServerInterface* NetworkManager::getServerInterface(){ assert(gameNetworkInterface!=NULL); assert(networkRole==nrServer); - return static_cast(gameNetworkInterface); + return dynamic_cast(gameNetworkInterface); } ClientInterface* NetworkManager::getClientInterface(){ assert(gameNetworkInterface!=NULL); assert(networkRole==nrClient); - return static_cast(gameNetworkInterface); + return dynamic_cast(gameNetworkInterface); } }}//end namespace diff --git a/source/glest_game/network/network_message.h b/source/glest_game/network/network_message.h index cad489fc4..1090e80a8 100644 --- a/source/glest_game/network/network_message.h +++ b/source/glest_game/network/network_message.h @@ -345,7 +345,7 @@ class NetworkMessageSynchNetworkGameData: public NetworkMessage{ private: static const int maxStringSize= 255; -static const int maxFileCRCCount= 5000; +static const int maxFileCRCCount= 2500; static const int maxFileCRCPacketCount= 100; private: @@ -417,7 +417,7 @@ class NetworkMessageSynchNetworkGameDataStatus: public NetworkMessage{ private: static const int maxStringSize= 255; -static const int maxFileCRCCount= 5000; +static const int maxFileCRCCount= 2500; static const int maxFileCRCPacketCount= 100; private: diff --git a/source/glest_game/network/server_interface.cpp b/source/glest_game/network/server_interface.cpp index 63b35c625..7f4e74ccc 100644 --- a/source/glest_game/network/server_interface.cpp +++ b/source/glest_game/network/server_interface.cpp @@ -1219,8 +1219,7 @@ int ServerInterface::getOpenSlotCount() { return openSlotCount; } -void ServerInterface::setGameSettings(GameSettings *serverGameSettings, bool waitForClientAck) -{ +void ServerInterface::setGameSettings(GameSettings *serverGameSettings, bool waitForClientAck) { SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s] START gameSettingsUpdateCount = %d, waitForClientAck = %d\n",__FILE__,__FUNCTION__,gameSettingsUpdateCount,waitForClientAck); MutexSafeWrapper safeMutex(&serverSynchAccessor); diff --git a/source/glest_game/network/server_interface.h b/source/glest_game/network/server_interface.h index b865809ff..ed8f981bc 100644 --- a/source/glest_game/network/server_interface.h +++ b/source/glest_game/network/server_interface.h @@ -72,7 +72,7 @@ public: int getOpenSlotCount(); bool launchGame(const GameSettings* gameSettings); - virtual void setGameSettings(GameSettings *serverGameSettings, bool waitForClientAck = false); + void setGameSettings(GameSettings *serverGameSettings, bool waitForClientAck); void broadcastGameSetup(const GameSettings* gameSettings); void updateListen(); virtual bool getConnectHasHandshaked() const { return false; } diff --git a/source/shared_lib/include/graphics/particle.h b/source/shared_lib/include/graphics/particle.h index 1a8929f50..77a93ecf5 100644 --- a/source/shared_lib/include/graphics/particle.h +++ b/source/shared_lib/include/graphics/particle.h @@ -40,12 +40,6 @@ class Model; // class Particle // ===================================================== -enum State{ - sPause, // No updates - sPlay, - sFade // No new particles -}; - class Particle { public: //attributes @@ -72,8 +66,6 @@ public: int getEnergy() const {return energy;} }; -class ParticleSystem; - // ===================================================== // class ParticleObserver // ===================================================== @@ -88,14 +80,20 @@ public: // class ParticleSystem // ===================================================== -class ParticleSystem{ -public: - enum BlendMode{ - bmOne, - bmOneMinusAlpha - }; +class ParticleSystem { -protected: +public: + +enum State{ + sPause, // No updates + sPlay, + sFade // No new particles +}; + +enum BlendMode{ + bmOne, + bmOneMinusAlpha +}; protected: diff --git a/source/shared_lib/sources/graphics/particle.cpp b/source/shared_lib/sources/graphics/particle.cpp index 0f90057cc..75dfbd226 100644 --- a/source/shared_lib/sources/graphics/particle.cpp +++ b/source/shared_lib/sources/graphics/particle.cpp @@ -93,7 +93,7 @@ void ParticleSystem::update() { } } - if(state != sFade){ + if(state != ParticleSystem::sFade){ for(int i = 0; i < emissionRate; ++i){ Particle *p = createParticle(); initParticle(p, i); @@ -920,20 +920,23 @@ void ParticleManager::update(int renderFps) { int particleSystemCount = particleSystems.size(); int particleCount = 0; - list::iterator it; - for (it=particleSystems.begin(); it!=particleSystems.end(); it++) { - particleCount += (*it)->getAliveParticleCount(); + list::iterator it; + for (it = particleSystems.begin(); it != particleSystems.end(); it++) { + ParticleSystem *ps = *it; + if(ps != NULL) { + particleCount += ps->getAliveParticleCount(); - bool showParticle = true; - if( dynamic_cast((*it)) != NULL || - dynamic_cast((*it)) != NULL ) { - showParticle = (*it)->getVisible() || ((*it)->getState() == sFade); - } - if(showParticle == true) { - (*it)->update(); - if((*it)->isEmpty()) { - delete *it; - *it= NULL; + bool showParticle = true; + if( dynamic_cast(ps) != NULL || + dynamic_cast(ps) != NULL ) { + showParticle = ps->getVisible() || (ps->getState() == ParticleSystem::sFade); + } + if(showParticle == true) { + ps->update(); + if(ps->isEmpty()) { + delete ps; + *it= NULL; + } } } }