Skip to content

Commit

Permalink
Adding Crispy-Hud for Heretic (#1234)
Browse files Browse the repository at this point in the history
* Updated Crispy Hud

Raw Version of Crispy Hud

* Alignment Keys and Armor in Fullscreen Hud

Alignment Keys and Armor in Fullscreen Hud

* Update Comment

Update Comment

* Expanding Screenblocks to 12

Expanding Screenblocks to 12.

* Removal of unnecessary files.

Removal of unnecessary files.

* Delete .project

* Conservative Crispy Hud

Conservative Crispy Hud with moved jewels between Item and Ammo, height of widgets from the original hud.

* Adjusted Jewels

Adjusted Jewels with original spacing to item

* Update sb_bar.c to fix height of item selector

Update sb_bar.c to fix height of item selector

* Update sb_bar.c

Cleanup comments and use non-transparent patch for item selector background.

* Update sb_bar.c

Move Frags to be visible above health.

* Update sb_bar.c

Moving Hud down by 10px

* Fixing Findings for Pull-Request #1234

Fixing Findings for Pull-Request #1234 Crispy-Hud:
#1234

* Restructuered DrawFullScreenStuff in sb_bar.c

Added "return" in crispy hud condition to keep indentation of original code intact.
  • Loading branch information
Noseey authored Nov 5, 2024
1 parent d247dbc commit 5fe5332
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/heretic/mn_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ static void DrawOptionsMenu(void)

static void DrawOptions2Menu(void)
{
DrawSlider(&Options2Menu, 1, 9, screenblocks - 3);
DrawSlider(&Options2Menu, 1, 9, BETWEEN(3, 11, screenblocks) - 3);
DrawSlider(&Options2Menu, 3, 16, snd_MaxVolume);
DrawSlider(&Options2Menu, 5, 16, snd_MusicVolume);
}
Expand Down Expand Up @@ -1531,7 +1531,7 @@ static boolean SCScreenSize(int option)
{
if (option == RIGHT_DIR)
{
if (screenblocks < 11)
if (screenblocks < 12)
{
screenblocks++;
}
Expand All @@ -1540,7 +1540,7 @@ static boolean SCScreenSize(int option)
{
screenblocks--;
}
R_SetViewSize(screenblocks, detailLevel);
R_SetViewSize(BETWEEN(3, 11, screenblocks), detailLevel);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/heretic/r_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ void R_Init(void)
R_InitTables();
// viewwidth / viewheight / detailLevel are set by the defaults
printf (".");
R_SetViewSize(screenblocks, detailLevel);
R_SetViewSize(BETWEEN(3, 11, screenblocks), detailLevel);
//tprintf("R_InitPlanes\n", 0);
R_InitPlanes();
printf (".");
Expand Down
95 changes: 95 additions & 0 deletions src/heretic/sb_bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,101 @@ void DrawFullScreenStuff(void)
int temp;

UpdateState |= I_FULLSCRN;
// [crispy] Crispy Hud
// TODO Do not always render, only if update needed
if(screenblocks == 12)
{
temp = CPlayer->mo->health;
if (temp > 0)
{
DrINumber(temp, 5 - WIDESCREENDELTA, 180);
}
else
{
DrINumber(0, 5 - WIDESCREENDELTA, 180);
}
// Ammo
temp = CPlayer->ammo[wpnlev1info[CPlayer->readyweapon].ammo];
if (temp && CPlayer->readyweapon > 0 && CPlayer->readyweapon < 7)
{
V_DrawPatch(55 - WIDESCREENDELTA, 182,
W_CacheLumpName(DEH_String(ammopic[CPlayer->readyweapon - 1]),
PU_CACHE));
DrINumber(temp, 53 - WIDESCREENDELTA, 172);
}
// Keys
if (CPlayer->keys[key_yellow])
{
V_DrawPatch(214 + WIDESCREENDELTA, 174, W_CacheLumpName(DEH_String("ykeyicon"), PU_CACHE));
}
if (CPlayer->keys[key_green])
{
V_DrawPatch(214 + WIDESCREENDELTA, 182, W_CacheLumpName(DEH_String("gkeyicon"), PU_CACHE));
}
if (CPlayer->keys[key_blue])
{
V_DrawPatch(214 + WIDESCREENDELTA, 190, W_CacheLumpName(DEH_String("bkeyicon"), PU_CACHE));
}
// Armor
DrINumber(CPlayer->armorpoints, 286 + WIDESCREENDELTA, 180);
if (deathmatch)
{
temp = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i])
{
temp += CPlayer->frags[i];
}
}
DrINumber(temp, 5 - WIDESCREENDELTA, 165);
}
if (!inventory)
{
if (ArtifactFlash)
{
temp = W_GetNumForName(DEH_String("useartia")) + ArtifactFlash - 1;
V_DrawPatch(243 + WIDESCREENDELTA, 171, W_CacheLumpNum(temp, PU_CACHE));
ArtifactFlash--;
}
else if (CPlayer->readyArtifact > 0)
{
patch = DEH_String(patcharti[CPlayer->readyArtifact]);
V_DrawPatch(240 + WIDESCREENDELTA, 170, W_CacheLumpName(patch, PU_CACHE));
DrSmallNumber(CPlayer->inventory[inv_ptr].count, 262 + WIDESCREENDELTA, 192);
}
}
else
{
x = inv_ptr - curpos;
for (i = 0; i < 7; i++)
{
V_DrawPatch(50 + i * 31, 170,
W_CacheLumpName(DEH_String("ARTIBOX"), PU_CACHE));
if (CPlayer->inventorySlotNum > x + i
&& CPlayer->inventory[x + i].type != arti_none)
{
patch = DEH_String(patcharti[CPlayer->inventory[x + i].type]);
V_DrawPatch(50 + i * 31, 170,
W_CacheLumpName(patch, PU_CACHE));
DrSmallNumber(CPlayer->inventory[x + i].count, 69 + i * 31,
192);
}
}
V_DrawPatch(50 + curpos * 31, 199, PatchSELECTBOX);
if (x != 0)
{
V_DrawPatch(38, 169, !(leveltime & 4) ? PatchINVLFGEM1 :
PatchINVLFGEM2);
}
if (CPlayer->inventorySlotNum - x > 7)
{
V_DrawPatch(269, 169, !(leveltime & 4) ?
PatchINVRTGEM1 : PatchINVRTGEM2);
}
}
return;
}
if (CPlayer->mo->health > 0)
{
DrBNumber(CPlayer->mo->health, 5, 180);
Expand Down

0 comments on commit 5fe5332

Please sign in to comment.