remove a redundant call to S_Init_Cvars and call S_ClearBuffer when sound

is blocked and unblocked.
This commit is contained in:
Bill Currie 2003-01-31 17:56:05 +00:00
parent b0e6f46b7e
commit c788a2ea57
4 changed files with 6 additions and 1 deletions

View file

@ -73,7 +73,6 @@ plugin_list_t snd_render_list[] = {
void
S_Init (struct model_s **worldmodel, int *viewentity, double *host_frametime)
{
S_Init_Cvars ();
if (!*snd_output->string || !*snd_render->string) {
Sys_Printf ("Not loading sound due to no renderer/output\n");
return;

View file

@ -57,6 +57,7 @@ event_focusout (void)
{
if (in_snd_block->int_val) {
S_BlockSound ();
S_ClearBuffer ();
CDAudio_Pause ();
}
}
@ -65,6 +66,7 @@ static void
event_focusin (void)
{
if (in_snd_block->int_val) {
S_ClearBuffer ();
S_UnblockSound ();
CDAudio_Resume ();
}

View file

@ -712,8 +712,10 @@ AppActivate (BOOL fActive, BOOL minimize)
// enable/disable sound on focus gain/loss
if (!ActiveApp && sound_active) {
S_BlockSound ();
S_ClearBuffer ();
sound_active = false;
} else if (ActiveApp && !sound_active) {
S_ClearBuffer ();
S_UnblockSound ();
sound_active = true;
}

View file

@ -483,6 +483,7 @@ event_focusout (XEvent *event)
XAutoRepeatOn (x_disp);
if (in_snd_block->int_val) {
S_BlockSound ();
S_ClearBuffer ();
CDAudio_Pause ();
}
}
@ -493,6 +494,7 @@ event_focusin (XEvent *event)
if (key_dest == key_game)
XAutoRepeatOff (x_disp);
if (in_snd_block->int_val) {
S_ClearBuffer ();
S_UnblockSound ();
CDAudio_Resume ();
}