From 7e7c7216a5ade0b8bf1559ae3692445b64d7a73e Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 15 Sep 2010 23:32:29 +0000 Subject: [PATCH] - fixed screen flickering of fog of war texture when staggered updates is enabled. --- source/glest_game/world/world.cpp | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/source/glest_game/world/world.cpp b/source/glest_game/world/world.cpp index 7d87353f..3175c245 100644 --- a/source/glest_game/world/world.cpp +++ b/source/glest_game/world/world.cpp @@ -1141,6 +1141,38 @@ void World::computeFow(int factionIdxToTick) { } } } + else { + // Deal with observers + for(int i = 0; i < map.getSurfaceW(); ++i) { + for(int j = 0; j < map.getSurfaceH(); ++j) { + for(int k = 0; k < GameConstants::maxPlayers + GameConstants::specialFactions; ++k) { + if(fogOfWar || k != thisTeamIndex) { + if(k == thisTeamIndex && thisTeamIndex == GameConstants::maxPlayers -1 + fpt_Observer) { + map.getSurfaceCell(i, j)->setVisible(k, true); + map.getSurfaceCell(i, j)->setExplored(k, true); + + const Vec2i pos(i,j); + //Vec2i surfPos= Map::toSurfCoords(pos); + Vec2i surfPos= pos; + + //compute max alpha + float maxAlpha= 0.0f; + if(surfPos.x>1 && surfPos.y>1 && surfPos.x0 && surfPos.y>0 && surfPos.x 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s] Line: %d took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis()); if(chrono.getMillis() > 0) chrono.start();