- implemented 'i_soundinbackground' to continue playing sounds and music while in the background.

- OpenGL rendering continues now even when losing focus while in windowed mode.
This commit is contained in:
Rachael Alexanderson 2017-12-24 18:01:45 -05:00
parent d10304ea4e
commit 000037dbf6
4 changed files with 7 additions and 4 deletions

View file

@ -60,6 +60,7 @@
// ---------------------------------------------------------------------------
CVAR (Bool, i_soundinbackground, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
EXTERN_CVAR(Int, vid_defwidth )
EXTERN_CVAR(Int, vid_defheight)
EXTERN_CVAR(Bool, vid_vsync )
@ -323,7 +324,7 @@ ApplicationController* appCtrl;
{
ZD_UNUSED(aNotification);
S_SetSoundPaused(0);
S_SetSoundPaused((!!i_soundinbackground) || 0);
}

View file

@ -62,6 +62,7 @@ extern int paused;
CVAR (Bool, use_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Bool, m_noprescale, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Bool, m_filter, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Bool, i_soundinbackground, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
EXTERN_CVAR (Bool, fullscreen)
@ -312,7 +313,7 @@ void MessagePump (const SDL_Event &sev)
{
case SDL_WINDOWEVENT_FOCUS_GAINED:
case SDL_WINDOWEVENT_FOCUS_LOST:
S_SetSoundPaused(sev.window.event == SDL_WINDOWEVENT_FOCUS_GAINED);
S_SetSoundPaused((!!i_soundinbackground) || sev.window.event == SDL_WINDOWEVENT_FOCUS_GAINED);
break;
}
break;

View file

@ -165,6 +165,7 @@ BOOL AppActive = TRUE;
int SessionState = 0;
int BlockMouseMove;
CVAR (Bool, i_soundinbackground, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Bool, k_allowfullscreentoggle, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CUSTOM_CVAR(Bool, norawinput, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL)
@ -567,7 +568,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
SetPriorityClass (GetCurrentProcess (), IDLE_PRIORITY_CLASS);
}
S_SetSoundPaused (wParam);
S_SetSoundPaused ((!!i_soundinbackground) || wParam);
break;
case WM_WTSSESSION_CHANGE:

View file

@ -1130,7 +1130,7 @@ void Win32GLFrameBuffer::InitializeState()
bool Win32GLFrameBuffer::CanUpdate()
{
if (!AppActive) return false;
if (!AppActive && IsFullscreen()) return false;
return true;
}