From 06e7eb35671b349b497904afa065158af00aaec0 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 4 Jan 2023 17:23:18 +0000 Subject: [PATCH] Add a funny little rotating question mark ala SA1 character select --- src/info.c | 2 ++ src/info.h | 2 ++ src/k_menudraw.c | 24 +++++++++++++++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 8e3757190..7cee3d58b 100644 --- a/src/info.c +++ b/src/info.c @@ -789,6 +789,8 @@ char sprnames[NUMSPRITES + 1][5] = "UFOA", "UFOS", + "UQMK", + // First person view sprites; this is a sprite so that it can be replaced by a specialized MD2 draw later "VIEW", }; diff --git a/src/info.h b/src/info.h index d0d5228e3..9cc7a3911 100644 --- a/src/info.h +++ b/src/info.h @@ -1340,6 +1340,8 @@ typedef enum sprite SPR_UFOA, SPR_UFOS, + SPR_UQMK, + // First person view sprites; this is a sprite so that it can be replaced by a specialized MD2 draw later SPR_VIEW, diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 3a2a5d078..af7c141a2 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -4633,9 +4633,31 @@ static void M_DrawChallengePreview(INT32 x, INT32 y) // Okay, this is what we want to draw. ref = &unlockables[challengesmenu.currentunlock]; + // Funny question mark? if (!gamedata->unlocked[challengesmenu.currentunlock]) { - // todo draw some sort of question mark? + spritedef_t *sprdef = &sprites[SPR_UQMK]; + spriteframe_t *sprframe; + patch_t *patch; + UINT32 useframe; + UINT32 addflags = 0; + + if (!sprdef->numframes) + { + return; + } + + useframe = (challengesmenu.ticker / 2) % sprdef->numframes; + + sprframe = &sprdef->spriteframes[useframe]; + patch = W_CachePatchNum(sprframe->lumppat[0], PU_CACHE); + + if (sprframe->flip & 1) // Only for first sprite + { + addflags ^= V_FLIP; // This sprite is left/right flipped! + } + + V_DrawFixedPatch(x*FRACUNIT, (y+6)*FRACUNIT, FRACUNIT, addflags, patch, NULL); return; }