- add scaling customization for classic ui flat scaling

This commit is contained in:
Rachael Alexanderson 2020-05-06 07:47:58 -04:00
parent b746484da3
commit 8f63bd773a

View file

@ -44,6 +44,8 @@ static F2DDrawer drawer;
F2DDrawer* twod = &drawer;
EXTERN_CVAR(Float, transsouls)
CVAR(Float, classic_scaling_factor, 1.0, CVAR_ARCHIVE)
CVAR(Float, classic_scaling_pixelaspect, 1.2, CVAR_ARCHIVE)
IMPLEMENT_CLASS(DShape2DTransform, false, false)
@ -755,8 +757,8 @@ void F2DDrawer::AddFlatFill(int left, int top, int right, int bottom, FGameTextu
case -1: // classic flat scaling
float ar = 4.f / 3.f / (float)ActiveRatio((float)screen->GetWidth(), (float)screen->GetHeight());
float sw = 320.f / (float)screen->GetWidth() / ar;
float sh = 200.f / (float)screen->GetHeight();
float sw = 320.f * classic_scaling_factor / (float)screen->GetWidth() / ar;
float sh = 240.f / classic_scaling_pixelaspect * classic_scaling_factor / (float)screen->GetHeight();
fU1 = float(left) / (float)src->GetDisplayWidth() * fs * sw;
fV1 = float(top) / (float)src->GetDisplayHeight() * fs * sh;
fU2 = float(right) / (float)src->GetDisplayWidth() * fs * sw;