- make screen border flat scale up

This commit is contained in:
Rachael Alexanderson 2020-05-06 07:37:09 -04:00
parent bc3947b643
commit b746484da3
2 changed files with 14 additions and 9 deletions

View file

@ -755,10 +755,12 @@ 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());
fU1 = 0.f;
fV1 = 0.f;
fU2 = 320.f / (float)src->GetDisplayWidth() * fs / ar;
fV2 = 200.f / (float)src->GetDisplayHeight() * fs;
float sw = 320.f / (float)screen->GetWidth() / ar;
float sh = 200.f / (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;
fV2 = float(bottom) / (float)src->GetDisplayHeight() * fs * sh;
break;
}
dg.mVertIndex = (int)mVertices.Reserve(4);

View file

@ -43,6 +43,7 @@
EXTERN_CVAR(Int, vid_aspect)
EXTERN_CVAR(Int, uiscale)
CVAR(Bool, ui_screenborder_classic_scaling, true, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
// Helper for ActiveRatio and CheckRatio. Returns the forced ratio type, or -1 if none.
int ActiveFakeRatio(int width, int height)
@ -1161,10 +1162,11 @@ void FillBorder (F2DDrawer *drawer, FGameTexture *img)
if (img != NULL)
{
drawer->AddFlatFill(0, 0, Width, bordtop, img); // Top
drawer->AddFlatFill(0, bordtop, bordleft, Height - bordbottom, img); // Left
drawer->AddFlatFill(Width - bordright, bordtop, Width, Height - bordbottom, img); // Right
drawer->AddFlatFill(0, Height - bordbottom, Width, Height, img); // Bottom
int filltype = (ui_screenborder_classic_scaling) ? -1 : 0;
drawer->AddFlatFill(0, 0, Width, bordtop, img, filltype); // Top
drawer->AddFlatFill(0, bordtop, bordleft, Height - bordbottom, img, filltype); // Left
drawer->AddFlatFill(Width - bordright, bordtop, Width, Height - bordbottom, img, filltype); // Right
drawer->AddFlatFill(0, Height - bordbottom, Width, Height, img, filltype); // Bottom
}
else
{
@ -1351,9 +1353,10 @@ DEFINE_ACTION_FUNCTION(_Screen, Dim)
void DrawBorder (F2DDrawer *drawer, FTextureID picnum, int x1, int y1, int x2, int y2)
{
int filltype = (ui_screenborder_classic_scaling) ? -1 : 0;
if (picnum.isValid())
{
drawer->AddFlatFill (x1, y1, x2, y2, TexMan.GetGameTexture(picnum, false));
drawer->AddFlatFill (x1, y1, x2, y2, TexMan.GetGameTexture(picnum, false), filltype);
}
else
{