Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Crispy-Hud for Heretic #1234

Merged
merged 16 commits into from
Nov 5, 2024
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)
fabiangreffrath marked this conversation as resolved.
Show resolved Hide resolved
{
DrBNumber(CPlayer->mo->health, 5, 180);
Expand Down
Loading