mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-24 04:29:34 -04:00
some PWADs have STNUM* patches of various width/height (Avactor.wad) (#691)
* some PWADs have STNUM* patches of various width/height (Avactor.wad) * redraw parts of STBAR every tick * always redraw entire STBAR every tic
This commit is contained in:
parent
6137fb4143
commit
4adc9391f2
42
src/st_lib.c
42
src/st_lib.c
@ -101,23 +101,14 @@ void STlib_drawNum
|
|||||||
char *outrng, //jff 2/16/98 add color translation to digit output
|
char *outrng, //jff 2/16/98 add color translation to digit output
|
||||||
boolean refresh )
|
boolean refresh )
|
||||||
{
|
{
|
||||||
|
|
||||||
int numdigits = n->width;
|
int numdigits = n->width;
|
||||||
int num = *n->num;
|
int num = *n->num;
|
||||||
|
|
||||||
int w = SHORT(n->p[0]->width);
|
int w = SHORT(n->p[0]->width);
|
||||||
int h = SHORT(n->p[0]->height);
|
|
||||||
int x = n->x;
|
int x = n->x;
|
||||||
int rectx, recty;
|
|
||||||
|
|
||||||
int neg;
|
int neg;
|
||||||
|
|
||||||
// [crispy] redraw only if necessary
|
|
||||||
if (n->oldnum == num && !refresh)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
n->oldnum = *n->num;
|
n->oldnum = *n->num;
|
||||||
|
|
||||||
neg = num < 0;
|
neg = num < 0;
|
||||||
@ -132,13 +123,6 @@ void STlib_drawNum
|
|||||||
num = -num;
|
num = -num;
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear the area
|
|
||||||
rectx = x - SHORT(n->p[0]->leftoffset) - numdigits * w + WIDESCREENDELTA;
|
|
||||||
recty = n->y - SHORT(n->p[0]->topoffset);
|
|
||||||
|
|
||||||
if (!st_crispyhud)
|
|
||||||
V_CopyRect(rectx, recty - ST_Y, BG, numdigits * w, h, rectx, recty, FG);
|
|
||||||
|
|
||||||
// if non-number, do not draw it
|
// if non-number, do not draw it
|
||||||
if (num == 1994)
|
if (num == 1994)
|
||||||
return;
|
return;
|
||||||
@ -169,10 +153,11 @@ void STlib_drawNum
|
|||||||
//jff 2/16/98 add color translation to digit output
|
//jff 2/16/98 add color translation to digit output
|
||||||
if (neg && sttminus)
|
if (neg && sttminus)
|
||||||
{
|
{
|
||||||
|
w = SHORT(sttminus->width);
|
||||||
if (outrng && !sts_always_red)
|
if (outrng && !sts_always_red)
|
||||||
V_DrawPatchTranslated(x - 8, n->y, FG, sttminus,outrng,0);
|
V_DrawPatchTranslated(x - w, n->y, FG, sttminus,outrng,0);
|
||||||
else //jff 2/18/98 allow use of faster draw routine from config
|
else //jff 2/18/98 allow use of faster draw routine from config
|
||||||
V_DrawPatch(x - 8, n->y, FG, sttminus);
|
V_DrawPatch(x - w, n->y, FG, sttminus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,29 +274,10 @@ void STlib_updateMultIcon
|
|||||||
( st_multicon_t* mi,
|
( st_multicon_t* mi,
|
||||||
boolean refresh )
|
boolean refresh )
|
||||||
{
|
{
|
||||||
int w;
|
if (*mi->on)
|
||||||
int h;
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
|
|
||||||
if (*mi->on && (mi->oldinum != *mi->inum || refresh))
|
|
||||||
{
|
{
|
||||||
if (mi->oldinum != -1)
|
|
||||||
{
|
|
||||||
x = mi->x - SHORT(mi->p[mi->oldinum]->leftoffset);
|
|
||||||
y = mi->y - SHORT(mi->p[mi->oldinum]->topoffset);
|
|
||||||
w = SHORT(mi->p[mi->oldinum]->width);
|
|
||||||
h = SHORT(mi->p[mi->oldinum]->height);
|
|
||||||
|
|
||||||
if (y - ST_Y < 0)
|
|
||||||
I_Error("updateMultIcon: y - ST_Y < 0");
|
|
||||||
|
|
||||||
if (!st_crispyhud)
|
|
||||||
V_CopyRect(x + WIDESCREENDELTA, y-ST_Y, BG, w, h, x + WIDESCREENDELTA, y, FG);
|
|
||||||
}
|
|
||||||
if (*mi->inum != -1) // killough 2/16/98: redraw only if != -1
|
if (*mi->inum != -1) // killough 2/16/98: redraw only if != -1
|
||||||
V_DrawPatch(mi->x, mi->y, FG, mi->p[*mi->inum]);
|
V_DrawPatch(mi->x, mi->y, FG, mi->p[*mi->inum]);
|
||||||
mi->oldinum = *mi->inum;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -851,6 +851,12 @@ void ST_drawWidgets(boolean refresh)
|
|||||||
int i;
|
int i;
|
||||||
int maxammo = plyr->maxammo[weaponinfo[w_ready.data].ammo];
|
int maxammo = plyr->maxammo[weaponinfo[w_ready.data].ammo];
|
||||||
|
|
||||||
|
// clear area
|
||||||
|
if (!st_crispyhud)
|
||||||
|
{
|
||||||
|
V_CopyRect(WIDESCREENDELTA, 0, BG, ST_WIDTH, ST_HEIGHT, WIDESCREENDELTA, ST_Y, FG);
|
||||||
|
}
|
||||||
|
|
||||||
// used by w_arms[] widgets
|
// used by w_arms[] widgets
|
||||||
st_armson = st_statusbaron && !deathmatch;
|
st_armson = st_statusbaron && !deathmatch;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user