optimize state usage on watertrails and use new sprites and states
This commit is contained in:
parent
425f539bfa
commit
d1540b6141
3 changed files with 13 additions and 23 deletions
|
|
@ -707,6 +707,7 @@ _(WAYP)
|
|||
_(EGOO)
|
||||
|
||||
_(WTRL) // Water Trail
|
||||
_(WTRU) // Water Trail Underlay
|
||||
|
||||
_(GCHA) // follower: generic chao
|
||||
_(CHEZ) // follower: cheese
|
||||
|
|
|
|||
|
|
@ -4210,20 +4210,6 @@ _(WAYPOINTORB)
|
|||
_(WAYPOINTSPLAT)
|
||||
_(EGOORB)
|
||||
|
||||
_(WATERTRAIL1)
|
||||
_(WATERTRAIL2)
|
||||
_(WATERTRAIL3)
|
||||
_(WATERTRAIL4)
|
||||
_(WATERTRAIL5)
|
||||
_(WATERTRAIL6)
|
||||
_(WATERTRAIL7)
|
||||
_(WATERTRAIL8)
|
||||
_(WATERTRAILUNDERLAY1)
|
||||
_(WATERTRAILUNDERLAY2)
|
||||
_(WATERTRAILUNDERLAY3)
|
||||
_(WATERTRAILUNDERLAY4)
|
||||
_(WATERTRAILUNDERLAY5)
|
||||
_(WATERTRAILUNDERLAY6)
|
||||
_(WATERTRAILUNDERLAY7)
|
||||
_(WATERTRAILUNDERLAY8)
|
||||
_(WATERTRAILS)
|
||||
_(WATERTRAILSUNDERLAY)
|
||||
|
||||
|
|
|
|||
17
src/p_user.c
17
src/p_user.c
|
|
@ -2228,9 +2228,8 @@ void P_MovePlayer(player_t *player)
|
|||
{
|
||||
const angle_t forwardangle = K_MomentumAngle(player->mo);
|
||||
const fixed_t playerVisualRadius = player->mo->radius + (8 * player->mo->scale);
|
||||
const size_t numFrames = S_WATERTRAIL8 - S_WATERTRAIL1;
|
||||
const statenum_t curOverlayFrame = S_WATERTRAIL1 + (leveltime % numFrames);
|
||||
const statenum_t curUnderlayFrame = S_WATERTRAILUNDERLAY1 + (leveltime % numFrames);
|
||||
const SINT8 numFrames = 5;
|
||||
const INT32 curFrame = (leveltime % numFrames)|FF_PAPERSPRITE;
|
||||
fixed_t x1, x2, y1, y2;
|
||||
mobj_t *water;
|
||||
|
||||
|
|
@ -2254,7 +2253,8 @@ void P_MovePlayer(player_t *player)
|
|||
water->momy = player->mo->momy;
|
||||
water->momz = player->mo->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, curUnderlayFrame);
|
||||
P_SetMobjState(water, S_WATERTRAILSUNDERLAY);
|
||||
water->frame = curFrame|FF_ADD|FF_TRANS40;
|
||||
|
||||
// overlay
|
||||
water = P_SpawnMobj(x1, y1,
|
||||
|
|
@ -2265,7 +2265,8 @@ void P_MovePlayer(player_t *player)
|
|||
water->momy = player->mo->momy;
|
||||
water->momz = player->mo->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, curOverlayFrame);
|
||||
P_SetMobjState(water, S_WATERTRAILS);
|
||||
water->frame = curFrame;
|
||||
|
||||
// Right
|
||||
// Underlay
|
||||
|
|
@ -2277,7 +2278,8 @@ void P_MovePlayer(player_t *player)
|
|||
water->momy = player->mo->momy;
|
||||
water->momz = player->mo->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, curUnderlayFrame);
|
||||
P_SetMobjState(water, S_WATERTRAILSUNDERLAY);
|
||||
water->frame = curFrame|FF_ADD|FF_TRANS40;
|
||||
|
||||
// Overlay
|
||||
water = P_SpawnMobj(x2, y2,
|
||||
|
|
@ -2288,7 +2290,8 @@ void P_MovePlayer(player_t *player)
|
|||
water->momy = player->mo->momy;
|
||||
water->momz = player->mo->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, curOverlayFrame);
|
||||
P_SetMobjState(water, S_WATERTRAILS);
|
||||
water->frame = curFrame;
|
||||
|
||||
if (!S_SoundPlaying(player->mo, sfx_s3kdbs))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue