Skip to content

Commit

Permalink
Fixed jHeretic/jHexen: "Heretic/HeXen: Minor inventory glitches" (see…
Browse files Browse the repository at this point in the history
  • Loading branch information
danij committed Sep 4, 2009
1 parent 7aca038 commit 54d120d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
17 changes: 11 additions & 6 deletions doomsday/plugins/jheretic/src/st_stuff.c
Expand Up @@ -650,19 +650,24 @@ static void drawWidgets(hudstate_t* hud)
// Current inventory item.
if((readyItem = P_InventoryReadyItem(player)) != IIT_NONE)
{
int x, y;
lumpnum_t patch;

if(hud->currentInvItemFlash > 0)
{
patch = dpInvItemFlash[hud->currentInvItemFlash % 5].lump;
x = ST_INVITEMX + 2;
y = ST_INVITEMY + 1;
}
else
{
patch = P_GetInvItem(readyItem-1)->patchLump;
x = ST_INVITEMX;
y = ST_INVITEMY;
}

DGL_Color4f(1, 1, 1, alpha);
GL_DrawPatch_CS(ST_INVITEMX, ST_INVITEMY, patch);
GL_DrawPatch_CS(x, y, patch);

if(!(hud->currentInvItemFlash > 0))
{
Expand Down Expand Up @@ -1020,9 +1025,9 @@ Draw_EndZoom();
if(hud->currentInvItemFlash > 0)
{
Draw_BeginZoom(cfg.hudScale, 318, 198);
GL_DrawPatchLitAlpha(286, 166, 1, iconAlpha / 2,
GL_DrawPatchLitAlpha(289, 169, 1, iconAlpha / 2,
dpInvItemBox.lump);
GL_DrawPatchLitAlpha(286, 166, 1, iconAlpha,
GL_DrawPatchLitAlpha(292, 170, 1, iconAlpha,
dpInvItemFlash[hud->currentInvItemFlash % 5].lump);
Draw_EndZoom();
}
Expand All @@ -1038,11 +1043,11 @@ Draw_EndZoom();

Draw_BeginZoom(cfg.hudScale, 318, 198);

GL_DrawPatchLitAlpha(286, 166, 1, iconAlpha / 2,
GL_DrawPatchLitAlpha(289, 169, 1, iconAlpha / 2,
dpInvItemBox.lump);
GL_DrawPatchLitAlpha(286, 166, 1, iconAlpha, patch);
GL_DrawPatchLitAlpha(289, 169, 1, iconAlpha, patch);
if((count = P_InventoryCount(player, readyItem)) > 1)
Hu_DrawSmallNum(count, ST_INVITEMCWIDTH, 313, 188,
Hu_DrawSmallNum(count, ST_INVITEMCWIDTH, 317, 191,
textAlpha);
Draw_EndZoom();
}
Expand Down
18 changes: 12 additions & 6 deletions doomsday/plugins/jhexen/src/st_stuff.c
Expand Up @@ -1265,19 +1265,24 @@ static void drawWidgets(hudstate_t* hud)
// Current inventory item.
if((readyItem = P_InventoryReadyItem(player)) != IIT_NONE)
{
int x, y;
lumpnum_t patch;

if(hud->currentInvItemFlash > 0)
{
patch = dpInvItemFlash[hud->currentInvItemFlash % 5].lump;
x = ST_INVITEMX + 4;
y = ST_INVITEMY;
}
else
{
patch = P_GetInvItem(readyItem-1)->patchLump;
x = ST_INVITEMX;
y = ST_INVITEMY;
}

DGL_Color4f(1, 1, 1, alpha);
GL_DrawPatch_CS(ST_INVITEMX, ST_INVITEMY, patch);
GL_DrawPatch_CS(x, y, patch);

if(!(hud->currentInvItemFlash > 0))
{
Expand Down Expand Up @@ -1569,11 +1574,12 @@ void ST_doFullscreenStuff(int player)
{
if(hud->currentInvItemFlash > 0)
{
const dpatch_t* dp = &dpInvItemFlash[hud->currentInvItemFlash % 5];

Draw_BeginZoom(cfg.hudScale, 318, 198);
GL_DrawPatchLitAlpha(286, 170, 1, iconAlpha / 2,
GL_DrawPatchLitAlpha(289, 170, 1, iconAlpha / 2,
dpInvItemBox.lump);
GL_DrawPatchLitAlpha(286, 169, 1, iconAlpha,
dpInvItemFlash[hud->currentInvItemFlash % 5].lump);
GL_DrawPatchLitAlpha(292, 170, 1, iconAlpha, dp->lump);
Draw_EndZoom();
}
else
Expand All @@ -1588,9 +1594,9 @@ Draw_EndZoom();

Draw_BeginZoom(cfg.hudScale, 318, 198);

GL_DrawPatchLitAlpha(290, 170, 1, iconAlpha / 2,
GL_DrawPatchLitAlpha(289, 170, 1, iconAlpha / 2,
dpInvItemBox.lump);
GL_DrawPatchLitAlpha(289, 169, 1, iconAlpha, patch);
GL_DrawPatchLitAlpha(287, 169, 1, iconAlpha, patch);
if((count = P_InventoryCount(player, readyItem)) > 1)
Hu_DrawSmallNum(count, ST_INVITEMCWIDTH, 317, 192,
textAlpha);
Expand Down

0 comments on commit 54d120d

Please sign in to comment.