Skip to content

Commit

Permalink
- Blood: use texture IDs in drawElements.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed May 30, 2023
1 parent 117874b commit 0b158db
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
20 changes: 10 additions & 10 deletions source/games/blood/src/hudsprites.cpp
Expand Up @@ -62,14 +62,14 @@ static const struct {
//
//---------------------------------------------------------------------------

static void drawElement(int x, int y, int tile, double scale = 1, int flipx = 0, int flipy = 0, int pin = 0, int basepal = 0, double alpha = 1)
static void drawElement(int x, int y, FTextureID tile, double scale = 1, int flipx = 0, int flipy = 0, int pin = 0, int basepal = 0, double alpha = 1)
{
int flags = RS_TOPLEFT;
if (flipx) flags |= RS_XFLIPHUD;
if (flipy) flags |= RS_YFLIPHUD;
if (pin == -1) flags |= RS_ALIGN_L;
else if (pin == 1) flags |= RS_ALIGN_R;
hud_drawsprite(x, y, FloatToFixed(scale), 0, tile, 0, basepal, flags, alpha);
hud_drawsprite(x, y, scale, 0, tile, 0, basepal, flags, alpha);
}


Expand Down Expand Up @@ -152,20 +152,20 @@ void hudDraw(PLAYER* pPlayer, sectortype* pSector, double bobx, double boby, dou
}
if (packItemActive(pPlayer, 1))
{
drawElement(0, 0, 2344, 1, 0, 0, -1);
drawElement(320, 0, 2344, 1, 1, 0, 1);
drawElement(0, 200, 2344, 1, 0, 1, -1);
drawElement(320, 200, 2344, 1, 1, 1, 1);
drawElement(0, 0, aTexIds[kTexDIVEHUD], 1, 0, 0, -1);
drawElement(320, 0, aTexIds[kTexDIVEHUD], 1, 1, 0, 1);
drawElement(0, 200, aTexIds[kTexDIVEHUD], 1, 0, 1, -1);
drawElement(320, 200, aTexIds[kTexDIVEHUD], 1, 1, 1, 1);
if (gDetail >= 4)
{
drawElement(15, 3, 2346, 1, 0, 0, -1, 0, 0.2);
drawElement(212, 77, 2347, 1, 0, 0, 1, 0, 0.2);
drawElement(15, 3, aTexIds[kTexDIVEDETAIL1], 1, 0, 0, -1, 0, 0.2);
drawElement(212, 77, aTexIds[kTexDIVEDETAIL2], 1, 0, 0, 1, 0, 0.2);
}
}
if (powerupCheck(pPlayer, kPwUpAsbestArmor) > 0)
{
drawElement(0, 237, 2358, 1, 0, 1, -1);
drawElement(320, 237, 2358, 1, 1, 1, 1);
drawElement(0, 237, aTexIds[kTexASBESTHUD], 1, 0, 1, -1);
drawElement(320, 237, aTexIds[kTexASBESTHUD], 1, 1, 1, 1);
}

int zn = int(((pPlayer->zWeapon - pPlayer->zView - 12) * 2.) + 220);
Expand Down
4 changes: 4 additions & 0 deletions source/games/blood/src/namelist.h
Expand Up @@ -227,3 +227,7 @@ x(ROCKDEBRIS4, 2155)
x(ROCKDEBRIS5, 2620)
x(ROCKDEBRIS6, 3135)
x(Firetex, 2342)
x(DIVEHUD, 2344)
x(DIVEDETAIL1, 2346)
x(DIVEDETAIL2, 2347)
x(ASBESTHUD, 2358)
4 changes: 4 additions & 0 deletions source/games/blood/src/texidsdef.h
Expand Up @@ -42,3 +42,7 @@ x(ROCKDEBRIS6)
x(Titlescreen)
x(BACKTILE)
x(FIRETEX)
x(DIVEHUD)
x(DIVEDETAIL1)
x(DIVEDETAIL2)
x(ASBESTHUD)

0 comments on commit 0b158db

Please sign in to comment.