mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Disable music when entering the scenerio_editor.
This commit is contained in:
+2
-1
@@ -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);
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user