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
+2 -1
View File
@@ -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);
void AudMix_TickMovieAudio(void);
void AudMix_SetMusicState(bool musicState);
+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
+3 -1
View File
@@ -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
*/
+1 -1
View File
@@ -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);
}
}
}