X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsound.c;h=3d085a9dbe8f8f336d241978616723cbcb8ec465;hb=a4fa40cbdd9ef5a4c9a4c18e34298fa9ec49f53d;hp=d7ec950435948b44fdb2560c7f26c103ad7904f6;hpb=3e44421a400e6349d1e97f047391489bc1b396fb;p=rocksndiamonds.git diff --git a/src/libgame/sound.c b/src/libgame/sound.c index d7ec9504..3d085a9d 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -166,8 +166,8 @@ static boolean Mixer_ChannelExpired(int channel) if (expire_loop_sounds && IS_LOOP(mixer[channel]) && !IS_MUSIC(mixer[channel]) && - DelayReached(&mixer[channel].playing_starttime, - SOUND_LOOP_EXPIRATION_TIME)) + DelayReachedExt2(&mixer[channel].playing_starttime, + SOUND_LOOP_EXPIRATION_TIME, Counter())) return TRUE; if (!Mix_Playing(channel)) @@ -233,7 +233,7 @@ static void Mixer_PlayMusicChannel(void) Mix_VolumeMusic(mixer[audio.music_channel].volume); Mix_FadeInMusic(mixer[audio.music_channel].data_ptr, loops, 100); -#if defined(PLATFORM_WIN32) +#if defined(PLATFORM_WINDOWS) // playing MIDI music is broken since Windows Vista, as it sets the volume // for MIDI music also for all other sounds and music, which cannot be set // back to normal unless playing MIDI music again with that desired volume @@ -281,7 +281,7 @@ static void Mixer_FadeMusicChannel(void) Mix_FadeOutMusic(SOUND_FADING_INTERVAL); -#if defined(PLATFORM_WIN32) +#if defined(PLATFORM_WINDOWS) // playing MIDI music is broken since Windows Vista, as it sets the volume // for MIDI music also for all other sounds and music, which cannot be set // back to normal unless playing MIDI music again with that desired volume @@ -591,7 +591,7 @@ static void LoadCustomMusic_NoConf(void) { static boolean draw_init_text = TRUE; // only draw at startup static char *last_music_directory = NULL; - char *music_directory = getCustomMusicDirectory(); + char *music_directory = getCustomMusicDirectory_NoConf(); Directory *dir; DirectoryEntry *dir_entry; int num_music = getMusicListSize(); @@ -741,6 +741,16 @@ static MusicInfo *getMusicInfoEntryFromMusicID(int pos) return mus_info[list_pos]; } +char *getSoundInfoEntryFilename(int pos) +{ + SoundInfo *snd_info = getSoundInfoEntryFromSoundID(pos); + + if (snd_info == NULL) + return NULL; + + return getBaseNamePtr(snd_info->source_filename); +} + char *getMusicInfoEntryFilename(int pos) { MusicInfo *mus_info = getMusicInfoEntryFromMusicID(pos); @@ -1103,7 +1113,7 @@ static void ReloadCustomMusic(void) LoadCustomMusic_NoConf(); } -void InitReloadCustomSounds(char *set_identifier) +void InitReloadCustomSounds(void) { if (!audio.sound_available) return; @@ -1111,7 +1121,7 @@ void InitReloadCustomSounds(char *set_identifier) ReloadCustomSounds(); } -void InitReloadCustomMusic(char *set_identifier) +void InitReloadCustomMusic(void) { if (!audio.music_available) return;