Scale the console itself as specified by con_scaletext

This commit is contained in:
Magnus Norddahl 2016-09-06 21:35:57 +02:00 committed by Christoph Oelckers
commit d2f8fc63fc
2 changed files with 101 additions and 23 deletions

View file

@ -65,6 +65,7 @@
#include "menu/menu.h"
#include "r_data/voxels.h"
int con_uiscale();
FRenderer *Renderer;
@ -857,10 +858,20 @@ void DFrameBuffer::DrawRateStuff ()
int chars;
int rate_x;
int textScale = con_uiscale();
if (textScale == 0)
textScale = CleanXfac;
chars = mysnprintf (fpsbuff, countof(fpsbuff), "%2u ms (%3u fps)", howlong, LastCount);
rate_x = Width - ConFont->StringWidth(&fpsbuff[0]);
Clear (rate_x, 0, Width, ConFont->GetHeight(), GPalette.BlackIndex, 0);
DrawText (ConFont, CR_WHITE, rate_x, 0, (char *)&fpsbuff[0], TAG_DONE);
rate_x = Width / textScale - ConFont->StringWidth(&fpsbuff[0]);
Clear (rate_x * textScale, 0, Width, ConFont->GetHeight() * textScale, GPalette.BlackIndex, 0);
if (textScale == 1)
DrawText (ConFont, CR_WHITE, rate_x, 0, (char *)&fpsbuff[0], TAG_DONE);
else
DrawText (ConFont, CR_WHITE, rate_x, 0, (char *)&fpsbuff[0],
DTA_VirtualWidth, screen->GetWidth() / textScale,
DTA_VirtualHeight, screen->GetHeight() / textScale,
DTA_KeepRatio, true, TAG_DONE);
DWORD thisSec = ms/1000;
if (LastSec < thisSec)