Añadidas las nuevas funciones de jailaudio

This commit is contained in:
2024-05-31 19:52:27 +02:00
parent 181ce0ae99
commit 9ae49fcc40
2 changed files with 8 additions and 5 deletions

View File

@@ -221,7 +221,7 @@ JA_Sound_t *JA_LoadSound(const char* filename) {
int JA_PlaySound(JA_Sound_t *sound, const int loop)
{
if (!JA_soundEnabled) return;
if (!JA_soundEnabled) return 0;
int channel = 0;
while (channel < JA_MAX_SIMULTANEOUS_CHANNELS && channels[channel].state != JA_CHANNEL_FREE) { channel++; }

View File

@@ -130,7 +130,10 @@ void Director::initInput()
void Director::initJailAudio()
{
JA_Init(48000, AUDIO_S16, 2);
JA_SetVolume(0);
JA_EnableMusic(options->audio.music.enabled);
JA_EnableSound(options->audio.sound.enabled);
JA_SetMusicVolume(options->audio.music.volume);
JA_SetSoundVolume(options->audio.sound.volume);
}
// Arranca SDL y crea la ventana
@@ -393,10 +396,10 @@ void Director::initOptions()
options->video.border.enabled = false;
// Opciones de audio
options->audio.music.enabled = false;
options->audio.music.enabled = true;
options->audio.music.volume = 128;
options->audio.sound.enabled = false;
options->audio.sound.volume = 128;
options->audio.sound.enabled = true;
options->audio.sound.volume = 64;
// Opciones varios
options->playerSelected = 0;