mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-01-19 07:51:03 +00:00
Merge pull request #947 from devnexen/sound_pause_option
Introduces new cvar cl_audiopaused to control if the audio loop
This commit is contained in:
commit
6c18d819d3
5 changed files with 9 additions and 12 deletions
|
@ -275,6 +275,8 @@ Set `0` by default.
|
|||
`-1`: Disable reverb effect,
|
||||
`>=0`: select predefined effect.
|
||||
|
||||
* **cl_audiopaused**: If set to `1` the sounds pause when the game does.
|
||||
|
||||
## Graphics (all renderers)
|
||||
|
||||
* **cin_force43**: If set to `1` (the default) cinematics are displayed
|
||||
|
|
|
@ -56,6 +56,7 @@ cvar_t *cl_showclamp;
|
|||
|
||||
cvar_t *cl_paused;
|
||||
cvar_t *cl_loadpaused;
|
||||
cvar_t *cl_audiopaused;
|
||||
|
||||
cvar_t *cl_lightlevel;
|
||||
cvar_t *cl_r1q2_lightstyle;
|
||||
|
@ -516,6 +517,7 @@ CL_InitLocal(void)
|
|||
cl_timeout = Cvar_Get("cl_timeout", "120", 0);
|
||||
cl_paused = Cvar_Get("paused", "0", 0);
|
||||
cl_loadpaused = Cvar_Get("cl_loadpaused", "1", CVAR_ARCHIVE);
|
||||
cl_audiopaused = Cvar_Get("cl_audiopaused", "1", CVAR_ARCHIVE);
|
||||
|
||||
gl1_stereo = Cvar_Get( "gl1_stereo", "0", CVAR_ARCHIVE );
|
||||
gl1_stereo_separation = Cvar_Get( "gl1_stereo_separation", "1", CVAR_ARCHIVE );
|
||||
|
|
|
@ -305,6 +305,7 @@ extern cvar_t *freelook;
|
|||
extern cvar_t *cl_lightlevel;
|
||||
extern cvar_t *cl_paused;
|
||||
extern cvar_t *cl_loadpaused;
|
||||
extern cvar_t *cl_audiopaused;
|
||||
extern cvar_t *cl_timedemo;
|
||||
extern cvar_t *cl_vwep;
|
||||
extern cvar_t *horplus;
|
||||
|
|
|
@ -854,11 +854,12 @@ AL_AddLoopSounds(void)
|
|||
int num;
|
||||
entity_state_t *ent;
|
||||
|
||||
if ((cls.state != ca_active) || cl_paused->value || !s_ambient->value)
|
||||
if ((cls.state != ca_active) || (cl_paused->value && cl_audiopaused->value) || !s_ambient->value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
memset(&sounds, 0, sizeof(int) * MAX_EDICTS);
|
||||
S_BuildSoundList(sounds);
|
||||
|
||||
for (i = 0; i < cl.frame.num_entities; i++)
|
||||
|
|
|
@ -687,17 +687,8 @@ SDL_AddLoopSounds(void)
|
|||
int num;
|
||||
entity_state_t *ent;
|
||||
|
||||
if (cl_paused->value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (cls.state != ca_active)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cl.sound_prepped || !s_ambient->value)
|
||||
if ((cls.state != ca_active) || (cl_paused->value && cl_audiopaused->value) ||
|
||||
!cl.sound_prepped || !s_ambient->value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue