From efd506dda79bd4dbc94884eda13b5b75dae814f1 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 12 Jul 2015 19:22:59 -0400 Subject: [PATCH] v0.3.1: tweaked existing scenes to support new audio functionality --- .../shatteredpixeldungeon/ShatteredPixelDungeon.java | 1 + .../shatteredpixeldungeon/scenes/GameScene.java | 4 ++-- .../shatteredpixeldungeon/scenes/InterlevelScene.java | 3 ++- .../shatteredpixeldungeon/scenes/RankingsScene.java | 4 ++-- .../shatteredpixeldungeon/scenes/SurfaceScene.java | 3 ++- .../shatteredpixeldungeon/scenes/TitleScene.java | 4 ++-- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java b/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java index 2a63d291f..a72459abd 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java @@ -118,6 +118,7 @@ public class ShatteredPixelDungeon extends Game { Music.INSTANCE.enable( music() ); Sample.INSTANCE.enable( soundFx() ); + Sample.INSTANCE.volume( SFXVol()/10f ); Sample.INSTANCE.load( Assets.SND_CLICK, diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index 6a7a60639..d8f399596 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -133,8 +133,8 @@ public class GameScene extends PixelScene { public void create() { Music.INSTANCE.play( Assets.TUNE, true ); - Music.INSTANCE.volume( 1f ); - + Music.INSTANCE.volume( ShatteredPixelDungeon.musicVol()/10f ); + ShatteredPixelDungeon.lastClass(Dungeon.hero.heroClass.ordinal()); super.create(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java index 2adc2e36c..eadeff565 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; @@ -183,7 +184,7 @@ public class InterlevelScene extends PixelScene { message.alpha( p ); if (mode == Mode.CONTINUE || (mode == Mode.DESCEND && Dungeon.depth == 1)) { - Music.INSTANCE.volume( p ); + Music.INSTANCE.volume( p * (ShatteredPixelDungeon.musicVol()/10f)); } if ((timeLeft -= Game.elapsed) <= 0) { Game.switchScene( GameScene.class ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/RankingsScene.java b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/RankingsScene.java index 05fc8b323..fc62912c8 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/RankingsScene.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/RankingsScene.java @@ -63,8 +63,8 @@ public class RankingsScene extends PixelScene { super.create(); Music.INSTANCE.play( Assets.THEME, true ); - Music.INSTANCE.volume( 1f ); - + Music.INSTANCE.volume( ShatteredPixelDungeon.musicVol() / 10f ); + uiCamera.visible = false; int w = Camera.main.width; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/SurfaceScene.java b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/SurfaceScene.java index 13a867784..d4c61d03e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/SurfaceScene.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/SurfaceScene.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes; import java.nio.FloatBuffer; import java.util.Calendar; +import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.watabou.gltextures.Gradient; import com.watabou.gltextures.SmartTexture; import com.watabou.glwrap.Matrix; @@ -71,7 +72,7 @@ public class SurfaceScene extends PixelScene { super.create(); Music.INSTANCE.play( Assets.HAPPY, true ); - Music.INSTANCE.volume( 1f ); + Music.INSTANCE.volume( ShatteredPixelDungeon.musicVol() / 10f ); uiCamera.visible = false; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/TitleScene.java b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/TitleScene.java index f5eaa29e1..413cc2ba1 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/TitleScene.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/TitleScene.java @@ -64,8 +64,8 @@ public class TitleScene extends PixelScene { } Music.INSTANCE.play( Assets.THEME, true ); - Music.INSTANCE.volume( 1f ); - + Music.INSTANCE.volume( ShatteredPixelDungeon.musicVol() / 10f ); + uiCamera.visible = false; int w = Camera.main.width;