Disable music when entering the scenerio_editor.

This commit is contained in:
Justin Marshall
2020-06-07 19:09:41 -07:00
parent a0efe3a4ec
commit 02862df035
4 changed files with 16 additions and 3 deletions
+10
View File
@@ -66,6 +66,7 @@ struct WAVE_Data {
#define MAX_AUDIO_SOURCES 32
#define SPEECH_AUDIO_SOURCE (MAX_AUDIO_SOURCES - 3)
#define MOVIE_AUDIO_SOURCE (MAX_AUDIO_SOURCES - 2)
#define MUSIC_AUDIO_SOURCE (MAX_AUDIO_SOURCES - 1)
ALuint audio_sources[MAX_AUDIO_SOURCES];
int current_streaming_audiosource = 0;
@@ -321,6 +322,15 @@ void PlayAudio(AudioBuffer_t& buffer, bool speech) {
currentAudioTSource++;
}
void AudMix_SetMusicState(bool musicState) {
if (!musicState) {
alSourcePause(audio_sources[MUSIC_AUDIO_SOURCE]);
}
else {
alSourcePlay(audio_sources[MUSIC_AUDIO_SOURCE]);
}
}
void On_Sound_Effect(int sound_index, int variation, COORDINATE coord, int house)
{
// MBL 06.17.2019