- added background dimming for the menu when in overlay mode.

This commit is contained in:
Christoph Oelckers 2020-10-10 18:29:15 +02:00
parent b142f33edd
commit 16a4d49268
2 changed files with 5 additions and 20 deletions

View file

@ -491,6 +491,7 @@ void I_StartupJoysticks();
void I_ShutdownInput();
int RunGame();
void System_MenuClosed();
void System_MenuDim();
int GameMain()
{
@ -510,7 +511,7 @@ int GameMain()
nullptr,
System_GetSceneRect,
nullptr,
nullptr,
System_MenuDim,
nullptr,
System_DispatchEvent,
validFilter,

View file

@ -186,35 +186,19 @@ void System_MenuClosed()
gi->MenuClosed();
}
//==========================================================================
//
// M_Dim
//
// Applies a colored overlay to the entire screen, with the opacity
// determined by the dimamount cvar.
//
//==========================================================================
CUSTOM_CVAR(Float, dimamount, -1.f, CVAR_ARCHIVE)
void System_MenuDim()
{
if (self < 0.f && self != -1.f)
if (gamestate != GS_MENUSCREEN) // With GS_MENUSCREEN we can assume that the background has been tuned for proper menu display already.
{
self = -1.f;
}
else if (self > 1.f)
{
self = 1.f;
Dim(twod, 0, 0.5f, 0, 0, screen->GetWidth(), screen->GetHeight());
}
}
CVAR(Color, dimcolor, 0xffd700, CVAR_ARCHIVE)
//=============================================================================
//
//
//
//=============================================================================
//=============================================================================
//