- implemented proper scaling for the status bar itself.

This allows using the UI scale or its own value, like all other scaling values.
In addition there is a choice between preserving equal pixel size or aspect ratio because the squashed non-corrected versions tend to look odd, but since proper scaling requires ununiform pixel sizes it is an option.

- changed how status bar sizes are being handled.

This has to recalculate all scaling and positioning factors, which can cause problems if the drawer leaves with some temporary values that do not reflect the status bar as a whole.
Changed it so that the status bar stores the base values and restores them after drawing is complete.
This commit is contained in:
Christoph Oelckers 2017-03-29 19:23:40 +02:00
commit 1d4ab0cc2a
23 changed files with 227 additions and 260 deletions

View file

@ -65,6 +65,11 @@
CUSTOM_CVAR(Int, uiscale, 2, CVAR_ARCHIVE | CVAR_NOINITCALL)
{
if (self < 0)
{
self = 0;
return;
}
if (StatusBar != NULL)
{
StatusBar->CallScreenSizeChanged();
@ -1257,10 +1262,9 @@ static void V_DrawViewBorder (void)
V_DrawBorder (0, 0, SCREENWIDTH, viewwindowy);
V_DrawBorder (0, viewwindowy, viewwindowx, viewheight + viewwindowy);
V_DrawBorder (viewwindowx + viewwidth, viewwindowy, SCREENWIDTH, viewheight + viewwindowy);
V_DrawBorder (0, viewwindowy + viewheight, SCREENWIDTH, gST_Y);
V_DrawBorder (0, viewwindowy + viewheight, SCREENWIDTH, StatusBar->GetTopOfStatusbar());
V_DrawFrame (viewwindowx, viewwindowy, viewwidth, viewheight);
V_MarkRect (0, 0, SCREENWIDTH, gST_Y);
}
//==========================================================================