mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-04 15:12:58 +00:00
Use Mix_PausedMusic instead of our own music_paused flag in SDL2/SDL1.2 I_MusicPaused
# Conflicts: # src/sdl12/mixer_sound.c
This commit is contained in:
parent
de4d4e87e1
commit
6841f90562
1 changed files with 3 additions and 9 deletions
|
|
@ -62,7 +62,7 @@
|
||||||
|
|
||||||
UINT8 sound_started = false;
|
UINT8 sound_started = false;
|
||||||
|
|
||||||
static boolean midimode, music_paused;
|
static boolean midimode;
|
||||||
static Mix_Music *music;
|
static Mix_Music *music;
|
||||||
static UINT8 music_volume, midi_volume, sfx_volume;
|
static UINT8 music_volume, midi_volume, sfx_volume;
|
||||||
static float loop_point;
|
static float loop_point;
|
||||||
|
|
@ -88,7 +88,7 @@ void I_StartupSound(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
midimode = music_paused = false;
|
midimode = false;
|
||||||
music = NULL;
|
music = NULL;
|
||||||
music_volume = midi_volume = sfx_volume = 0;
|
music_volume = midi_volume = sfx_volume = 0;
|
||||||
|
|
||||||
|
|
@ -488,9 +488,6 @@ void I_PauseSong(INT32 handle)
|
||||||
(void)handle;
|
(void)handle;
|
||||||
if(!midimode)
|
if(!midimode)
|
||||||
Mix_UnregisterEffect(MIX_CHANNEL_POST, count_music_bytes);
|
Mix_UnregisterEffect(MIX_CHANNEL_POST, count_music_bytes);
|
||||||
if(music)
|
|
||||||
// music is not paused if there's no music to begin with, see win_snd.c:I_PauseSong
|
|
||||||
music_paused = true;
|
|
||||||
Mix_PauseMusic();
|
Mix_PauseMusic();
|
||||||
songpaused = true;
|
songpaused = true;
|
||||||
}
|
}
|
||||||
|
|
@ -506,7 +503,6 @@ void I_ResumeSong(INT32 handle)
|
||||||
// midimode and music must be checked in case nothing is actually playing
|
// midimode and music must be checked in case nothing is actually playing
|
||||||
CONS_Alert(CONS_WARNING, "Error registering SDL music position counter: %s\n", Mix_GetError());
|
CONS_Alert(CONS_WARNING, "Error registering SDL music position counter: %s\n", Mix_GetError());
|
||||||
}
|
}
|
||||||
music_paused = false;
|
|
||||||
Mix_ResumeMusic();
|
Mix_ResumeMusic();
|
||||||
songpaused = false;
|
songpaused = false;
|
||||||
}
|
}
|
||||||
|
|
@ -533,7 +529,7 @@ boolean I_MusicPlaying(void)
|
||||||
|
|
||||||
boolean I_MusicPaused(void)
|
boolean I_MusicPaused(void)
|
||||||
{
|
{
|
||||||
return music_paused;
|
return Mix_PausedMusic();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
@ -583,7 +579,6 @@ boolean I_StartDigSong(const char *musicname, boolean looping)
|
||||||
if (lumpnum == LUMPERROR)
|
if (lumpnum == LUMPERROR)
|
||||||
return false;
|
return false;
|
||||||
midimode = false;
|
midimode = false;
|
||||||
music_paused = false;
|
|
||||||
|
|
||||||
data = (char *)W_CacheLumpNum(lumpnum, PU_MUSIC);
|
data = (char *)W_CacheLumpNum(lumpnum, PU_MUSIC);
|
||||||
len = W_LumpLength(lumpnum);
|
len = W_LumpLength(lumpnum);
|
||||||
|
|
@ -893,7 +888,6 @@ boolean I_PlaySong(INT32 handle, boolean looping)
|
||||||
(void)handle;
|
(void)handle;
|
||||||
|
|
||||||
midimode = true;
|
midimode = true;
|
||||||
music_paused = false;
|
|
||||||
|
|
||||||
if (Mix_PlayMusic(music, looping ? -1 : 0) == -1)
|
if (Mix_PlayMusic(music, looping ? -1 : 0) == -1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue