mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 07:11:54 +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 Scaled;
|
||||||
bool Centering;
|
bool Centering;
|
||||||
bool FixedOrigin;
|
bool FixedOrigin;
|
||||||
|
bool CompleteBorder;
|
||||||
fixed_t CrosshairSize;
|
fixed_t CrosshairSize;
|
||||||
fixed_t Displacement;
|
fixed_t Displacement;
|
||||||
|
|
||||||
|
|
|
@ -978,6 +978,8 @@ public:
|
||||||
}
|
}
|
||||||
invBarOffset = script->Images.Size();
|
invBarOffset = script->Images.Size();
|
||||||
Images.Init(&patchnames[0], patchnames.Size());
|
Images.Init(&patchnames[0], patchnames.Size());
|
||||||
|
|
||||||
|
CompleteBorder = script->completeBorder;
|
||||||
}
|
}
|
||||||
|
|
||||||
~DSBarInfo ()
|
~DSBarInfo ()
|
||||||
|
@ -991,13 +993,6 @@ public:
|
||||||
int hud = STBAR_NORMAL;
|
int hud = STBAR_NORMAL;
|
||||||
if(state == HUD_StatusBar)
|
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)
|
if(script->automapbar && automapactive)
|
||||||
{
|
{
|
||||||
hud = STBAR_AUTOMAP;
|
hud = STBAR_AUTOMAP;
|
||||||
|
|
|
@ -216,6 +216,7 @@ void ST_Clear()
|
||||||
|
|
||||||
DBaseStatusBar::DBaseStatusBar (int reltop, int hres, int vres)
|
DBaseStatusBar::DBaseStatusBar (int reltop, int hres, int vres)
|
||||||
{
|
{
|
||||||
|
CompleteBorder = false;
|
||||||
Centering = false;
|
Centering = false;
|
||||||
FixedOrigin = false;
|
FixedOrigin = false;
|
||||||
CrosshairSize = FRACUNIT;
|
CrosshairSize = FRACUNIT;
|
||||||
|
@ -1037,17 +1038,34 @@ void DBaseStatusBar::RefreshBackground () const
|
||||||
{
|
{
|
||||||
int x, x2, y, ratio;
|
int x, x2, y, ratio;
|
||||||
|
|
||||||
if (SCREENWIDTH > 320)
|
|
||||||
{
|
|
||||||
ratio = CheckRatio (SCREENWIDTH, SCREENHEIGHT);
|
ratio = CheckRatio (SCREENWIDTH, SCREENHEIGHT);
|
||||||
x = (!(ratio & 3) || !Scaled) ? ST_X : SCREENWIDTH*(48-BaseRatioSizes[ratio][3])/(48*2);
|
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)
|
||||||
|
{
|
||||||
|
V_DrawBorder (x+1, y, SCREENWIDTH, y+1);
|
||||||
|
V_DrawBorder (x+1, SCREENHEIGHT-1, SCREENWIDTH, SCREENHEIGHT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = SCREENWIDTH;
|
||||||
|
}
|
||||||
|
|
||||||
if (x > 0)
|
if (x > 0)
|
||||||
{
|
{
|
||||||
y = x == ST_X ? ST_Y : ::ST_Y;
|
if(!CompleteBorder)
|
||||||
|
{
|
||||||
x2 = !(ratio & 3) || !Scaled ? ST_X+HorizontalResolution :
|
x2 = !(ratio & 3) || !Scaled ? ST_X+HorizontalResolution :
|
||||||
SCREENWIDTH - (SCREENWIDTH*(48-BaseRatioSizes[ratio][3])+48*2-1)/(48*2);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
V_DrawBorder (0, y, x+1, SCREENHEIGHT);
|
||||||
|
V_DrawBorder (x2-1, y, SCREENWIDTH, SCREENHEIGHT);
|
||||||
|
|
||||||
if (setblocks >= 10)
|
if (setblocks >= 10)
|
||||||
{
|
{
|
||||||
|
@ -1059,7 +1077,6 @@ void DBaseStatusBar::RefreshBackground () const
|
||||||
screen->FlatFill(x2, y, SCREENWIDTH, y + p->GetHeight(), p, true);
|
screen->FlatFill(x2, y, SCREENWIDTH, y + p->GetHeight(), p, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue