X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsdl.c;h=212ce1b86c59493753cf8262050c547b9e3b1ae1;hb=4f6fe351c7b605d97c1ba8f482fb72e467dc19cb;hp=ef68a08e90f408b2658ce2df76c18bed010563ba;hpb=dfe0a71a9939e0c55bb54dcc92db1749e8e21747;p=rocksndiamonds.git diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index ef68a08e..212ce1b8 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -1,7 +1,7 @@ /*********************************************************** * Artsoft Retro-Game Library * *----------------------------------------------------------* -* (c) 1994-2001 Artsoft Entertainment * +* (c) 1994-2002 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * @@ -872,8 +872,8 @@ inline void SDLOpenAudio(void) return; } - if (Mix_OpenAudio(DEFAULT_AUDIO_SAMPLE_RATE, AUDIO_S16, - AUDIO_STEREO_CHANNELS, + if (Mix_OpenAudio(DEFAULT_AUDIO_SAMPLE_RATE, MIX_DEFAULT_FORMAT, + AUDIO_NUM_CHANNELS_STEREO, DEFAULT_AUDIO_FRAGMENT_SIZE) < 0) { Error(ERR_WARN, "Mix_OpenAudio() failed: %s", SDL_GetError()); @@ -885,19 +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; - if (!audio.mods_available) /* 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)