- replicate GZDoom commit 12ed24d066

This commit is contained in:
Rachael Alexanderson 2022-01-15 20:20:46 -05:00 committed by Christoph Oelckers
parent c6f991a798
commit 13ca744ef8
4 changed files with 23 additions and 23 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

@ -83,6 +83,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
CVAR(Bool, autoloadlights, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR(Bool, autoloadbrightmaps, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Bool, autoloadwidescreen, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR (Bool, i_soundinbackground, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Bool, i_pauseinbackground, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
// Note: For the automap label there is a separate option "am_textfont".
CVARD(Bool, hud_textfont, false, CVAR_ARCHIVE, "Use the regular text font as replacement for the tiny 3x5 font for HUD messages whenever possible")
@ -1247,15 +1249,24 @@ void S_ResumeSound (bool notsfx)
void S_SetSoundPaused(int state)
{
if (state)
if (!netgame && (i_pauseinbackground)
#ifdef 0 //_DEBUG
&& !demoplayback
#endif
)
{
pauseext = !state;
}
if ((state || i_soundinbackground) && !pauseext)
{
if (paused == 0)
{
S_ResumeSound(true);
}
if (GSnd != nullptr)
{
GSnd->SetInactive(SoundRenderer::INACTIVE_Active);
if (GSnd != nullptr)
{
GSnd->SetInactive(SoundRenderer::INACTIVE_Active);
}
}
}
else
@ -1265,22 +1276,15 @@ void S_SetSoundPaused(int state)
S_PauseSound(false, true);
if (GSnd != nullptr)
{
GSnd->SetInactive(SoundRenderer::INACTIVE_Complete);
GSnd->SetInactive(gamestate == GS_LEVEL || gamestate == GS_TITLELEVEL ?
SoundRenderer::INACTIVE_Complete :
SoundRenderer::INACTIVE_Mute);
}
}
}
#if 0
if (!netgame
#if 0 //def _DEBUG
&& !demoplayback
#endif
)
{
pauseext = !state;
}
#endif
}
FString G_GetDemoPath()
{
FString path = M_GetDemoPath();