From d51a8b6182c5e4c717591b21bb783a4cd8615f97 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 28 Jun 2015 18:44:00 -0400 Subject: [PATCH] v0.3.1: improved brightness controls, no longer cause color distortion. Also slightly tweaked fog coloration. --- .../shatteredpixeldungeon/FogOfWar.java | 2 +- .../scenes/GameScene.java | 23 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/FogOfWar.java b/src/com/shatteredpixel/shatteredpixeldungeon/FogOfWar.java index fcef74ca2..118c7e2af 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/FogOfWar.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/FogOfWar.java @@ -33,7 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; public class FogOfWar extends Image { private static final int VISIBLE = 0x00000000; - private static final int VISITED = 0xcc111111; + private static final int VISITED = 0xcc000000; private static final int MAPPED = 0xcc442211; private static final int INVISIBLE = 0xFF000000; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index 803008598..6a7a60639 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -199,6 +199,7 @@ public class GameScene extends PixelScene { add( emitters ); add( effects ); + add( emoicons ); gases = new Group(); add( gases ); @@ -207,27 +208,24 @@ public class GameScene extends PixelScene { blob.emitter = null; addBlobSprite( blob ); } - + fog = new FogOfWar( Level.WIDTH, Level.HEIGHT ); fog.updateVisibility( Dungeon.visible, Dungeon.level.visited, Dungeon.level.mapped ); add( fog ); - + brightness( ShatteredPixelDungeon.brightness() ); - + spells = new Group(); add( spells ); statuses = new Group(); add( statuses ); - add( emoicons ); - hero = new HeroSprite(); hero.place( Dungeon.hero.pos ); hero.updateArmor(); mobs.add( hero ); - add( new HealthIndicator() ); add( cellSelector = new CellSelector( tiles ) ); @@ -438,11 +436,14 @@ public class GameScene extends PixelScene { } public void brightness( int value ) { - water.rm = water.gm = water.bm = - tiles.rm = tiles.gm = tiles.bm = - 1.0f + (value/4f); - fog.am = 1f + (value/2f); - fog.aa = 0f - (value/2f); + float shift; + if (value >= 0) + shift = value/2f; + else + shift = value/3f; + + fog.am = 1f + shift; + fog.aa = 0f - shift; } private void addHeapSprite( Heap heap ) {