ASYLUM: Implement MainMenu::adjustTextVolume

git-svn-id: http://asylumengine.googlecode.com/svn/trunk@606 0bfb4aae-4ea4-11de-8d8d-752d95cf3e3c
This commit is contained in:
Julien Templier 2010-12-01 19:22:17 +00:00 committed by Eugene Sandulenko
parent a326b61533
commit 7479a0f487
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
2 changed files with 32 additions and 12 deletions

View File

@ -189,16 +189,16 @@ MainMenu::MenuScreen MainMenu::findMousePosition() {
void MainMenu::playTestSounds() {
_testSoundsPlaying = true;
getSound()->playSound(MAKE_RESOURCE(kResourcePackShared, 42), true, Config.ambientVolume);
getSound()->playSound(MAKE_RESOURCE(kResourcePackShared, 41), true, Config.sfxVolume);
getSound()->playSound(MAKE_RESOURCE(kResourcePackShared, 43), true, Config.voiceVolume);
getSound()->playSound(kAmbiantSound, true, Config.ambientVolume);
getSound()->playSound(kSfxSound, true, Config.sfxVolume);
getSound()->playSound(kVoiceSound, true, Config.voiceVolume);
}
void MainMenu::stopTestSounds() {
_testSoundsPlaying = false;
getSound()->stop(MAKE_RESOURCE(kResourcePackShared, 42));
getSound()->stop(MAKE_RESOURCE(kResourcePackShared, 41));
getSound()->stop(MAKE_RESOURCE(kResourcePackShared, 43));
getSound()->stop(kAmbiantSound);
getSound()->stop(kSfxSound);
getSound()->stop(kVoiceSound);
}
void MainMenu::adjustMasterVolume(int32 delta) {
@ -256,7 +256,24 @@ void MainMenu::adjustMasterVolume(int32 delta) {
}
void MainMenu::adjustTestVolume() {
getSound()->setMusicVolume(Config.musicVolume);
if ((Config.movieVolume / 250 + 20) <= 0)
getSound()->playMusic(_musicResourceId, Config.musicVolume);
if (getSound()->isPlaying(kAmbiantSound))
getSound()->setVolume(kAmbiantSound, Config.ambientVolume);
else if (_testSoundsPlaying)
getSound()->playSound(kAmbiantSound, true, Config.ambientVolume);
if (getSound()->isPlaying(kSfxSound))
getSound()->setVolume(kSfxSound, Config.sfxVolume);
else if (_testSoundsPlaying)
getSound()->playSound(kSfxSound, true, Config.sfxVolume);
if (getSound()->isPlaying(kVoiceSound))
getSound()->setVolume(kVoiceSound, Config.voiceVolume);
else if (_testSoundsPlaying)
getSound()->playSound(kVoiceSound, true, Config.voiceVolume);
}
//////////////////////////////////////////////////////////////////////////

View File

@ -77,10 +77,13 @@ private:
};
enum MenuResource {
kBackground = MAKE_RESOURCE(kResourcePackShared, 0),
kEye = MAKE_RESOURCE(kResourcePackShared, 1),
kFontBlue = MAKE_RESOURCE(kResourcePackShared, 22),
kFontYellow = MAKE_RESOURCE(kResourcePackShared, 16)
kBackground = MAKE_RESOURCE(kResourcePackShared, 0),
kEye = MAKE_RESOURCE(kResourcePackShared, 1),
kFontBlue = MAKE_RESOURCE(kResourcePackShared, 22),
kFontYellow = MAKE_RESOURCE(kResourcePackShared, 16),
kSfxSound = MAKE_RESOURCE(kResourcePackShared, 41),
kAmbiantSound = MAKE_RESOURCE(kResourcePackShared, 42),
kVoiceSound = MAKE_RESOURCE(kResourcePackShared, 43)
};
// Game initialization
@ -152,9 +155,9 @@ private:
void stopTestSounds();
/**
* Adjust volume.
* Adjust volume.
*
* @param delta The delta.
* @param delta The delta.
*/
void adjustMasterVolume(int32 delta);