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 Hexen and align Heretic Crispy-Hud #1236

Merged
merged 27 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
73a472d
Updated Crispy Hud
Noseey Oct 26, 2024
e127a8f
Alignment Keys and Armor in Fullscreen Hud
Noseey Oct 26, 2024
8d6057f
Update Comment
Noseey Oct 26, 2024
542d3a7
Expanding Screenblocks to 12
Noseey Oct 26, 2024
52d2fa7
Removal of unnecessary files.
Noseey Oct 26, 2024
afb88d5
Delete .project
Noseey Oct 26, 2024
3ffe506
Conservative Crispy Hud
Noseey Oct 30, 2024
84bac45
Adjusted Jewels
Noseey Nov 1, 2024
89f1d63
Update sb_bar.c to fix height of item selector
Noseey Nov 1, 2024
98ddb00
Update sb_bar.c
Noseey Nov 1, 2024
4aa0a22
Update sb_bar.c
Noseey Nov 2, 2024
24e104c
Update sb_bar.c
Noseey Nov 2, 2024
b03225b
Merge branch 'fabiangreffrath:master' into master
Noseey Nov 2, 2024
3003fc4
Fixing Findings for Pull-Request #1234
Noseey Nov 3, 2024
ce0d95e
Merge branch 'master' of https://github.com/Noseey/crispy-doom
Noseey Nov 3, 2024
a2e7aa2
Restructuered DrawFullScreenStuff in sb_bar.c
Noseey Nov 4, 2024
4224dbf
Merge branch 'fabiangreffrath:master' into master
Noseey Nov 5, 2024
85a5b66
Adding rough Hexen crispy HUD
Noseey Nov 5, 2024
235524b
Merge branch 'master' of https://github.com/Noseey/crispy-doom
Noseey Nov 5, 2024
b4f7780
Refine Hexen Crispy Hud
Noseey Nov 6, 2024
a04eb6e
Shifting down Hexen Crispy Hud
Noseey Nov 6, 2024
02b4363
Refinement Hexen Crispy Hud
Noseey Nov 6, 2024
f89cc16
Cirspy Hexen Hud - Inventory Bar Refinement
Noseey Nov 7, 2024
d0fd202
Intersect check for Hexen Crispy Hud
Noseey Nov 7, 2024
ccbc3c2
Fix Hexen Crispy-Hud Item-Alignment
Noseey Nov 18, 2024
2b32c36
Align Heretic Crispy-HUD Bar with Hexen
Noseey Nov 18, 2024
087b2d2
Fixing PatchSELECTBOX Pos for Hexen Crispy-Hud
Noseey Nov 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 42 additions & 28 deletions src/heretic/sb_bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,13 @@ void DrawFullScreenStuff(void)
// TODO Do not always render, only if update needed
if(screenblocks == 12)
{
int xPosGem2;
int xPosKeys;

xPosGem2 = 270;
xPosKeys = 214 + WIDESCREENDELTA;

// Health
temp = CPlayer->mo->health;
if (temp > 0)
{
Expand All @@ -1070,30 +1077,9 @@ void DrawFullScreenStuff(void)
{
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);
// Frags
if (deathmatch)
{
temp = 0;
Expand All @@ -1106,6 +1092,7 @@ void DrawFullScreenStuff(void)
}
DrINumber(temp, 5 - WIDESCREENDELTA, 165);
}
// Items, Itemflash and Selection Bar
if (!inventory)
{
if (ArtifactFlash)
Expand All @@ -1126,29 +1113,56 @@ void DrawFullScreenStuff(void)
x = inv_ptr - curpos;
for (i = 0; i < 7; i++)
{
V_DrawPatch(50 + i * 31, 170,
V_DrawPatch(50 + i * 31, 168,
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,
V_DrawPatch(50 + i * 31, 168,
W_CacheLumpName(patch, PU_CACHE));
DrSmallNumber(CPlayer->inventory[x + i].count, 69 + i * 31,
192);
190);
}
}
V_DrawPatch(50 + curpos * 31, 199, PatchSELECTBOX);
V_DrawPatch(50 + curpos * 31, 197, PatchSELECTBOX);
if (x != 0)
{
V_DrawPatch(38, 169, !(leveltime & 4) ? PatchINVLFGEM1 :
V_DrawPatch(38, 167, !(leveltime & 4) ? PatchINVLFGEM1 :
PatchINVLFGEM2);
}
if (CPlayer->inventorySlotNum - x > 7)
{
V_DrawPatch(269, 169, !(leveltime & 4) ?
V_DrawPatch(xPosGem2, 167, !(leveltime & 4) ?
PatchINVRTGEM1 : PatchINVRTGEM2);
}
// Check for Intersect
if (xPosGem2 + 10 >= xPosKeys)
{
return; // Stop drawing further widgets
}
}
// 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(xPosKeys, 174, W_CacheLumpName(DEH_String("ykeyicon"), PU_CACHE));
}
if (CPlayer->keys[key_green])
{
V_DrawPatch(xPosKeys, 182, W_CacheLumpName(DEH_String("gkeyicon"), PU_CACHE));
}
if (CPlayer->keys[key_blue])
{
V_DrawPatch(xPosKeys, 190, W_CacheLumpName(DEH_String("bkeyicon"), PU_CACHE));
}
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/hexen/mn_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,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 @@ -1569,7 +1569,7 @@ static void SCScreenSize(int option)
{
if (option == RIGHT_DIR)
{
if (screenblocks < 11)
if (screenblocks < 12)
{
screenblocks++;
}
Expand All @@ -1578,7 +1578,7 @@ static void SCScreenSize(int option)
{
screenblocks--;
}
R_SetViewSize(screenblocks, detailLevel);
R_SetViewSize(BETWEEN(3, 11, screenblocks), detailLevel);
}

//---------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/hexen/r_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ void R_Init(void)
R_InitPointToAngle();
R_InitTables();
// viewwidth / viewheight / detailLevel are set by the defaults
R_SetViewSize(screenblocks, detailLevel);
R_SetViewSize(BETWEEN(3, 11, screenblocks), detailLevel);
R_InitPlanes();
R_InitLightTables();
R_InitSkyMap();
Expand Down
223 changes: 223 additions & 0 deletions src/hexen/sb_bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1479,6 +1479,229 @@ void DrawFullScreenStuff(void)
int temp;

UpdateState |= I_FULLSCRN;
// [crispy] Crispy Hud
// TODO Do not always render, only if update needed
if(screenblocks == 12)
{
int j, k;
int xPosGem1;
int xPosManaPatch2;
patch_t *manaPatch1, *manaPatch2;
patch_t *manaVialPatch1, *manaVialPatch2;

manaPatch1 = NULL;
manaPatch2 = NULL;
manaVialPatch1 = NULL;
manaVialPatch2 = NULL;
xPosGem1 = 40;
xPosManaPatch2 = 75 - WIDESCREENDELTA;

// Health
temp = CPlayer->mo->health;
if (temp >= 25)
{
DrINumber(temp, 5 - WIDESCREENDELTA, 182);
}
else
{
DrRedINumber(temp, 5 - WIDESCREENDELTA, 182);
}
// Armor
temp = AutoArmorSave[CPlayer->class]
+ CPlayer->armorpoints[ARMOR_ARMOR] +
CPlayer->armorpoints[ARMOR_SHIELD] +
CPlayer->armorpoints[ARMOR_HELMET] +
CPlayer->armorpoints[ARMOR_AMULET];
oldarmor = temp;
DrINumber(FixedDiv(temp, 5 * FRACUNIT) >> FRACBITS, 288 + WIDESCREENDELTA, 182);
// Frags
if (deathmatch)
{
temp = 0;
for (i = 0; i < maxplayers; i++)
{
if (playeringame[i])
{
temp += CPlayer->frags[i];
}
}
DrINumber(temp, 5 - WIDESCREENDELTA, 165);
}
// Items, Itemflash and Selection Bar
if (!inventory)
{
if (ArtifactFlash)
{
V_DrawPatch(113 - WIDESCREENDELTA, 170, W_CacheLumpNum(W_GetNumForName("useartia")
+ ArtifactFlash - 1, PU_CACHE));
ArtifactFlash--;
}
else if (CPlayer->readyArtifact > 0)
{
V_DrawPatch(108 - WIDESCREENDELTA, 169,
W_CacheLumpName(patcharti[CPlayer->readyArtifact],
PU_CACHE));
if (CPlayer->inventory[inv_ptr].count > 1)
{
DrSmallNumber(CPlayer->inventory[inv_ptr].count, 127 - WIDESCREENDELTA, 190);
}
}
}
else
{
x = inv_ptr - curpos;
for (i = 0; i < 7; i++)
{
V_DrawPatch(50 + i * 31, 168, W_CacheLumpName("ARTIBOX",
PU_CACHE));
if (CPlayer->inventorySlotNum > x + i
&& CPlayer->inventory[x + i].type != arti_none)
{
V_DrawPatch(48 + i * 31, 167,
fabiangreffrath marked this conversation as resolved.
Show resolved Hide resolved
W_CacheLumpName(patcharti
[CPlayer->inventory[x + i].type],
PU_CACHE));
if (CPlayer->inventory[x + i].count > 1)
{
DrSmallNumber(CPlayer->inventory[x + i].count,
66 + i * 31, 189);
}
}
}
V_DrawPatch(48 + curpos * 31, 167, PatchSELECTBOX);
if (x != 0)
{
V_DrawPatch(xPosGem1, 167, !(leveltime & 4) ? PatchINVLFGEM1 :
PatchINVLFGEM2);
}
if (CPlayer->inventorySlotNum - x > 7)
{
V_DrawPatch(268, 167, !(leveltime & 4) ?
PatchINVRTGEM1 : PatchINVRTGEM2);
}
// Check for Intersect
if (xPosManaPatch2 + 15 >= xPosGem1)
{
return; // Stop drawing further widgets
}
}
// Mana
temp = CPlayer->mana[0];
DrSmallNumber(temp, 44 - WIDESCREENDELTA, 187);
manaVialPatch1 = (patch_t *) 1; // force a vial update
if (temp == 0)
{ // Draw Dim Mana icon
manaPatch1 = PatchMANADIM1;
}
else if (oldmana1 == 0)
{
manaPatch1 = PatchMANABRIGHT1;
}
temp = CPlayer->mana[1];
DrSmallNumber(temp, 76 - WIDESCREENDELTA, 187);
manaVialPatch1 = (patch_t *) 1; // force a vial update
if (temp == 0)
{ // Draw Dim Mana icon
manaPatch2 = PatchMANADIM2;
}
else if (oldmana2 == 0)
{
manaPatch2 = PatchMANABRIGHT2;
}
// Update mana graphics based upon mana count/weapon type
if (CPlayer->readyweapon == WP_FIRST)
{
manaPatch1 = PatchMANADIM1;
manaPatch2 = PatchMANADIM2;
manaVialPatch1 = PatchMANAVIALDIM1;
manaVialPatch2 = PatchMANAVIALDIM2;
}
else if (CPlayer->readyweapon == WP_SECOND)
{
if (!manaPatch1)
{
manaPatch1 = PatchMANABRIGHT1;
}
manaVialPatch1 = PatchMANAVIAL1;
manaPatch2 = PatchMANADIM2;
manaVialPatch2 = PatchMANAVIALDIM2;
}
else if (CPlayer->readyweapon == WP_THIRD)
{
manaPatch1 = PatchMANADIM1;
manaVialPatch1 = PatchMANAVIALDIM1;
if (!manaPatch2)
{
manaPatch2 = PatchMANABRIGHT2;
}
manaVialPatch2 = PatchMANAVIAL2;
}
else
{
manaVialPatch1 = PatchMANAVIAL1;
manaVialPatch2 = PatchMANAVIAL2;
if (!manaPatch1)
{
manaPatch1 = PatchMANABRIGHT1;
}
if (!manaPatch2)
{
manaPatch2 = PatchMANABRIGHT2;
}
}
V_DrawPatch(42 - WIDESCREENDELTA, 170, manaPatch1);
V_DrawPatch(xPosManaPatch2, 170, manaPatch2);
V_DrawPatch(59 - WIDESCREENDELTA, 170, manaVialPatch1);
for (i = 171; i < 193 - (22 * CPlayer->mana[0]) / MAX_MANA; i++)
{
for (j = 0; j <= crispy->hires; j++)
for (k = 0; k <= crispy->hires; k++)
{
I_VideoBuffer[SCREENWIDTH * ((i << crispy->hires) + j)
+ (60 << crispy->hires) + k] = 0;
I_VideoBuffer[SCREENWIDTH * ((i << crispy->hires) + j)
+ (61 << crispy->hires) + k] = 0;
I_VideoBuffer[SCREENWIDTH * ((i << crispy->hires) + j)
+ (62 << crispy->hires) + k] = 0;
}
}
V_DrawPatch(67 - WIDESCREENDELTA, 170, manaVialPatch2);
for (i = 171; i < 193 - (22 * CPlayer->mana[1]) / MAX_MANA; i++)
{
for (j = 0; j <= crispy->hires; j++)
for (k = 0; k <= crispy->hires; k++)
{
I_VideoBuffer[SCREENWIDTH * ((i << crispy->hires) + j)
+ (68 << crispy->hires) + k] = 0;
I_VideoBuffer[SCREENWIDTH * ((i << crispy->hires) + j)
+ (69 << crispy->hires) + k] = 0;
I_VideoBuffer[SCREENWIDTH * ((i << crispy->hires) + j)
+ (70 << crispy->hires) + k] = 0;
}
}
// Weapon Pieces
if (CPlayer->pieces == 7)
{
V_DrawPatch(228 + WIDESCREENDELTA, 168, PatchWEAPONFULL);
}
else
{
V_DrawPatch(228 + WIDESCREENDELTA, 168, PatchWEAPONSLOT);
if (CPlayer->pieces & WPIECE1)
{
V_DrawPatch(PieceX[PlayerClass[consoleplayer]][0] + 38 + WIDESCREENDELTA, 168, PatchPIECE1);
}
if (CPlayer->pieces & WPIECE2)
{
V_DrawPatch(PieceX[PlayerClass[consoleplayer]][1] + 38 + WIDESCREENDELTA, 168, PatchPIECE2);
}
if (CPlayer->pieces & WPIECE3)
{
V_DrawPatch(PieceX[PlayerClass[consoleplayer]][2] + 38 + WIDESCREENDELTA, 168, PatchPIECE3);
}
}
return;
}
if (CPlayer->mo->health > 0)
{
DrBNumber(CPlayer->mo->health, 5, 180);
Expand Down
Loading