From 7f51bb300158917c232ae8306d650e2b40baf485 Mon Sep 17 00:00:00 2001 From: spherallic Date: Tue, 27 Feb 2024 14:22:57 +0100 Subject: [PATCH] Fix build errors & fix F_DrawContinueCharacter somehow becoming unused --- src/f_finale.c | 27 ++++++++------------------- src/m_menu.c | 12 ++++++------ 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index a574e1f3b..8f4b7210a 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -3564,7 +3564,7 @@ void F_StartContinue(void) S_StopSounds(); contPlayers[0] = &players[consoleplayer]; - contskins[0] = &skins[players[consoleplayer].skin]; + contskins[0] = skins[players[consoleplayer].skin]; cont_spr2[0][0] = P_GetSkinSprite2(contskins[0], SPR2_CNT1, NULL); cont_spr2[0][2] = contskins[0]->contangle & 7; @@ -3583,7 +3583,7 @@ void F_StartContinue(void) secondplaya = 1; contPlayers[1] = &players[secondplaya]; - contskins[1] = &skins[players[secondplaya].skin]; + contskins[1] = skins[players[secondplaya].skin]; cont_spr2[1][0] = P_GetSkinSprite2(contskins[1], SPR2_CNT4, NULL); cont_spr2[1][2] = (contskins[1]->contangle >> 3) & 7; @@ -3645,7 +3645,7 @@ static void F_DrawContinueCharacter(INT32 dx, INT32 dy, UINT8 n) ( HUD_HOOK(continue), luahuddrawlist_continue[n], contPlayers[n], dx, dy, contskins[n]->highresscale, - (INT32)(contskins[n] - skins), cont_spr2[n][0], cont_spr2[n][1], cont_spr2[n][2] + 1, contColors[n], // add 1 to rotation to convert internal angle numbers (0-7) to WAD editor angle numbers (1-8) + (INT32)(&contskins[n] - skins), cont_spr2[n][0], cont_spr2[n][1], cont_spr2[n][2] + 1, contColors[n], // add 1 to rotation to convert internal angle numbers (0-7) to WAD editor angle numbers (1-8) imcontinuing ? continuetime : timetonext, imcontinuing ); } @@ -3667,8 +3667,6 @@ static void F_DrawContinueCharacter(INT32 dx, INT32 dy, UINT8 n) // void F_ContinueDrawer(void) { - spritedef_t *sprdef; - spriteframe_t *sprframe; patch_t *patch; INT32 i, x = (BASEVIDWIDTH>>1), ncontinues = players[consoleplayer].continues; char numbuf[9] = "CONTNUM*"; @@ -3713,7 +3711,7 @@ void F_ContinueDrawer(void) else if (ncontinues > 10) { if (!(continuetime & 1) || continuetime > 17) - V_DrawContinueIcon(x, 68, 0, (INT32)(contskins[0] - skins), contColors[0]); + V_DrawContinueIcon(x, 68, 0, (INT32)(&contskins[0] - skins), contColors[0]); V_DrawScaledPatch(x+12, 66, 0, stlivex); V_DrawRightAlignedString(x+38, 64, 0, va("%d",(imcontinuing ? ncontinues-1 : ncontinues))); @@ -3727,7 +3725,7 @@ void F_ContinueDrawer(void) { if (i == (ncontinues/2) && ((continuetime & 1) || continuetime > 17)) continue; - V_DrawContinueIcon(x - (i*30), 68, 0, (INT32)(contskins[0] - skins), contColors[0]); + V_DrawContinueIcon(x - (i*30), 68, 0, (INT32)(&contskins[0] - skins), contColors[0]); } x = BASEVIDWIDTH>>1; } @@ -3767,21 +3765,12 @@ void F_ContinueDrawer(void) else if (lift[0] > TICRATE+5) lift[0] = TICRATE+5; -#define drawchar(dx, dy, n) {\ - sprdef = &contskins[n]->sprites[cont_spr2[n][0]];\ - sprframe = &sprdef->spriteframes[cont_spr2[n][1]];\ - patch = W_CachePatchNum(sprframe->lumppat[cont_spr2[n][2]], PU_PATCH_LOWPRIORITY);\ - V_DrawFixedPatch((dx), (dy), contskins[n]->highresscale, (sprframe->flip & (1<= 0) - drawchar((BASEVIDWIDTH<<(FRACBITS-1))-offsx, ((140-lift[0])< (11*TICRATE)) V_DrawFadeScreen(31, timetonext-(11*TICRATE)); diff --git a/src/m_menu.c b/src/m_menu.c index af8ce26c4..d123c7318 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -12214,7 +12214,7 @@ static menucolor_t *M_GridIndexToMenuColor(UINT16 index) } } -static void M_SetPlayerSetupFollowItem() +static void M_SetPlayerSetupFollowItem(void) { const mobjtype_t followitem = skins[setupm_fakeskin]->followitem; @@ -12223,7 +12223,7 @@ static void M_SetPlayerSetupFollowItem() case MT_TAILSOVERLAY: { const state_t *state = &states[S_TAILSOVERLAY_MINUS30DEGREES]; - const UINT8 sprite2 = P_GetSkinSprite2(&skins[setupm_fakeskin], state->frame & FF_FRAMEMASK, NULL); + const UINT8 sprite2 = P_GetSkinSprite2(skins[setupm_fakeskin], state->frame & FF_FRAMEMASK, NULL); if (state->sprite != SPR_PLAY) break; @@ -12663,7 +12663,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice) setupm_fakeskin = numskins-1; } while ((prev_setupm_fakeskin != setupm_fakeskin) && !(R_SkinUsable(-1, setupm_fakeskin))); - multi_spr2 = P_GetSkinSprite2(&skins[setupm_fakeskin], SPR2_WALK, NULL); + multi_spr2 = P_GetSkinSprite2(skins[setupm_fakeskin], SPR2_WALK, NULL); M_SetPlayerSetupFollowItem(); } else if (itemOn == 2) // player color @@ -12704,7 +12704,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice) setupm_fakeskin = 0; } while ((prev_setupm_fakeskin != setupm_fakeskin) && !(R_SkinUsable(-1, setupm_fakeskin))); - multi_spr2 = P_GetSkinSprite2(&skins[setupm_fakeskin], SPR2_WALK, NULL); + multi_spr2 = P_GetSkinSprite2(skins[setupm_fakeskin], SPR2_WALK, NULL); M_SetPlayerSetupFollowItem(); } else if (itemOn == 2) // player color @@ -12855,7 +12855,7 @@ static void M_SetupMultiPlayer(INT32 choice) MP_PlayerSetupMenu[2].status = (IT_KEYHANDLER|IT_STRING); - multi_spr2 = P_GetSkinSprite2(&skins[setupm_fakeskin], SPR2_WALK, NULL); + multi_spr2 = P_GetSkinSprite2(skins[setupm_fakeskin], SPR2_WALK, NULL); M_SetPlayerSetupFollowItem(); // allocate and/or clear Lua player setup draw list @@ -12900,7 +12900,7 @@ static void M_SetupMultiPlayer2(INT32 choice) MP_PlayerSetupMenu[2].status = (IT_KEYHANDLER|IT_STRING); - multi_spr2 = P_GetSkinSprite2(&skins[setupm_fakeskin], SPR2_WALK, NULL); + multi_spr2 = P_GetSkinSprite2(skins[setupm_fakeskin], SPR2_WALK, NULL); M_SetPlayerSetupFollowItem(); // allocate and/or clear Lua player setup draw list