fix: amb el audio muted, al acabar la partida el fade per al roido de boles el tornava a deixar activat

This commit is contained in:
2025-03-15 19:33:18 +01:00
parent 44f3f32d67
commit a6d115342c

View File

@@ -327,10 +327,13 @@ void Game::updateGameStateGameOver()
} }
if (fade_out_->isEnabled()) if (fade_out_->isEnabled())
{
if (options.audio.enabled)
{ {
const float vol = static_cast<float>(64 * (100 - fade_out_->getValue())) / 100.0f; const float vol = static_cast<float>(64 * (100 - fade_out_->getValue())) / 100.0f;
JA_SetSoundVolume(to_JA_volume(static_cast<int>(vol))); JA_SetSoundVolume(to_JA_volume(static_cast<int>(vol)));
} }
}
if (fade_out_->hasEnded()) if (fade_out_->hasEnded())
{ {
@@ -344,9 +347,12 @@ void Game::updateGameStateGameOver()
// La partida ha terminado con la derrota de los jugadores // La partida ha terminado con la derrota de los jugadores
section::name = section::Name::HI_SCORE_TABLE; section::name = section::Name::HI_SCORE_TABLE;
} }
if (options.audio.enabled)
{
JA_StopChannel(-1); JA_StopChannel(-1);
JA_SetSoundVolume(to_JA_volume(options.audio.sound.volume)); JA_SetSoundVolume(to_JA_volume(options.audio.sound.volume));
} }
}
} }
// Gestiona eventos para el estado del final del juego // Gestiona eventos para el estado del final del juego