mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- Draw 1 pixel of border at the edges of the status bar to prevent imprecision HOMs (only top and bottom for non-widescreen for now).
- The completeborder command is handled at the base statusbar now since it can do so more efficiently. SVN r3771 (trunk)
This commit is contained in:
parent
fdc6a03125
commit
340db9160b
3 changed files with 35 additions and 22 deletions
|
@ -343,6 +343,7 @@ public:
|
|||
bool Scaled;
|
||||
bool Centering;
|
||||
bool FixedOrigin;
|
||||
bool CompleteBorder;
|
||||
fixed_t CrosshairSize;
|
||||
fixed_t Displacement;
|
||||
|
||||
|
|
|
@ -978,6 +978,8 @@ public:
|
|||
}
|
||||
invBarOffset = script->Images.Size();
|
||||
Images.Init(&patchnames[0], patchnames.Size());
|
||||
|
||||
CompleteBorder = script->completeBorder;
|
||||
}
|
||||
|
||||
~DSBarInfo ()
|
||||
|
@ -991,13 +993,6 @@ public:
|
|||
int hud = STBAR_NORMAL;
|
||||
if(state == HUD_StatusBar)
|
||||
{
|
||||
if(script->completeBorder) //Fill the statusbar with the border before we draw.
|
||||
{
|
||||
FTexture *b = TexMan[gameinfo.border->b];
|
||||
V_DrawBorder(viewwindowx, viewwindowy + viewheight + b->GetHeight(), viewwindowx + viewwidth, SCREENHEIGHT);
|
||||
if(screenblocks == 10)
|
||||
screen->FlatFill(viewwindowx, viewwindowy + viewheight, viewwindowx + viewwidth, viewwindowy + viewheight + b->GetHeight(), b, true);
|
||||
}
|
||||
if(script->automapbar && automapactive)
|
||||
{
|
||||
hud = STBAR_AUTOMAP;
|
||||
|
|
|
@ -216,6 +216,7 @@ void ST_Clear()
|
|||
|
||||
DBaseStatusBar::DBaseStatusBar (int reltop, int hres, int vres)
|
||||
{
|
||||
CompleteBorder = false;
|
||||
Centering = false;
|
||||
FixedOrigin = false;
|
||||
CrosshairSize = FRACUNIT;
|
||||
|
@ -1037,27 +1038,43 @@ void DBaseStatusBar::RefreshBackground () const
|
|||
{
|
||||
int x, x2, y, ratio;
|
||||
|
||||
if (SCREENWIDTH > 320)
|
||||
ratio = CheckRatio (SCREENWIDTH, SCREENHEIGHT);
|
||||
x = (!(ratio & 3) || !Scaled) ? ST_X : SCREENWIDTH*(48-BaseRatioSizes[ratio][3])/(48*2);
|
||||
y = x == ST_X && x > 0 ? ST_Y : ::ST_Y;
|
||||
|
||||
if(!CompleteBorder)
|
||||
{
|
||||
ratio = CheckRatio (SCREENWIDTH, SCREENHEIGHT);
|
||||
x = (!(ratio & 3) || !Scaled) ? ST_X : SCREENWIDTH*(48-BaseRatioSizes[ratio][3])/(48*2);
|
||||
if (x > 0)
|
||||
V_DrawBorder (x+1, y, SCREENWIDTH, y+1);
|
||||
V_DrawBorder (x+1, SCREENHEIGHT-1, SCREENWIDTH, SCREENHEIGHT);
|
||||
}
|
||||
else
|
||||
{
|
||||
x = SCREENWIDTH;
|
||||
}
|
||||
|
||||
if (x > 0)
|
||||
{
|
||||
if(!CompleteBorder)
|
||||
{
|
||||
y = x == ST_X ? ST_Y : ::ST_Y;
|
||||
x2 = !(ratio & 3) || !Scaled ? ST_X+HorizontalResolution :
|
||||
SCREENWIDTH - (SCREENWIDTH*(48-BaseRatioSizes[ratio][3])+48*2-1)/(48*2);
|
||||
V_DrawBorder (0, y, x, SCREENHEIGHT);
|
||||
V_DrawBorder (x2, y, SCREENWIDTH, SCREENHEIGHT);
|
||||
}
|
||||
else
|
||||
{
|
||||
x2 = SCREENWIDTH;
|
||||
}
|
||||
|
||||
if (setblocks >= 10)
|
||||
{
|
||||
const gameborder_t *border = gameinfo.border;
|
||||
FTexture *p;
|
||||
V_DrawBorder (0, y, x+1, SCREENHEIGHT);
|
||||
V_DrawBorder (x2-1, y, SCREENWIDTH, SCREENHEIGHT);
|
||||
|
||||
p = TexMan[border->b];
|
||||
screen->FlatFill(0, y, x, y + p->GetHeight(), p, true);
|
||||
screen->FlatFill(x2, y, SCREENWIDTH, y + p->GetHeight(), p, true);
|
||||
}
|
||||
if (setblocks >= 10)
|
||||
{
|
||||
const gameborder_t *border = gameinfo.border;
|
||||
FTexture *p;
|
||||
|
||||
p = TexMan[border->b];
|
||||
screen->FlatFill(0, y, x, y + p->GetHeight(), p, true);
|
||||
screen->FlatFill(x2, y, SCREENWIDTH, y + p->GetHeight(), p, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue