Change swtruecolor cvar to take effect immediately

This commit is contained in:
Magnus Norddahl 2016-06-01 06:02:37 +02:00
commit b9d7a98aec
4 changed files with 30 additions and 19 deletions

View file

@ -311,10 +311,18 @@ void I_RestoreWindowedPos ()
MoveWindow (Window, winx, winy, winw, winh, TRUE);
}
CVAR (Bool, swtruecolor, false, CVAR_ARCHIVE)
extern int NewWidth, NewHeight, NewBits, DisplayBits;
CUSTOM_CVAR(Bool, swtruecolor, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL)
{
// Strictly speaking this doesn't require a mode switch, but it is the easiest
// way to force a CreateFramebuffer call without a lot of refactoring.
NewWidth = screen->GetWidth();
NewHeight = screen->GetHeight();
NewBits = DisplayBits;
setmodeneeded = true;
}
CUSTOM_CVAR (Bool, fullscreen, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL)
{
NewWidth = screen->GetWidth();