Implemented volume-bg and master volume setting.

- All sounds are now multiplied by a master volume setting.
- Changed all default volume levels.
- Scrolling in the main menu and game states changes the master volume and displays a volume bar on the right side of the screen.
- "volume-bg.png" image by @kouyang.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-01-20 14:52:02 -05:00
parent f9c0794693
commit 3b13cc794b
12 changed files with 150 additions and 10 deletions

View File

@@ -169,7 +169,7 @@ public class SoundController {
* @param s the sound effect
*/
public static void playSound(SoundComponent s) {
playClip(s.getClip(), Options.getEffectVolume());
playClip(s.getClip(), Options.getEffectVolume() * Options.getMasterVolume());
}
/**
@@ -180,7 +180,7 @@ public class SoundController {
if (hitSound < 0)
return;
float volume = Options.getHitSoundVolume() * sampleVolumeMultiplier;
float volume = Options.getHitSoundVolume() * sampleVolumeMultiplier * Options.getMasterVolume();
if (volume == 0f)
return;
@@ -202,7 +202,7 @@ public class SoundController {
* @param s the hit sound
*/
public static void playHitSound(SoundComponent s) {
playClip(s.getClip(), Options.getHitSoundVolume() * sampleVolumeMultiplier);
playClip(s.getClip(), Options.getHitSoundVolume() * sampleVolumeMultiplier * Options.getMasterVolume());
}
/**