diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index 65583882c..41274a4d2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -228,17 +228,6 @@ public class GameScene extends PixelScene { mob.beckon( Dungeon.hero.pos ); } } - - add( emitters ); - add( effects ); - - gases = new Group(); - add( gases ); - - for (Blob blob : Dungeon.level.blobs.values()) { - blob.emitter = null; - addBlobSprite( blob ); - } walls = new DungeonWallsTilemap(); add(walls); @@ -246,6 +235,18 @@ public class GameScene extends PixelScene { wallBlocking = new WallBlockingTilemap(); add (wallBlocking); + add( emitters ); + add( effects ); + + gases = new Group(); + add( gases ); + + for (Blob blob : Dungeon.level.blobs.values()) { + blob.emitter = null; + addBlobSprite( blob ); + } + + fog = new FogOfWar( Dungeon.level.width(), Dungeon.level.height() ); add( fog ); @@ -707,6 +708,8 @@ public class GameScene extends PixelScene { scene.tiles.updateMapCell( cell ); scene.terrainFeatures.updateMapCell( cell ); scene.walls.updateMapCell( cell ); + scene.fog.updateFogCell( cell ); + scene.wallBlocking.updateMapCell( cell ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/FogOfWar.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/FogOfWar.java index 241d5daba..6257dfa57 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/FogOfWar.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/FogOfWar.java @@ -119,6 +119,10 @@ public class FogOfWar extends Image { updated.set( 0, 0, mapWidth, mapHeight ); } + public synchronized void updateFogCell( int cell ){ + updated.set( cell % mapWidth , cell / mapHeight, (cell % mapWidth)+1, (cell / mapHeight)+1 ); + } + public synchronized void updateFogArea(int x, int y, int w, int h){ updated.union(x, y); updated.union(x + w, y + h);