diff --git a/src/heretic/sb_bar.c b/src/heretic/sb_bar.c index 3499eaa21..fef14f34d 100644 --- a/src/heretic/sb_bar.c +++ b/src/heretic/sb_bar.c @@ -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) { @@ -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; @@ -1106,6 +1092,7 @@ void DrawFullScreenStuff(void) } DrINumber(temp, 5 - WIDESCREENDELTA, 165); } + // Items, Itemflash and Selection Bar if (!inventory) { if (ArtifactFlash) @@ -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; } diff --git a/src/hexen/mn_menu.c b/src/hexen/mn_menu.c index e09a0b929..f4c78a646 100644 --- a/src/hexen/mn_menu.c +++ b/src/hexen/mn_menu.c @@ -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); } @@ -1569,7 +1569,7 @@ static void SCScreenSize(int option) { if (option == RIGHT_DIR) { - if (screenblocks < 11) + if (screenblocks < 12) { screenblocks++; } @@ -1578,7 +1578,7 @@ static void SCScreenSize(int option) { screenblocks--; } - R_SetViewSize(screenblocks, detailLevel); + R_SetViewSize(BETWEEN(3, 11, screenblocks), detailLevel); } //--------------------------------------------------------------------------- diff --git a/src/hexen/r_main.c b/src/hexen/r_main.c index 579d70c8f..0b97e7512 100644 --- a/src/hexen/r_main.c +++ b/src/hexen/r_main.c @@ -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(); diff --git a/src/hexen/sb_bar.c b/src/hexen/sb_bar.c index 346238ff2..92a0bf591 100644 --- a/src/hexen/sb_bar.c +++ b/src/hexen/sb_bar.c @@ -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, + 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);