mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-19 15:40:58 +00:00
- SW: Replace PLAYERstruct
slide_xvect
with slide_vect.X
calls.
This commit is contained in:
parent
8c99053ebd
commit
8c1c5f3d55
5 changed files with 19 additions and 19 deletions
|
@ -631,9 +631,9 @@ struct PLAYERstruct
|
|||
vec3_t si; // save player interp position for PlayerSprite
|
||||
int16_t siang;
|
||||
|
||||
vec2_t vect, ovect;
|
||||
vec2_t vect, ovect, slide_vect;
|
||||
int friction;
|
||||
int slide_xvect, slide_yvect;
|
||||
int slide_yvect;
|
||||
int16_t slide_ang;
|
||||
int slide_dec;
|
||||
float drive_avel;
|
||||
|
|
|
@ -1245,7 +1245,7 @@ void DoPlayerResetMovement(PLAYERp pp)
|
|||
{
|
||||
pp->vect.X = pp->ovect.X = 0;
|
||||
pp->vect.Y = pp->ovect.Y = 0;
|
||||
pp->slide_xvect = 0;
|
||||
pp->slide_vect.X = 0;
|
||||
pp->slide_yvect = 0;
|
||||
pp->drive_avel = 0;
|
||||
pp->Flags &= ~(PF_PLAYER_MOVED);
|
||||
|
@ -1885,17 +1885,17 @@ void DoPlayerSlide(PLAYERp pp)
|
|||
|
||||
int push_ret;
|
||||
|
||||
if ((pp->slide_xvect|pp->slide_yvect) == 0)
|
||||
if ((pp->slide_vect.X|pp->slide_yvect) == 0)
|
||||
return;
|
||||
|
||||
if (pp->sop)
|
||||
return;
|
||||
|
||||
pp->slide_xvect = MulScale(pp->slide_xvect, PLAYER_SLIDE_FRICTION, 16);
|
||||
pp->slide_vect.X = MulScale(pp->slide_vect.X, PLAYER_SLIDE_FRICTION, 16);
|
||||
pp->slide_yvect = MulScale(pp->slide_yvect, PLAYER_SLIDE_FRICTION, 16);
|
||||
|
||||
if (labs(pp->slide_xvect) < 12800 && labs(pp->slide_yvect) < 12800)
|
||||
pp->slide_xvect = pp->slide_yvect = 0;
|
||||
if (labs(pp->slide_vect.X) < 12800 && labs(pp->slide_yvect) < 12800)
|
||||
pp->slide_vect.X = pp->slide_yvect = 0;
|
||||
|
||||
push_ret = pushmove(&pp->pos, &pp->cursector, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
|
||||
if (push_ret < 0)
|
||||
|
@ -1911,7 +1911,7 @@ void DoPlayerSlide(PLAYERp pp)
|
|||
return;
|
||||
}
|
||||
Collision coll;
|
||||
clipmove(pp->pos, &pp->cursector, pp->slide_xvect, pp->slide_yvect, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll);
|
||||
clipmove(pp->pos, &pp->cursector, pp->slide_vect.X, pp->slide_yvect, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll);
|
||||
|
||||
PlayerCheckValidMove(pp);
|
||||
push_ret = pushmove(&pp->pos, &pp->cursector, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
|
||||
|
@ -2683,7 +2683,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
|
|||
if (vel > 13000)
|
||||
{
|
||||
VehicleMoveHit(actor);
|
||||
pp->slide_xvect = -pp->vect.X<<1;
|
||||
pp->slide_vect.X = -pp->vect.X<<1;
|
||||
pp->slide_yvect = -pp->vect.Y<<1;
|
||||
if (!(sop->flags & SOBJ_NO_QUAKE))
|
||||
SetPlayerQuake(pp);
|
||||
|
@ -5057,7 +5057,7 @@ void PlayerToRemote(PLAYERp pp)
|
|||
pp->remote.yvect = pp->vect.Y;
|
||||
pp->remote.oxvect = pp->ovect.X;
|
||||
pp->remote.oyvect = pp->ovect.Y;
|
||||
pp->remote.slide_xvect = pp->slide_xvect;
|
||||
pp->remote.slide_xvect = pp->slide_vect.X;
|
||||
pp->remote.slide_yvect = pp->slide_yvect;
|
||||
}
|
||||
|
||||
|
@ -5074,7 +5074,7 @@ void RemoteToPlayer(PLAYERp pp)
|
|||
pp->vect.Y = pp->remote.yvect;
|
||||
pp->ovect.X = pp->remote.oxvect;
|
||||
pp->ovect.Y = pp->remote.oyvect;
|
||||
pp->slide_xvect = pp->remote.slide_xvect;
|
||||
pp->slide_vect.X = pp->remote.slide_xvect;
|
||||
pp->slide_yvect = pp->remote.slide_yvect;
|
||||
}
|
||||
|
||||
|
@ -5088,7 +5088,7 @@ void PlayerRemoteReset(PLAYERp pp, sectortype* sect)
|
|||
pp->pos.Y = rsp->spr.pos.Y;
|
||||
pp->pos.Z = sect->floorz - PLAYER_HEIGHT;
|
||||
|
||||
pp->vect.X = pp->vect.Y = pp->ovect.X = pp->ovect.Y = pp->slide_xvect = pp->slide_yvect = 0;
|
||||
pp->vect.X = pp->vect.Y = pp->ovect.X = pp->ovect.Y = pp->slide_vect.X = pp->slide_yvect = 0;
|
||||
|
||||
UpdatePlayerSprite(pp);
|
||||
}
|
||||
|
@ -5511,7 +5511,7 @@ void DoPlayerBeginDie(PLAYERp pp)
|
|||
pp->input.actions &= ~SB_CENTERVIEW;
|
||||
|
||||
pp->friction = PLAYER_RUN_FRICTION;
|
||||
pp->slide_xvect = pp->slide_yvect = 0;
|
||||
pp->slide_vect.X = pp->slide_yvect = 0;
|
||||
pp->floor_dist = PLAYER_WADE_FLOOR_DIST;
|
||||
pp->ceiling_dist = PLAYER_WADE_CEILING_DIST;
|
||||
ASSERT(pp->DeathType < SIZ(PlayerDeathFunc));
|
||||
|
@ -7091,7 +7091,7 @@ DEFINE_FIELD_X(SWPlayer, PLAYERstruct, siang)
|
|||
//DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oxvect)
|
||||
//DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oyvect)
|
||||
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, friction)
|
||||
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, slide_xvect)
|
||||
//DEFINE_FIELD_X(SWPlayer, PLAYERstruct, slide_xvect)
|
||||
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, slide_yvect)
|
||||
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, slide_ang)
|
||||
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, slide_dec)
|
||||
|
|
|
@ -468,7 +468,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYERstruct& w, P
|
|||
("xvect", w.vect.X)
|
||||
("yvect", w.vect.Y)
|
||||
("friction", w.friction)
|
||||
("slide_xvect", w.slide_xvect)
|
||||
("slide_xvect", w.slide_vect.X)
|
||||
("slide_yvect", w.slide_yvect)
|
||||
("slide_ang", w.slide_ang)
|
||||
("slide_dec", w.slide_dec)
|
||||
|
|
|
@ -5241,14 +5241,14 @@ int PlayerDamageSlide(PLAYERp pp, int damage, short ang)
|
|||
else if (damage <= 10)
|
||||
{
|
||||
//nudge
|
||||
pp->slide_xvect = MOVEx(16, ang)<<15;
|
||||
pp->slide_vect.X = MOVEx(16, ang)<<15;
|
||||
pp->slide_yvect = MOVEy(16, ang)<<15;
|
||||
return true;
|
||||
}
|
||||
else if (damage <= 20)
|
||||
{
|
||||
//bigger nudge
|
||||
pp->slide_xvect = MOVEx(64, ang)<<15;
|
||||
pp->slide_vect.X = MOVEx(64, ang)<<15;
|
||||
pp->slide_yvect = MOVEy(64, ang)<<15;
|
||||
return true;
|
||||
}
|
||||
|
@ -5256,7 +5256,7 @@ int PlayerDamageSlide(PLAYERp pp, int damage, short ang)
|
|||
{
|
||||
slide_vel = (damage * 6);
|
||||
|
||||
pp->slide_xvect = MOVEx(slide_vel, ang)<<15;
|
||||
pp->slide_vect.X = MOVEx(slide_vel, ang)<<15;
|
||||
pp->slide_yvect = MOVEy(slide_vel, ang)<<15;
|
||||
|
||||
return true;
|
||||
|
|
|
@ -197,7 +197,7 @@ struct SWPlayer native
|
|||
native int16 siang;
|
||||
|
||||
native int friction;
|
||||
native int slide_xvect, slide_yvect;
|
||||
native int slide_yvect;
|
||||
native int16 slide_ang;
|
||||
native int slide_dec;
|
||||
native float drive_avel;
|
||||
|
|
Loading…
Reference in a new issue