diff --git a/REDALERT/AUDIOMIX.H b/REDALERT/AUDIOMIX.H index 37603c9..2a36b08 100644 --- a/REDALERT/AUDIOMIX.H +++ b/REDALERT/AUDIOMIX.H @@ -10,4 +10,5 @@ const char* GetThemeMusicFileName(int index); void AudMix_PlayMusic(int musicId); const char* GetSpeechFileName(int index); void AudMix_QueueVideoAudio(const char* audio_buffer, int length, int rate); -void AudMix_TickMovieAudio(void); \ No newline at end of file +void AudMix_TickMovieAudio(void); +void AudMix_SetMusicState(bool musicState); \ No newline at end of file diff --git a/REDALERT/AUDMIX.CPP b/REDALERT/AUDMIX.CPP index 880c4f3..ce2fdf5 100644 --- a/REDALERT/AUDMIX.CPP +++ b/REDALERT/AUDMIX.CPP @@ -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 diff --git a/REDALERT/CONQUER.CPP b/REDALERT/CONQUER.CPP index c3b299f..5dffdd9 100644 --- a/REDALERT/CONQUER.CPP +++ b/REDALERT/CONQUER.CPP @@ -104,6 +104,7 @@ TcpipManagerClass Winsock; #include "ccdde.h" #include "vortex.h" #include "VQAMOVIE.H" +#include "AUDIOMIX.H" #ifdef WOLAPI_INTEGRATION //#include "WolDebug.h" @@ -2537,6 +2538,7 @@ void Go_Editor(bool flag) ** Go into Scenario Editor mode */ if (flag) { + AudMix_SetMusicState(false); // jmarshall: disable music if we are in editor mode Debug_Map = true; Debug_Unshroud = true; @@ -2567,7 +2569,7 @@ void Go_Editor(bool flag) Map.Render(); } else { - + AudMix_SetMusicState(true); // jmarshall: enable music if we are going back into editor mode. /* ** Go into normal game mode */ diff --git a/REDALERT/MAPEDIT.CPP b/REDALERT/MAPEDIT.CPP index 669b96a..2bc9f5b 100644 --- a/REDALERT/MAPEDIT.CPP +++ b/REDALERT/MAPEDIT.CPP @@ -484,7 +484,7 @@ void MapEditClass::AI(KeyNumType & input, int x, int y) Changed = 0; } BaseGauge->Set_Value(Scen.Percent); - Go_Editor(!Debug_Map); + Go_Editor(!Debug_Map); } } }