v0.3.1: improved brightness controls, no longer cause color distortion. Also slightly tweaked fog coloration.

This commit is contained in:
Evan Debenham
2015-06-28 18:44:00 -04:00
committed by Evan Debenham
parent 788937fbc1
commit d51a8b6182
2 changed files with 13 additions and 12 deletions
@@ -33,7 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
public class FogOfWar extends Image { public class FogOfWar extends Image {
private static final int VISIBLE = 0x00000000; 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 MAPPED = 0xcc442211;
private static final int INVISIBLE = 0xFF000000; private static final int INVISIBLE = 0xFF000000;
@@ -199,6 +199,7 @@ public class GameScene extends PixelScene {
add( emitters ); add( emitters );
add( effects ); add( effects );
add( emoicons );
gases = new Group(); gases = new Group();
add( gases ); add( gases );
@@ -207,27 +208,24 @@ public class GameScene extends PixelScene {
blob.emitter = null; blob.emitter = null;
addBlobSprite( blob ); addBlobSprite( blob );
} }
fog = new FogOfWar( Level.WIDTH, Level.HEIGHT ); fog = new FogOfWar( Level.WIDTH, Level.HEIGHT );
fog.updateVisibility( Dungeon.visible, Dungeon.level.visited, Dungeon.level.mapped ); fog.updateVisibility( Dungeon.visible, Dungeon.level.visited, Dungeon.level.mapped );
add( fog ); add( fog );
brightness( ShatteredPixelDungeon.brightness() ); brightness( ShatteredPixelDungeon.brightness() );
spells = new Group(); spells = new Group();
add( spells ); add( spells );
statuses = new Group(); statuses = new Group();
add( statuses ); add( statuses );
add( emoicons );
hero = new HeroSprite(); hero = new HeroSprite();
hero.place( Dungeon.hero.pos ); hero.place( Dungeon.hero.pos );
hero.updateArmor(); hero.updateArmor();
mobs.add( hero ); mobs.add( hero );
add( new HealthIndicator() ); add( new HealthIndicator() );
add( cellSelector = new CellSelector( tiles ) ); add( cellSelector = new CellSelector( tiles ) );
@@ -438,11 +436,14 @@ public class GameScene extends PixelScene {
} }
public void brightness( int value ) { public void brightness( int value ) {
water.rm = water.gm = water.bm = float shift;
tiles.rm = tiles.gm = tiles.bm = if (value >= 0)
1.0f + (value/4f); shift = value/2f;
fog.am = 1f + (value/2f); else
fog.aa = 0f - (value/2f); shift = value/3f;
fog.am = 1f + shift;
fog.aa = 0f - shift;
} }
private void addHeapSprite( Heap heap ) { private void addHeapSprite( Heap heap ) {