Skip to content

Commit

Permalink
Use consistent purge tag (#1225)
Browse files Browse the repository at this point in the history
* Use consistent purge tag

* Add comment

* Revert "Add comment"

This reverts commit 070f291.

* Revert "Use consistent purge tag"

This reverts commit 5507bd3.

* Always use `PU_CACHE`

* Update pointer just before drawing

* Use accurate comments

* Use local variables for `PU_CACHE`
  • Loading branch information
ceski-1 authored Oct 15, 2023
1 parent a19eaca commit b56177c
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions src/st_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,6 @@ static patch_t *faceback[MAXPLAYERS]; // killough 3/7/98: make array
// main bar right
static patch_t *armsbg;

// Bezel bottom edge for st_solidbackground.
static patch_t *bezel;

// weapon ownership patches
static patch_t *arms[6][2];

Expand Down Expand Up @@ -416,10 +413,12 @@ void ST_refreshBackground(boolean force)
// [crispy] preserve bezel bottom edge
if (scaledviewwidth == SCREENWIDTH)
{
patch_t *const patch = W_CacheLumpName("brdr_b", PU_CACHE);

for (x = 0; x < WIDESCREENDELTA; x += 8)
{
V_DrawPatch(x - WIDESCREENDELTA, 0, BG, bezel);
V_DrawPatch(ORIGWIDTH + WIDESCREENDELTA - x - 8, 0, BG, bezel);
V_DrawPatch(x - WIDESCREENDELTA, 0, BG, patch);
V_DrawPatch(ORIGWIDTH + WIDESCREENDELTA - x - 8, 0, BG, patch);
}
}
}
Expand Down Expand Up @@ -1082,9 +1081,6 @@ void ST_loadGraphics(void)
break;
}
have_xdthfaces = i;

// Bezel bottom edge for st_solidbackground.
bezel = W_CacheLumpName("BRDR_B", PU_STATIC);
}

void ST_loadData(void)
Expand Down Expand Up @@ -1306,16 +1302,17 @@ static int StatusBarBufferHeight(void)
{
int i;
int st_height = ST_HEIGHT;
patch_t *const patch = W_CacheLumpName("brdr_b", PU_CACHE);

if (patch && patch->height > st_height)
st_height = patch->height;

if (sbar && sbar->height > st_height)
st_height = sbar->height;

if (armsbg && armsbg->height > st_height)
st_height = armsbg->height;

if (bezel && bezel->height > st_height)
st_height = bezel->height;

for (i = 0; i < MAXPLAYERS; i++)
{
if (faceback[i] && faceback[i]->height > st_height)
Expand Down Expand Up @@ -1346,6 +1343,13 @@ void ST_Init(void)
void ST_Warnings(void)
{
int i;
patch_t *const patch = W_CacheLumpName("brdr_b", PU_CACHE);

if (patch && patch->height > ST_HEIGHT)
{
I_Printf(VB_WARNING, "ST_Init: Non-standard BRDR_B height of %d. "
"Expected <= %d.", patch->height, ST_HEIGHT);
}

if (sbar && sbar->height != ST_HEIGHT)
{
Expand All @@ -1359,12 +1363,6 @@ void ST_Warnings(void)
"Expected <= %d.", armsbg->height, ST_HEIGHT);
}

if (bezel && bezel->height > ST_HEIGHT)
{
I_Printf(VB_WARNING, "ST_Init: Non-standard BRDR_B height of %d. "
"Expected <= %d.", bezel->height, ST_HEIGHT);
}

for (i = 0; i < MAXPLAYERS; i++)
{
if (faceback[i] && faceback[i]->height > ST_HEIGHT)
Expand Down

0 comments on commit b56177c

Please sign in to comment.