fix SoundVolume and SoundVolumeAttract

This commit is contained in:
Glenn Maynard
2007-05-24 21:08:28 +00:00
parent 8daf0c49d3
commit 6ef2289ec0
3 changed files with 12 additions and 5 deletions
+10 -3
View File
@@ -28,7 +28,7 @@ ScreenAttract::ScreenAttract( bool bResetGameState )
void ScreenAttract::BeginScreen()
{
GAMESTATE->VisitAttractScreen( m_sName );
ScreenAttract::SetAttractVolume( !GAMESTATE->IsTimeToPlayAttractSounds() );
ScreenAttract::SetAttractVolume( true );
ScreenWithMenuElements::BeginScreen();
}
@@ -43,9 +43,16 @@ void ScreenAttract::Input( const InputEventPlus &input )
void ScreenAttract::SetAttractVolume( bool bInAttract )
{
if( bInAttract )
SOUNDMAN->SetVolumeOfNonCriticalSounds( 0.0f ); // mute attract sounds
{
if( GAMESTATE->IsTimeToPlayAttractSounds() )
SOUNDMAN->SetVolumeOfNonCriticalSounds( g_fSoundVolumeAttract ); // unmute attract sounds
else
SOUNDMAN->SetVolumeOfNonCriticalSounds( 0.0f ); // mute attract sounds
}
else
SOUNDMAN->SetVolumeOfNonCriticalSounds( g_fSoundVolumeAttract ); // unmute attract sounds
{
SOUNDMAN->SetVolumeOfNonCriticalSounds( 1.0f ); // unmute all sounds
}
}
void ScreenAttract::AttractInput( const InputEventPlus &input, ScreenWithMenuElements *pScreen )
+1 -1
View File
@@ -25,7 +25,7 @@ void ScreenDemonstration::Init()
{
GAMESTATE->Reset();
GAMESTATE->VisitAttractScreen( m_sName );
ScreenAttract::SetAttractVolume( !GAMESTATE->IsTimeToPlayAttractSounds() );
ScreenAttract::SetAttractVolume( true );
// Choose a Style
{
+1 -1
View File
@@ -715,8 +715,8 @@ static void InitializeConfOptions()
/* Sound options */
ADD( ConfOption( "AttractSoundFrequency", MovePref<AttractSoundFrequency>, "Never","Always","2 Times","3 Times","4 Times","5 Times" ) );
ADD( ConfOption( "SoundVolume", SoundVolume, "Silent","|10%","|20%","|30%","|40%","|50%","|60%","|70%","|80%","|90%","|100%" ) );
ADD( ConfOption( "SoundVolumeAttract", SoundVolumeAttract, "Silent","|10%","|20%","|30%","|40%","|50%","|60%","|70%","|80%","|90%","|100%" ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_SOUND;
ADD( ConfOption( "SoundVolumeAttract", SoundVolumeAttract, "Silent","|10%","|20%","|30%","|40%","|50%","|60%","|70%","|80%","|90%","|100%" ) );
{
ConfOption c( "GlobalOffsetSeconds", GlobalOffsetSeconds );
for( int i = -100; i <= +100; i += 5 )