mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 21:11:39 +00:00
- 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:
parent
d10304ea4e
commit
000037dbf6
4 changed files with 7 additions and 4 deletions
|
@ -60,6 +60,7 @@
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
CVAR (Bool, i_soundinbackground, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||||
EXTERN_CVAR(Int, vid_defwidth )
|
EXTERN_CVAR(Int, vid_defwidth )
|
||||||
EXTERN_CVAR(Int, vid_defheight)
|
EXTERN_CVAR(Int, vid_defheight)
|
||||||
EXTERN_CVAR(Bool, vid_vsync )
|
EXTERN_CVAR(Bool, vid_vsync )
|
||||||
|
@ -323,7 +324,7 @@ ApplicationController* appCtrl;
|
||||||
{
|
{
|
||||||
ZD_UNUSED(aNotification);
|
ZD_UNUSED(aNotification);
|
||||||
|
|
||||||
S_SetSoundPaused(0);
|
S_SetSoundPaused((!!i_soundinbackground) || 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@ extern int paused;
|
||||||
CVAR (Bool, use_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
CVAR (Bool, use_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||||
CVAR (Bool, m_noprescale, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
CVAR (Bool, m_noprescale, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||||
CVAR (Bool, m_filter, 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)
|
EXTERN_CVAR (Bool, fullscreen)
|
||||||
|
|
||||||
|
@ -312,7 +313,7 @@ void MessagePump (const SDL_Event &sev)
|
||||||
{
|
{
|
||||||
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||||
case SDL_WINDOWEVENT_FOCUS_LOST:
|
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;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -165,6 +165,7 @@ BOOL AppActive = TRUE;
|
||||||
int SessionState = 0;
|
int SessionState = 0;
|
||||||
int BlockMouseMove;
|
int BlockMouseMove;
|
||||||
|
|
||||||
|
CVAR (Bool, i_soundinbackground, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||||
CVAR (Bool, k_allowfullscreentoggle, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
CVAR (Bool, k_allowfullscreentoggle, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||||
|
|
||||||
CUSTOM_CVAR(Bool, norawinput, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL)
|
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);
|
SetPriorityClass (GetCurrentProcess (), IDLE_PRIORITY_CLASS);
|
||||||
}
|
}
|
||||||
S_SetSoundPaused (wParam);
|
S_SetSoundPaused ((!!i_soundinbackground) || wParam);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_WTSSESSION_CHANGE:
|
case WM_WTSSESSION_CHANGE:
|
||||||
|
|
|
@ -1130,7 +1130,7 @@ void Win32GLFrameBuffer::InitializeState()
|
||||||
|
|
||||||
bool Win32GLFrameBuffer::CanUpdate()
|
bool Win32GLFrameBuffer::CanUpdate()
|
||||||
{
|
{
|
||||||
if (!AppActive) return false;
|
if (!AppActive && IsFullscreen()) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue