mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
- pause all game sounds while the menu or console are open and marked SW's UI sounds as such.
This commit is contained in:
parent
a873dcf6e0
commit
3cd2b92dd1
8 changed files with 34 additions and 23 deletions
|
@ -57,6 +57,7 @@
|
||||||
#include "gamecvars.h"
|
#include "gamecvars.h"
|
||||||
#include "baselayer.h"
|
#include "baselayer.h"
|
||||||
#include "i_system.h"
|
#include "i_system.h"
|
||||||
|
#include "s_soundinternal.h"
|
||||||
|
|
||||||
|
|
||||||
#define LEFTMARGIN 8
|
#define LEFTMARGIN 8
|
||||||
|
@ -1028,6 +1029,7 @@ void C_Ticker()
|
||||||
ConBottom += (consoletic - lasttic) * (screen->GetHeight() * 2 / 25);
|
ConBottom += (consoletic - lasttic) * (screen->GetHeight() * 2 / 25);
|
||||||
if (ConBottom >= screen->GetHeight() / 2)
|
if (ConBottom >= screen->GetHeight() / 2)
|
||||||
{
|
{
|
||||||
|
GSnd->SetSfxPaused(true, PAUSESFX_CONSOLE);
|
||||||
ConBottom = screen->GetHeight() / 2;
|
ConBottom = screen->GetHeight() / 2;
|
||||||
ConsoleState = c_down;
|
ConsoleState = c_down;
|
||||||
}
|
}
|
||||||
|
@ -1037,6 +1039,7 @@ void C_Ticker()
|
||||||
ConBottom -= (consoletic - lasttic) * (screen->GetHeight() * 2 / 25);
|
ConBottom -= (consoletic - lasttic) * (screen->GetHeight() * 2 / 25);
|
||||||
if (ConBottom <= 0)
|
if (ConBottom <= 0)
|
||||||
{
|
{
|
||||||
|
GSnd->SetSfxPaused(false, PAUSESFX_CONSOLE);
|
||||||
ConsoleState = c_up;
|
ConsoleState = c_up;
|
||||||
ConBottom = 0;
|
ConBottom = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -366,7 +366,7 @@ void M_StartControlPanel (bool makeSound)
|
||||||
created = true;
|
created = true;
|
||||||
M_CreateMenus();
|
M_CreateMenus();
|
||||||
}
|
}
|
||||||
soundEngine->StopAllChannels();
|
GSnd->SetSfxPaused(true, PAUSESFX_MENU);
|
||||||
gi->MenuOpened();
|
gi->MenuOpened();
|
||||||
if (makeSound) gi->MenuSound(ActivateSound);
|
if (makeSound) gi->MenuSound(ActivateSound);
|
||||||
|
|
||||||
|
@ -936,6 +936,7 @@ void M_ClearMenus (bool final)
|
||||||
}
|
}
|
||||||
DMenu::CurrentMenu = nullptr;
|
DMenu::CurrentMenu = nullptr;
|
||||||
menuactive = MENU_Off;
|
menuactive = MENU_Off;
|
||||||
|
GSnd->SetSfxPaused(false, PAUSESFX_MENU);
|
||||||
if (!final)
|
if (!final)
|
||||||
{
|
{
|
||||||
mouseGrabInput(true);
|
mouseGrabInput(true);
|
||||||
|
|
|
@ -162,7 +162,7 @@ void OpenGLFrameBuffer::InitializeState()
|
||||||
glDisable(GL_POLYGON_OFFSET_FILL);
|
glDisable(GL_POLYGON_OFFSET_FILL);
|
||||||
glEnable(GL_POLYGON_OFFSET_LINE);
|
glEnable(GL_POLYGON_OFFSET_LINE);
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glEnable(GL_DEPTH_CLAMP);
|
//glEnable(GL_DEPTH_CLAMP);
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
glDisable(GL_LINE_SMOOTH);
|
glDisable(GL_LINE_SMOOTH);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
|
@ -169,4 +169,10 @@ extern ReverbContainer *DefaultEnvironments[26];
|
||||||
|
|
||||||
bool IsOpenALPresent();
|
bool IsOpenALPresent();
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
PAUSESFX_MENU = 1,
|
||||||
|
PAUSESFX_CONSOLE = 2
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -108,9 +108,9 @@ public:
|
||||||
DidOrderSound = true;
|
DidOrderSound = true;
|
||||||
int choose_snd = STD_RANDOM_RANGE(1000);
|
int choose_snd = STD_RANDOM_RANGE(1000);
|
||||||
if (choose_snd > 500)
|
if (choose_snd > 500)
|
||||||
PlaySound(DIGI_WANGORDER1, v3df_dontpan);
|
PlaySound(DIGI_WANGORDER1, v3df_dontpan, CHAN_BODY, CHANF_UI);
|
||||||
else
|
else
|
||||||
PlaySound(DIGI_WANGORDER2, v3df_dontpan);
|
PlaySound(DIGI_WANGORDER2, v3df_dontpan, CHAN_BODY, CHANF_UI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -178,15 +178,15 @@ void GameInterface::MenuSound(EMenuSounds snd)
|
||||||
switch (snd)
|
switch (snd)
|
||||||
{
|
{
|
||||||
case CursorSound:
|
case CursorSound:
|
||||||
PlaySound(DIGI_STAR, v3df_dontpan);
|
PlaySound(DIGI_STAR, v3df_dontpan, CHAN_BODY, CHANF_UI);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AdvanceSound:
|
case AdvanceSound:
|
||||||
PlaySound(DIGI_SWORDSWOOSH, v3df_dontpan);
|
PlaySound(DIGI_SWORDSWOOSH, v3df_dontpan, CHAN_BODY, CHANF_UI);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CloseSound:
|
case CloseSound:
|
||||||
PlaySound(DIGI_STARCLINK, v3df_dontpan);
|
PlaySound(DIGI_STARCLINK, v3df_dontpan, CHAN_BODY, CHANF_UI);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -237,13 +237,13 @@ void GameInterface::StartGame(FGameStartup& gs)
|
||||||
//InitNewGame();
|
//InitNewGame();
|
||||||
|
|
||||||
if (Skill == 0)
|
if (Skill == 0)
|
||||||
PlaySound(DIGI_TAUNTAI3, v3df_none, CHAN_VOICE);
|
PlaySound(DIGI_TAUNTAI3, v3df_none, CHAN_VOICE, CHANF_UI);
|
||||||
else if (Skill == 1)
|
else if (Skill == 1)
|
||||||
PlaySound(DIGI_NOFEAR, v3df_none, CHAN_VOICE);
|
PlaySound(DIGI_NOFEAR, v3df_none, CHAN_VOICE, CHANF_UI);
|
||||||
else if (Skill == 2)
|
else if (Skill == 2)
|
||||||
PlaySound(DIGI_WHOWANTSWANG, v3df_none, CHAN_VOICE);
|
PlaySound(DIGI_WHOWANTSWANG, v3df_none, CHAN_VOICE, CHANF_UI);
|
||||||
else if (Skill == 3)
|
else if (Skill == 3)
|
||||||
PlaySound(DIGI_NOPAIN, v3df_none, CHAN_VOICE);
|
PlaySound(DIGI_NOPAIN, v3df_none, CHAN_VOICE, CHANF_UI);
|
||||||
|
|
||||||
while (soundEngine->IsSourcePlayingSomething(SOURCE_None, nullptr, CHAN_VOICE))
|
while (soundEngine->IsSourcePlayingSomething(SOURCE_None, nullptr, CHAN_VOICE))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1525,7 +1525,7 @@ void CreditsLevel(void)
|
||||||
inputState.ClearAllInput();
|
inputState.ClearAllInput();
|
||||||
|
|
||||||
// Lo Wang feel like singing!
|
// Lo Wang feel like singing!
|
||||||
PlaySound(DIGI_JG95012, v3df_none, CHAN_VOICE);
|
PlaySound(DIGI_JG95012, v3df_none, CHAN_VOICE, CHANF_UI);
|
||||||
while (soundEngine->IsSourcePlayingSomething(SOURCE_None, nullptr, CHAN_VOICE))
|
while (soundEngine->IsSourcePlayingSomething(SOURCE_None, nullptr, CHAN_VOICE))
|
||||||
{
|
{
|
||||||
DoUpdateSounds();
|
DoUpdateSounds();
|
||||||
|
|
|
@ -45,6 +45,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "pragmas.h"
|
#include "pragmas.h"
|
||||||
#include "gamecvars.h"
|
#include "gamecvars.h"
|
||||||
|
#include "s_soundinternal.h"
|
||||||
|
|
||||||
BEGIN_SW_NS
|
BEGIN_SW_NS
|
||||||
|
|
||||||
|
@ -2092,23 +2093,23 @@ enum
|
||||||
short SoundDist(int x, int y, int z, int basedist);
|
short SoundDist(int x, int y, int z, int basedist);
|
||||||
short SoundAngle(int x, int y);
|
short SoundAngle(int x, int y);
|
||||||
//void PlaySound(int num, short angle, short vol);
|
//void PlaySound(int num, short angle, short vol);
|
||||||
int _PlaySound(int num, SPRITEp sprite, PLAYERp player, vec3_t *pos, Voc3D_Flags flags, int channel);
|
int _PlaySound(int num, SPRITEp sprite, PLAYERp player, vec3_t *pos, Voc3D_Flags flags, int channel, EChanFlags sndflags);
|
||||||
void InitAmbient(int num, SPRITEp sprite);
|
void InitAmbient(int num, SPRITEp sprite);
|
||||||
inline void PlaySound(int num, SPRITEp sprite, Voc3D_Flags flags, int channel = 8)
|
inline void PlaySound(int num, SPRITEp sprite, Voc3D_Flags flags, int channel = 8, EChanFlags sndflags = CHANF_NONE)
|
||||||
{
|
{
|
||||||
_PlaySound(num, sprite, nullptr, nullptr, flags, channel);
|
_PlaySound(num, sprite, nullptr, nullptr, flags, channel, sndflags);
|
||||||
}
|
}
|
||||||
inline void PlaySound(int num, PLAYERp player, Voc3D_Flags flags, int channel = 8)
|
inline void PlaySound(int num, PLAYERp player, Voc3D_Flags flags, int channel = 8, EChanFlags sndflags = CHANF_NONE)
|
||||||
{
|
{
|
||||||
_PlaySound(num, nullptr, player, nullptr, flags, channel);
|
_PlaySound(num, nullptr, player, nullptr, flags, channel, sndflags);
|
||||||
}
|
}
|
||||||
inline void PlaySound(int num, Voc3D_Flags flags, int channel = 8)
|
inline void PlaySound(int num, Voc3D_Flags flags, int channel = 8, EChanFlags sndflags = CHANF_NONE)
|
||||||
{
|
{
|
||||||
_PlaySound(num, nullptr, nullptr, nullptr, flags, channel);
|
_PlaySound(num, nullptr, nullptr, nullptr, flags, channel, sndflags);
|
||||||
}
|
}
|
||||||
inline void PlaySound(int num, vec3_t *pos, Voc3D_Flags flags, int channel = 8)
|
inline void PlaySound(int num, vec3_t *pos, Voc3D_Flags flags, int channel = 8, EChanFlags sndflags = CHANF_NONE)
|
||||||
{
|
{
|
||||||
_PlaySound(num, nullptr, nullptr, pos, flags, channel);
|
_PlaySound(num, nullptr, nullptr, pos, flags, channel, sndflags);
|
||||||
}
|
}
|
||||||
|
|
||||||
int _PlayerSound(int num, PLAYERp pp);
|
int _PlayerSound(int num, PLAYERp pp);
|
||||||
|
|
|
@ -608,7 +608,7 @@ void DoUpdateSounds(void)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
int _PlaySound(int num, SPRITEp sp, PLAYERp pp, vec3_t* pos, Voc3D_Flags flags, int channel)
|
int _PlaySound(int num, SPRITEp sp, PLAYERp pp, vec3_t* pos, Voc3D_Flags flags, int channel, EChanFlags cflags)
|
||||||
{
|
{
|
||||||
if (Prediction || !SoundEnabled() || !soundEngine->isValidSoundId(num))
|
if (Prediction || !SoundEnabled() || !soundEngine->isValidSoundId(num))
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -625,7 +625,7 @@ int _PlaySound(int num, SPRITEp sp, PLAYERp pp, vec3_t* pos, Voc3D_Flags flags,
|
||||||
|
|
||||||
auto vp = &voc[num];
|
auto vp = &voc[num];
|
||||||
int sourcetype = SOURCE_None;
|
int sourcetype = SOURCE_None;
|
||||||
EChanFlags cflags = channel == 8 ? CHANF_OVERLAP : CHANF_NONE; // for the default channel we do not want to have sounds stopping each other.
|
cflags |= channel == 8 ? CHANF_OVERLAP : CHANF_NONE; // for the default channel we do not want to have sounds stopping each other.
|
||||||
void* source = nullptr;
|
void* source = nullptr;
|
||||||
// If the sound is not supposd to be positioned, it may not be linked to the launching actor.
|
// If the sound is not supposd to be positioned, it may not be linked to the launching actor.
|
||||||
if (!(flags & v3df_follow))
|
if (!(flags & v3df_follow))
|
||||||
|
|
Loading…
Reference in a new issue