mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-04-21 18:30:51 +00:00
- make screen border flat scale up
This commit is contained in:
parent
bc3947b643
commit
b746484da3
2 changed files with 14 additions and 9 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue