jail_audio: ultima versió
Audio: separació de sons per canals Game: el fade de so de game over ja no afecta al so de la UI (no funciona o no ho faig be)
This commit is contained in:
@@ -56,11 +56,11 @@ void Audio::stopMusic()
|
||||
}
|
||||
|
||||
// Reproduce un sonido
|
||||
void Audio::playSound(const std::string &name)
|
||||
void Audio::playSound(const std::string &name, Group group)
|
||||
{
|
||||
if (sound_enabled_)
|
||||
{
|
||||
JA_PlaySound(Resource::get()->getSound(name));
|
||||
JA_PlaySound(Resource::get()->getSound(name), 0 , static_cast<int>(group));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,13 +83,13 @@ void Audio::fadeOutMusic(int milliseconds)
|
||||
}
|
||||
|
||||
// Establece el volumen de los sonidos
|
||||
void Audio::setSoundVolume(int sound_volume)
|
||||
void Audio::setSoundVolume(int sound_volume, Group group)
|
||||
{
|
||||
if (sound_enabled_)
|
||||
{
|
||||
sound_volume = std::clamp(sound_volume, 0, 100);
|
||||
const float CONVERTED_VOLUME = (sound_volume / 100.0f) * (Options::audio.volume / 100.0f);
|
||||
JA_SetSoundVolume(CONVERTED_VOLUME);
|
||||
JA_SetSoundVolume(CONVERTED_VOLUME, static_cast<int>(group));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user