- added a special slider type for the scaling options that prints a descriptive text instead of the slider for the special settings.

- fixed the adaptive scale calculation in GetUIScale which had the coordinates mixed up.
This commit is contained in:
Christoph Oelckers 2017-03-30 11:30:09 +02:00
commit a3ef711d1d
5 changed files with 70 additions and 11 deletions

View file

@ -63,7 +63,7 @@
#include "g_levellocals.h"
#include "textures.h"
CUSTOM_CVAR(Int, uiscale, 2, CVAR_ARCHIVE | CVAR_NOINITCALL)
CUSTOM_CVAR(Int, uiscale, 0, CVAR_ARCHIVE | CVAR_NOINITCALL)
{
if (self < 0)
{
@ -82,9 +82,9 @@ int GetUIScale(int altval)
if (altval > 0) scaleval = altval;
else if (uiscale == 0)
{
// Default should try to scale to 640x480
int vscale = screen->GetHeight() / 640;
int hscale = screen->GetWidth() / 480;
// Default should try to scale to 640x400
int vscale = screen->GetHeight() / 400;
int hscale = screen->GetWidth() / 640;
scaleval = clamp(vscale, 1, hscale);
}
else scaleval = uiscale;