mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 00:24:12 +00:00
remove a redundant call to S_Init_Cvars and call S_ClearBuffer when sound
is blocked and unblocked.
This commit is contained in:
parent
b0e6f46b7e
commit
c788a2ea57
4 changed files with 6 additions and 1 deletions
|
@ -73,7 +73,6 @@ plugin_list_t snd_render_list[] = {
|
||||||
void
|
void
|
||||||
S_Init (struct model_s **worldmodel, int *viewentity, double *host_frametime)
|
S_Init (struct model_s **worldmodel, int *viewentity, double *host_frametime)
|
||||||
{
|
{
|
||||||
S_Init_Cvars ();
|
|
||||||
if (!*snd_output->string || !*snd_render->string) {
|
if (!*snd_output->string || !*snd_render->string) {
|
||||||
Sys_Printf ("Not loading sound due to no renderer/output\n");
|
Sys_Printf ("Not loading sound due to no renderer/output\n");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -57,6 +57,7 @@ event_focusout (void)
|
||||||
{
|
{
|
||||||
if (in_snd_block->int_val) {
|
if (in_snd_block->int_val) {
|
||||||
S_BlockSound ();
|
S_BlockSound ();
|
||||||
|
S_ClearBuffer ();
|
||||||
CDAudio_Pause ();
|
CDAudio_Pause ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,6 +66,7 @@ static void
|
||||||
event_focusin (void)
|
event_focusin (void)
|
||||||
{
|
{
|
||||||
if (in_snd_block->int_val) {
|
if (in_snd_block->int_val) {
|
||||||
|
S_ClearBuffer ();
|
||||||
S_UnblockSound ();
|
S_UnblockSound ();
|
||||||
CDAudio_Resume ();
|
CDAudio_Resume ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -712,8 +712,10 @@ AppActivate (BOOL fActive, BOOL minimize)
|
||||||
// enable/disable sound on focus gain/loss
|
// enable/disable sound on focus gain/loss
|
||||||
if (!ActiveApp && sound_active) {
|
if (!ActiveApp && sound_active) {
|
||||||
S_BlockSound ();
|
S_BlockSound ();
|
||||||
|
S_ClearBuffer ();
|
||||||
sound_active = false;
|
sound_active = false;
|
||||||
} else if (ActiveApp && !sound_active) {
|
} else if (ActiveApp && !sound_active) {
|
||||||
|
S_ClearBuffer ();
|
||||||
S_UnblockSound ();
|
S_UnblockSound ();
|
||||||
sound_active = true;
|
sound_active = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -483,6 +483,7 @@ event_focusout (XEvent *event)
|
||||||
XAutoRepeatOn (x_disp);
|
XAutoRepeatOn (x_disp);
|
||||||
if (in_snd_block->int_val) {
|
if (in_snd_block->int_val) {
|
||||||
S_BlockSound ();
|
S_BlockSound ();
|
||||||
|
S_ClearBuffer ();
|
||||||
CDAudio_Pause ();
|
CDAudio_Pause ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -493,6 +494,7 @@ event_focusin (XEvent *event)
|
||||||
if (key_dest == key_game)
|
if (key_dest == key_game)
|
||||||
XAutoRepeatOff (x_disp);
|
XAutoRepeatOff (x_disp);
|
||||||
if (in_snd_block->int_val) {
|
if (in_snd_block->int_val) {
|
||||||
|
S_ClearBuffer ();
|
||||||
S_UnblockSound ();
|
S_UnblockSound ();
|
||||||
CDAudio_Resume ();
|
CDAudio_Resume ();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue