- separate `i_pauseinbackground` and `i_soundinbackground` - they probably should ultimately be moved out of the sound code

This commit is contained in:
Rachael Alexanderson 2022-01-15 20:17:11 -05:00
parent c3fc4e347e
commit 12ed24d066
4 changed files with 15 additions and 16 deletions

View File

@ -55,7 +55,6 @@
// ---------------------------------------------------------------------------
CVAR (Bool, i_soundinbackground, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
EXTERN_CVAR(Int, vid_defwidth )
EXTERN_CVAR(Int, vid_defheight)
EXTERN_CVAR(Bool, vid_vsync )
@ -293,7 +292,7 @@ extern bool AppActive;
{
ZD_UNUSED(aNotification);
S_SetSoundPaused(i_soundinbackground);
S_SetSoundPaused(0);
AppActive = false;
}

View File

@ -95,8 +95,6 @@ CUSTOM_CVAR(Bool, gl_es, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCA
Printf("This won't take effect until " GAMENAME " is restarted.\n");
}
CVAR(Bool, i_soundinbackground, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR (Int, vid_adapter, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CUSTOM_CVAR(String, vid_sdl_render_driver, "", CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
@ -721,7 +719,7 @@ void ProcessSDLWindowEvent(const SDL_WindowEvent &event)
break;
case SDL_WINDOWEVENT_FOCUS_LOST:
S_SetSoundPaused(i_soundinbackground);
S_SetSoundPaused(0);
AppActive = false;
break;

View File

@ -140,7 +140,6 @@ int BlockMouseMove;
static bool EventHandlerResultForNativeMouse;
CVAR (Bool, i_soundinbackground, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Bool, k_allowfullscreentoggle, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
extern int chatmodeon;
@ -508,7 +507,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
SetPriorityClass (GetCurrentProcess (), IDLE_PRIORITY_CLASS);
}
S_SetSoundPaused ((!!i_soundinbackground) || wParam);
S_SetSoundPaused (wParam);
break;
case WM_WTSSESSION_CHANGE:

View File

@ -71,6 +71,8 @@
FBoolCVar noisedebug("noise", false, 0); // [RH] Print sound debugging info?
CVAR (Bool, i_soundinbackground, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Bool, i_pauseinbackground, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
static FString LastLocalSndInfo;
@ -930,7 +932,16 @@ void S_SerializeSounds(FSerializer &arc)
void S_SetSoundPaused(int state)
{
if (state)
if (!netgame && (i_pauseinbackground)
#ifdef _DEBUG
&& !demoplayback
#endif
)
{
pauseext = !state;
}
if ((state || i_soundinbackground) && !pauseext)
{
if (paused == 0)
{
@ -954,14 +965,6 @@ void S_SetSoundPaused(int state)
}
}
}
if (!netgame
#ifdef _DEBUG
&& !demoplayback
#endif
)
{
pauseext = !state;
}
}