mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-26 04:30:55 +00:00
The intial
This commit is contained in:
parent
1db163f942
commit
3f086ff612
3 changed files with 43 additions and 5 deletions
|
@ -4905,6 +4905,9 @@ 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},
|
||||
|
|
41
src/p_mobj.c
41
src/p_mobj.c
|
@ -325,9 +325,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
|
|||
mobj->tics = st->tics;
|
||||
|
||||
// Adjust the player's animation speed to match their velocity.
|
||||
if (state == S_PLAY_STND && player->powers[pw_super] && skins[player->skin].sprites[SPR2_WAIT|FF_SPR2SUPER].numframes == 0) // if no super wait, don't wait at all
|
||||
mobj->tics = -1;
|
||||
else if (player->panim == PA_EDGE && (player->charflags & SF_FASTEDGE))
|
||||
if (player->panim == PA_EDGE && (player->charflags & SF_FASTEDGE))
|
||||
mobj->tics = 2;
|
||||
else if (!(disableSpeedAdjust || player->charflags & SF_NOSPEEDADJUST))
|
||||
{
|
||||
|
@ -396,8 +394,26 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
|
|||
|
||||
if (skin)
|
||||
{
|
||||
spr2 = P_GetSkinSprite2(skin, (((player->powers[pw_super] && !(player->charflags & SF_NOSUPERSPRITES)) ? FF_SPR2SUPER : 0)|st->frame) & FF_FRAMEMASK, mobj->player);
|
||||
UINT16 stateframe = st->frame;
|
||||
|
||||
// Add/Remove FF_SPR2SUPER based on certain conditions
|
||||
if (player->powers[pw_super] && !(player->charflags & SF_NOSUPERSPRITES))
|
||||
stateframe = stateframe | FF_SPR2SUPER;
|
||||
|
||||
if (stateframe & FF_SPR2SUPER)
|
||||
{
|
||||
if (mobj->renderflags & RF_FORCENOSUPER)
|
||||
stateframe = stateframe & ~FF_SPR2SUPER;
|
||||
}
|
||||
else if (mobj->renderflags & RF_FORCESUPER)
|
||||
stateframe = stateframe | FF_SPR2SUPER;
|
||||
|
||||
// Get the sprite2 and frame number
|
||||
spr2 = P_GetSkinSprite2(skin, (stateframe & FF_FRAMEMASK), mobj->player);
|
||||
numframes = skin->sprites[spr2].numframes;
|
||||
|
||||
if (state == S_PLAY_STND && (spr2 & FF_SPR2SUPER) && skin->sprites[SPR2_WAIT|FF_SPR2SUPER].numframes == 0)
|
||||
mobj->tics = -1; // If no super wait, don't wait at all
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -522,8 +538,23 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state)
|
|||
|
||||
if (skin)
|
||||
{
|
||||
spr2 = P_GetSkinSprite2(skin, st->frame & FF_FRAMEMASK, mobj->player);
|
||||
UINT16 stateframe = st->frame;
|
||||
|
||||
// Add/Remove FF_SPR2SUPER based on certain conditions
|
||||
if (stateframe & FF_SPR2SUPER)
|
||||
{
|
||||
if (mobj->renderflags & RF_FORCENOSUPER)
|
||||
stateframe = stateframe & ~FF_SPR2SUPER;
|
||||
}
|
||||
else if (mobj->renderflags & RF_FORCESUPER)
|
||||
stateframe = stateframe | FF_SPR2SUPER;
|
||||
|
||||
// Get the sprite2 and frame number
|
||||
spr2 = P_GetSkinSprite2(skin, (stateframe & FF_FRAMEMASK), NULL);
|
||||
numframes = skin->sprites[spr2].numframes;
|
||||
|
||||
if (state == S_PLAY_STND && (spr2 & FF_SPR2SUPER) && skin->sprites[SPR2_WAIT|FF_SPR2SUPER].numframes == 0)
|
||||
mobj->tics = -1; // If no super wait, don't wait at all
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -738,6 +738,10 @@ 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