- Replace vid_max_width and vid_max_height with vid_scalemode for the GL software framebuffer backend

- Fix a crash if the window was resized before creating a game
- Fix main menu scaling being wrong if the video mode didn't match the unscaled screen size
This commit is contained in:
Magnus Norddahl 2017-07-23 04:23:13 +02:00
commit 370e53befe
2 changed files with 19 additions and 14 deletions

View file

@ -88,6 +88,9 @@ EXTERN_CVAR(Bool, r_blendmethod)
int active_con_scale();
int ViewportScaledWidth(int width);
int ViewportScaledHeight(int height);
FRenderer *Renderer;
EXTERN_CVAR (Bool, swtruecolor)
@ -782,7 +785,7 @@ void DSimpleCanvas::Unlock ()
//==========================================================================
DFrameBuffer::DFrameBuffer (int width, int height, bool bgra)
: DSimpleCanvas (width, height, bgra)
: DSimpleCanvas (ViewportScaledWidth(width), ViewportScaledHeight(height), bgra)
{
LastMS = LastSec = FrameCount = LastCount = LastTic = 0;
Accel2D = false;
@ -1289,7 +1292,7 @@ bool V_DoModeSetup (int width, int height, int bits)
FFont::StaticPreloadFonts();
DisplayBits = bits;
V_UpdateModeSize(width, height);
V_UpdateModeSize(screen->GetWidth(), screen->GetHeight());
M_RefreshModesList ();