From 228668ce986e2f44fec2e085c9ee7e174ed3f3d3 Mon Sep 17 00:00:00 2001 From: SMS Alfredo <65426124+SMS-Alfredo@users.noreply.github.com> Date: Mon, 19 Apr 2021 14:25:34 -0500 Subject: [PATCH] Change the render flags to extra flags and improve SF_NOSUPERSPRITES --- src/deh_tables.c | 5 ++--- src/p_mobj.c | 12 +++++++----- src/p_mobj.h | 29 +++++++++++++++++------------ src/r_defs.h | 4 ---- 4 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/deh_tables.c b/src/deh_tables.c index f3a77d528..621c6aae4 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -4351,6 +4351,8 @@ const char *const MOBJEFLAG_LIST[] = { "SPRUNG", // Mobj was already sprung this tic "APPLYPMOMZ", // Platform movement "TRACERANGLE", // Compute and trigger on mobj angle relative to tracer + "FORCESUPER", // Forces an object to use super sprites with SPR_PLAY. + "FORCENOSUPER", // Forces an object to NOT use super sprites with SPR_PLAY. NULL }; @@ -4905,9 +4907,6 @@ struct int_const_s const INT_CONST[] = { {"RF_SHADOWDRAW",RF_SHADOWDRAW}, {"RF_SHADOWEFFECTS",RF_SHADOWEFFECTS}, {"RF_DROPSHADOW",RF_DROPSHADOW}, - {"RF_FORCESUPER",RF_FORCESUPER}, - {"RF_FORCENOSUPER",RF_FORCENOSUPER}, - {"RF_REVERSESUPER",RF_REVERSESUPER}, // Level flags {"LF_SCRIPTISFILE",LF_SCRIPTISFILE}, diff --git a/src/p_mobj.c b/src/p_mobj.c index 3f77f28aa..4e9015e8a 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -397,15 +397,17 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) UINT16 stateframe = st->frame; // Add/Remove FF_SPR2SUPER based on certain conditions - if (player->powers[pw_super] && !(player->charflags & SF_NOSUPERSPRITES)) + if (player->charflags & SF_NOSUPERSPRITES) + stateframe = stateframe & ~FF_SPR2SUPER; + else if (player->powers[pw_super]) stateframe = stateframe | FF_SPR2SUPER; if (stateframe & FF_SPR2SUPER) { - if (mobj->renderflags & RF_FORCENOSUPER) + if (mobj->eflags & MFE_FORCENOSUPER) stateframe = stateframe & ~FF_SPR2SUPER; } - else if (mobj->renderflags & RF_FORCESUPER) + else if (mobj->eflags & MFE_FORCESUPER) stateframe = stateframe | FF_SPR2SUPER; // Get the sprite2 and frame number @@ -543,10 +545,10 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state) // Add/Remove FF_SPR2SUPER based on certain conditions if (stateframe & FF_SPR2SUPER) { - if (mobj->renderflags & RF_FORCENOSUPER) + if (mobj->eflags & MFE_FORCENOSUPER) stateframe = stateframe & ~FF_SPR2SUPER; } - else if (mobj->renderflags & RF_FORCESUPER) + else if (mobj->eflags & MFE_FORCESUPER) stateframe = stateframe | FF_SPR2SUPER; // Get the sprite2 and frame number diff --git a/src/p_mobj.h b/src/p_mobj.h index 5bb7c908e..c4567c27d 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -218,33 +218,38 @@ typedef enum typedef enum { // The mobj stands on solid floor (not on another mobj or in air) - MFE_ONGROUND = 1, + MFE_ONGROUND = 1, // The mobj just hit the floor while falling, this is cleared on next frame // (instant damage in lava/slime sectors to prevent jump cheat..) - MFE_JUSTHITFLOOR = 1<<1, + MFE_JUSTHITFLOOR = 1<<1, // The mobj stands in a sector with water, and touches the surface // this bit is set once and for all at the start of mobjthinker - MFE_TOUCHWATER = 1<<2, + MFE_TOUCHWATER = 1<<2, // The mobj stands in a sector with water, and his waist is BELOW the water surface // (for player, allows swimming up/down) - MFE_UNDERWATER = 1<<3, + MFE_UNDERWATER = 1<<3, // used for ramp sectors - MFE_JUSTSTEPPEDDOWN = 1<<4, + MFE_JUSTSTEPPEDDOWN = 1<<4, // Vertically flip sprite/allow upside-down physics - MFE_VERTICALFLIP = 1<<5, + MFE_VERTICALFLIP = 1<<5, // Goo water - MFE_GOOWATER = 1<<6, + MFE_GOOWATER = 1<<6, // The mobj is touching a lava block - MFE_TOUCHLAVA = 1<<7, + MFE_TOUCHLAVA = 1<<7, // Mobj was already pushed this tic - MFE_PUSHED = 1<<8, + MFE_PUSHED = 1<<8, // Mobj was already sprung this tic - MFE_SPRUNG = 1<<9, + MFE_SPRUNG = 1<<9, // Platform movement - MFE_APPLYPMOMZ = 1<<10, + MFE_APPLYPMOMZ = 1<<10, // Compute and trigger on mobj angle relative to tracer // See Linedef Exec 457 (Track mobj angle to point) - MFE_TRACERANGLE = 1<<11, + MFE_TRACERANGLE = 1<<11, + // Forces an object to use super sprites with SPR_PLAY. + MFE_FORCESUPER = 1<<12, + // Forces an object to NOT use super sprites with SPR_PLAY. + MFE_FORCENOSUPER = 1<<13, + // free: to and including 1<<15 } mobjeflag_t; diff --git a/src/r_defs.h b/src/r_defs.h index 31f30dd6f..9c649fbc4 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -738,10 +738,6 @@ typedef enum RF_SHADOWDRAW = 0x10000, // Stretches and skews the sprite like a shadow. RF_SHADOWEFFECTS = 0x20000, // Scales and becomes transparent like a shadow. RF_DROPSHADOW = (RF_SHADOWDRAW | RF_SHADOWEFFECTS | RF_FULLDARK), - - RF_FORCESUPER = 0x40000, // Forces an object to use super sprites with SPR_PLAY. - RF_FORCENOSUPER = 0x80000, // Forces an object to NOT use super sprites with SPR_PLAY. - RF_REVERSESUPER = (RF_FORCESUPER | RF_FORCENOSUPER), //Use normal sprites in place of super sprites and vice-versa } renderflags_t; typedef enum