mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-22 12:31:32 +00:00
Change the render flags to extra flags and improve SF_NOSUPERSPRITES
This commit is contained in:
parent
3f086ff612
commit
228668ce98
4 changed files with 26 additions and 24 deletions
|
@ -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},
|
||||
|
|
12
src/p_mobj.c
12
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
|
||||
|
|
29
src/p_mobj.h
29
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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue