diff --git a/src/common/platform/posix/cocoa/i_main.mm b/src/common/platform/posix/cocoa/i_main.mm index 09c1daf56..382fabb23 100644 --- a/src/common/platform/posix/cocoa/i_main.mm +++ b/src/common/platform/posix/cocoa/i_main.mm @@ -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; } diff --git a/src/common/platform/posix/sdl/sdlglvideo.cpp b/src/common/platform/posix/sdl/sdlglvideo.cpp index 9b4aa6cd6..a5f7e6b52 100644 --- a/src/common/platform/posix/sdl/sdlglvideo.cpp +++ b/src/common/platform/posix/sdl/sdlglvideo.cpp @@ -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; diff --git a/src/common/platform/win32/i_input.cpp b/src/common/platform/win32/i_input.cpp index c62bbcf42..06b1e9801 100644 --- a/src/common/platform/win32/i_input.cpp +++ b/src/common/platform/win32/i_input.cpp @@ -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: diff --git a/src/sound/s_doomsound.cpp b/src/sound/s_doomsound.cpp index 6b9549067..d70318e60 100644 --- a/src/sound/s_doomsound.cpp +++ b/src/sound/s_doomsound.cpp @@ -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; - } }