X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsdl.c;h=42e6286bf78697605e42c52cef07c04b636c5c60;hb=2f1f47c267eb7b16d95eb25cfb53eb5effedea9a;hp=f10dfd6dc2322f3b72ae2701b54d1439279f0121;hpb=1101077a226b09854650662759bf12caf7c84f8d;p=rocksndiamonds.git diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index f10dfd6d..42e6286b 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -873,7 +873,7 @@ inline void SDLOpenAudio(void) } if (Mix_OpenAudio(DEFAULT_AUDIO_SAMPLE_RATE, AUDIO_S16, - AUDIO_STEREO_CHANNELS, + AUDIO_NUM_CHANNELS_STEREO, DEFAULT_AUDIO_FRAGMENT_SIZE) < 0) { Error(ERR_WARN, "Mix_OpenAudio() failed: %s", SDL_GetError()); @@ -885,17 +885,12 @@ inline void SDLOpenAudio(void) audio.loops_available = TRUE; audio.sound_enabled = TRUE; - /* determine number of available channels */ - audio.channels = Mix_AllocateChannels(MIX_CHANNELS); + /* set number of available mixer channels */ + audio.num_channels = Mix_AllocateChannels(NUM_MIXER_CHANNELS); + audio.music_channel = MUSIC_CHANNEL; + audio.first_sound_channel = FIRST_SOUND_CHANNEL; - /* reserve first channel for music loops */ - if (Mix_ReserveChannels(1) == 1) - audio.music_channel = 0; - else - audio.music_available = FALSE; - - Mix_Volume(-1, SOUND_MAX_VOLUME); - Mix_VolumeMusic(SOUND_MAX_VOLUME); + Mixer_InitChannels(); } inline void SDLCloseAudio(void)