Skip to content

Commit

Permalink
Chex Quest: Fixed hole in the statusbar due to empty STARMS patch
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Feb 19, 2012
1 parent 1b8d5e9 commit 8ebc2fe
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions doomsday/plugins/jdoom/src/st_stuff.c
Expand Up @@ -298,6 +298,11 @@ void SBarBackground_Drawer(uiwidget_t* obj, const Point2Raw* offset)
if(!deathmatch)
{
haveArms = R_GetPatchInfo(pArmsBackground, &armsInfo);

// Do not cut out the arms area if the graphic is "empty" (no color info).
if(haveArms && armsInfo.flags.isEmpty)
haveArms = false;

if(haveArms)
{
armsBGX = ST_ARMSBGX + armsInfo.geometry.origin.x;
Expand Down Expand Up @@ -330,21 +335,20 @@ void SBarBackground_Drawer(uiwidget_t* obj, const Point2Raw* offset)
else
{
// Alpha blended status bar, we'll need to cut it up into smaller bits...
DGL_Begin(DGL_QUADS);

// Up to faceback or ST_ARMS.
w = haveArms? armsBGX : ST_FX;
h = HEIGHT;
cw = w / WIDTH;

DGL_TexCoord2f(0, 0, 0);
DGL_Vertex2f(x, y);
DGL_TexCoord2f(0, cw, 0);
DGL_Vertex2f(x + w, y);
DGL_TexCoord2f(0, cw, 1);
DGL_Vertex2f(x + w, y + h);
DGL_TexCoord2f(0, 0, 1);
DGL_Vertex2f(x, y + h);
DGL_Begin(DGL_QUADS);
DGL_TexCoord2f(0, 0, 0);
DGL_Vertex2f(x, y);
DGL_TexCoord2f(0, cw, 0);
DGL_Vertex2f(x + w, y);
DGL_TexCoord2f(0, cw, 1);
DGL_Vertex2f(x + w, y + h);
DGL_TexCoord2f(0, 0, 1);
DGL_Vertex2f(x, y + h);

if(IS_NETGAME)
{
Expand Down Expand Up @@ -415,26 +419,25 @@ void SBarBackground_Drawer(uiwidget_t* obj, const Point2Raw* offset)
cw = (float)sectionWidth / WIDTH;
}
}
else if(haveArms)
else
{
// Including area behind the face status indicator.
int sectionWidth = armsBGX + armsInfo.geometry.size.width;
int sectionWidth = (haveArms? armsBGX + armsInfo.geometry.size.width : ST_FX);
x = ORIGINX + sectionWidth;
y = ORIGINY;
w = WIDTH - sectionWidth;
h = HEIGHT;
cw = (float)sectionWidth / WIDTH;
}

DGL_TexCoord2f(0, cw, 0);
DGL_Vertex2f(x, y);
DGL_TexCoord2f(0, 1, 0);
DGL_Vertex2f(x + w, y);
DGL_TexCoord2f(0, 1, 1);
DGL_Vertex2f(x + w, y + h);
DGL_TexCoord2f(0, cw, 1);
DGL_Vertex2f(x, y + h);

DGL_TexCoord2f(0, cw, 0);
DGL_Vertex2f(x, y);
DGL_TexCoord2f(0, 1, 0);
DGL_Vertex2f(x + w, y);
DGL_TexCoord2f(0, 1, 1);
DGL_Vertex2f(x + w, y + h);
DGL_TexCoord2f(0, cw, 1);
DGL_Vertex2f(x, y + h);
DGL_End();
}

Expand Down

0 comments on commit 8ebc2fe

Please sign in to comment.