From 509df21f251870d9b83805063a17138c4a83b694 Mon Sep 17 00:00:00 2001 From: katsy <205-katsy@users.noreply.git.do.srb2.org> Date: Tue, 14 May 2024 02:07:11 +0000 Subject: [PATCH] Fix backwards compat for SPR2 Super (resolves #1225) --- src/info.c | 12 ++++++------ src/p_pspr.h | 2 +- src/r_skins.c | 7 +++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/info.c b/src/info.c index 9b33a57ab..d66c24af8 100644 --- a/src/info.c +++ b/src/info.c @@ -761,12 +761,12 @@ state_t states[NUMSTATES] = {SPR_PLAY, SPR2_MLEL, 35, {NULL}, 0, 0, S_PLAY_WALK, 0}, // S_PLAY_MELEE_LANDING // SF_SUPER - {SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_ANIMATE, 7, {NULL}, 0, 4, S_PLAY_SUPER_TRANS2, 0}, // S_PLAY_SUPER_TRANS1 - {SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER, 3, {NULL}, 0, 0, S_PLAY_SUPER_TRANS3, 0}, // S_PLAY_SUPER_TRANS2 - {SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_PLAY_SUPER_TRANS4, 0}, // S_PLAY_SUPER_TRANS3 - {SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_PLAY_SUPER_TRANS5, 0}, // S_PLAY_SUPER_TRANS4 - {SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_PLAY_SUPER_TRANS6, 0}, // S_PLAY_SUPER_TRANS5 - {SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_FULLBRIGHT, 19, {A_FadeOverlay}, 0, 0, S_PLAY_FALL, 0}, // S_PLAY_SUPER_TRANS6 + {SPR_PLAY, SPR2_TRNS|SPR2F_SUPER|FF_ANIMATE, 7, {NULL}, 0, 4, S_PLAY_SUPER_TRANS2, 0}, // S_PLAY_SUPER_TRANS1 + {SPR_PLAY, SPR2_TRNS|SPR2F_SUPER, 3, {NULL}, 0, 0, S_PLAY_SUPER_TRANS3, 0}, // S_PLAY_SUPER_TRANS2 + {SPR_PLAY, SPR2_TRNS|SPR2F_SUPER|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_PLAY_SUPER_TRANS4, 0}, // S_PLAY_SUPER_TRANS3 + {SPR_PLAY, SPR2_TRNS|SPR2F_SUPER|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_PLAY_SUPER_TRANS5, 0}, // S_PLAY_SUPER_TRANS4 + {SPR_PLAY, SPR2_TRNS|SPR2F_SUPER|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_PLAY_SUPER_TRANS6, 0}, // S_PLAY_SUPER_TRANS5 + {SPR_PLAY, SPR2_TRNS|SPR2F_SUPER|FF_FULLBRIGHT, 19, {A_FadeOverlay}, 0, 0, S_PLAY_FALL, 0}, // S_PLAY_SUPER_TRANS6 {SPR_NULL, 0, -1, {NULL}, 0, 0, S_OBJPLACE_DUMMY, 0}, //S_OBJPLACE_DUMMY diff --git a/src/p_pspr.h b/src/p_pspr.h index 5fb676763..6510190f1 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -39,7 +39,7 @@ #define FF_FRAMEMASK 0xff /// \brief Frame flags - SPR2: Super sprite2 -#define FF_SPR2SUPER 0x80 +#define FF_SPR2SUPER SPR2F_SUPER //TODO: 2.3: remove this backwards compat hack /// \brief Frame flags - SPR2: A change of state at the end of Sprite2 animation #define FF_SPR2ENDSTATE 0x100 /// \brief Frame flags - SPR2: 50% of starting in middle of Sprite2 animation diff --git a/src/r_skins.c b/src/r_skins.c index d0d2eed62..cd7d60b53 100644 --- a/src/r_skins.c +++ b/src/r_skins.c @@ -43,10 +43,9 @@ UINT16 P_GetStateSprite2(state_t *state) else { // Transform the state frame into an animation ID - UINT32 stateframe = state->frame & FF_FRAMEMASK; - UINT16 spr2 = stateframe & ~FF_SPR2SUPER; + UINT16 spr2 = state->frame & FF_FRAMEMASK; - if (stateframe & FF_SPR2SUPER) + if (state->frame & SPR2F_SUPER) spr2 |= SPR2F_SUPER; return spr2; @@ -70,7 +69,7 @@ boolean P_IsStateSprite2Super(state_t *state) if (state->sprite2 & SPR2F_SUPER) return true; } - else if (state->frame & FF_SPR2SUPER) + else if (state->frame & SPR2F_SUPER) return true; return false;