- SW: Replace USER sy with pos.Y calls.

This commit is contained in:
Mitchell Richters 2021-12-30 17:04:27 +11:00
parent fcf18c8c63
commit 0d70d26625
7 changed files with 31 additions and 31 deletions

View file

@ -1057,7 +1057,7 @@ struct USER
int16_t wait_active_check; // for enemy checking of player
int16_t inactive_time; // length of time actor has been unaware of his tgt
vec3_t pos;
int sy,sz;
int sz;
int16_t sang;
uint8_t spal; // save off default palette number

View file

@ -259,10 +259,10 @@ STATE s_BloodSprayDrip[] =
int DoWallBloodDrip(DSWActor* actor)
{
// sy & sz are the ceiling and floor of the sector you are sliding down
if (actor->user.sz != actor->user.sy)
if (actor->user.sz != actor->user.pos.Y)
{
// if you are between the ceiling and floor fall fast
if (actor->spr.pos.Z > actor->user.sy && actor->spr.pos.Z < actor->user.sz)
if (actor->spr.pos.Z > actor->user.pos.Y && actor->spr.pos.Z < actor->user.sz)
{
actor->spr.zvel += 300;
actor->spr.pos.Z += actor->spr.zvel;
@ -454,9 +454,9 @@ int DoBloodSpray(DSWActor* actor)
{
// sy & sz are the ceiling and floor of the sector you are sliding down
if (bldActor->tempwall->twoSided())
getzsofslopeptr(bldActor->tempwall->nextSector(), actor->spr.pos.X, actor->spr.pos.Y, &actor->user.sy, &actor->user.sz);
getzsofslopeptr(bldActor->tempwall->nextSector(), actor->spr.pos.X, actor->spr.pos.Y, &actor->user.pos.Y, &actor->user.sz);
else
actor->user.sy = actor->user.sz; // ceiling and floor are equal - white wall
actor->user.pos.Y = actor->user.sz; // ceiling and floor are equal - white wall
}
actor->spr.cstat &= ~(CSTAT_SPRITE_INVISIBLE);

View file

@ -3206,15 +3206,15 @@ void DoPlayerClimb(PLAYERp pp)
plActor->spr.pos.X = plActor->user.pos.X;
}
if (plActor->spr.pos.Y != plActor->user.sy)
if (plActor->spr.pos.Y != plActor->user.pos.Y)
{
if (plActor->spr.pos.Y < plActor->user.sy)
if (plActor->spr.pos.Y < plActor->user.pos.Y)
plActor->spr.pos.Y += ADJ_AMT;
else if (plActor->spr.pos.Y > plActor->user.sy)
else if (plActor->spr.pos.Y > plActor->user.pos.Y)
plActor->spr.pos.Y -= ADJ_AMT;
if (labs(plActor->spr.pos.Y - plActor->user.sy) <= ADJ_AMT)
plActor->spr.pos.Y = plActor->user.sy;
if (labs(plActor->spr.pos.Y - plActor->user.pos.Y) <= ADJ_AMT)
plActor->spr.pos.Y = plActor->user.pos.Y;
}
}
}
@ -4032,11 +4032,11 @@ void DoPlayerWarpToUnderwater(PLAYERp pp)
// get the offset from the sprite
plActor->user.pos.X = over_act->spr.pos.X - pp->pos.X;
plActor->user.sy = over_act->spr.pos.Y - pp->pos.Y;
plActor->user.pos.Y = over_act->spr.pos.Y - pp->pos.Y;
// update to the new x y position
pp->pos.X = under_act->spr.pos.X - plActor->user.pos.X;
pp->pos.Y = under_act->spr.pos.Y - plActor->user.sy;
pp->pos.Y = under_act->spr.pos.Y - plActor->user.pos.Y;
auto over = over_act->spr.sector();
auto under = under_act->spr.sector();
@ -4102,11 +4102,11 @@ void DoPlayerWarpToSurface(PLAYERp pp)
// get the offset from the under sprite
plActor->user.pos.X = under_act->spr.pos.X - pp->pos.X;
plActor->user.sy = under_act->spr.pos.Y - pp->pos.Y;
plActor->user.pos.Y = under_act->spr.pos.Y - pp->pos.Y;
// update to the new x y position
pp->pos.X = over_act->spr.pos.X - plActor->user.pos.X;
pp->pos.Y = over_act->spr.pos.Y - plActor->user.sy;
pp->pos.Y = over_act->spr.pos.Y - plActor->user.pos.Y;
auto over = over_act->spr.sector();
auto under = under_act->spr.sector();

View file

@ -839,7 +839,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, USER& w, USER* def
("wait_active_check", w.wait_active_check, def->wait_active_check)
("inactive_time", w.inactive_time, def->inactive_time)
("sx", w.pos.X, def->pos.X)
("sy", w.sy, def->sy)
("sy", w.pos.Y, def->pos.Y)
("sz", w.sz, def->sz)
("sang", w.sang, def->sang)
("spal", w.spal, def->spal)

View file

@ -882,7 +882,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECTp sop)
itActor->user.pos.X = sop->xmid - itActor->spr.pos.X;
itActor->user.sy = sop->ymid - itActor->spr.pos.Y;
itActor->user.pos.Y = sop->ymid - itActor->spr.pos.Y;
itActor->user.sz = sop->mid_sector->floorz - itActor->spr.pos.Z;
itActor->user.Flags |= (SPR_SO_ATTACHED);
@ -1702,7 +1702,7 @@ PlayerPart:
}
actor->spr.pos.X = sop->xmid - actor->user.pos.X;
actor->spr.pos.Y = sop->ymid - actor->user.sy;
actor->spr.pos.Y = sop->ymid - actor->user.pos.Y;
// sprites z update
if ((sop->flags & SOBJ_SPRITE_OBJ))
@ -3379,8 +3379,8 @@ bool ActorTrackDecide(TRACK_POINTp tpoint, DSWActor* actor)
bos_z = ActorZOfBottom(actor);
if (bos_z > actor->user.loz)
{
actor->user.sy = (bos_z - actor->spr.pos.Z);
actor->spr.pos.Z -= actor->user.sy;
actor->user.pos.Y = (bos_z - actor->spr.pos.Z);
actor->spr.pos.Z -= actor->user.pos.Y;
}
//
@ -3539,7 +3539,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
ActorLeaveTrack(actor);
actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
actor->spr.pos.Z += actor->user.sy;
actor->spr.pos.Z += actor->user.pos.Y;
DoActorSetSpeed(actor, SLOW_SPEED);
actor->user.ActorActionFunc = NinjaJumpActionFunc;

View file

@ -143,7 +143,7 @@ int DoWallMove(DSWActor* actor)
{
// move the sprite offset from center
actor->user.pos.X -= nx;
actor->user.sy -= ny;
actor->user.pos.Y -= ny;
}
else
{

View file

@ -3704,7 +3704,7 @@ AutoShrap:
shrap_bounce = false;
actor->spr.pos.Z -= Z(4);
shrap_xsize = actor->user.pos.X = 12 + (RANDOM_P2(32<<8)>>8);
shrap_ysize = actor->user.sy = 12 + (RANDOM_P2(32<<8)>>8);
shrap_ysize = actor->user.pos.Y = 12 + (RANDOM_P2(32<<8)>>8);
actor->user.Counter = (RANDOM_P2(2048<<5)>>5);
nx = bcos(actor->spr.ang, -6);
@ -3720,7 +3720,7 @@ AutoShrap:
actor->spr.pos.Z -= Z(4);
//actor->spr.ang = NORM_ANGLE(actor->spr.ang + 1024);
shrap_xsize = actor->user.pos.X = 5 + (RANDOM_P2(4<<8)>>8);
shrap_ysize = actor->user.sy = 5 + (RANDOM_P2(4<<8)>>8);
shrap_ysize = actor->user.pos.Y = 5 + (RANDOM_P2(4<<8)>>8);
break;
}
@ -3774,7 +3774,7 @@ int DoVomit(DSWActor* actor)
{
actor->user.Counter = NORM_ANGLE(actor->user.Counter + (30*MISSILEMOVETICS));
actor->spr.xrepeat = actor->user.pos.X + MulScale(12, bcos(actor->user.Counter), 14);
actor->spr.yrepeat = actor->user.sy + MulScale(12, bsin(actor->user.Counter), 14);
actor->spr.yrepeat = actor->user.pos.Y + MulScale(12, bsin(actor->user.Counter), 14);
if (actor->user.Flags & (SPR_JUMPING))
{
DoJump(actor);
@ -3795,7 +3795,7 @@ int DoVomit(DSWActor* actor)
actor->spr.pos.Z = actor->user.loz;
actor->user.WaitTics = 60;
actor->user.pos.X = actor->spr.xrepeat;
actor->user.sy = actor->spr.yrepeat;
actor->user.pos.Y = actor->spr.yrepeat;
return 0;
}
@ -10209,7 +10209,7 @@ void AddSpriteToSectorObject(DSWActor* actor, SECTOR_OBJECTp sop)
actor->user.Flags |= (SPR_ON_SO_SECTOR|SPR_SO_ATTACHED);
actor->user.pos.X = sop->xmid - actor->spr.pos.X;
actor->user.sy = sop->ymid - actor->spr.pos.Y;
actor->user.pos.Y = sop->ymid - actor->spr.pos.Y;
actor->user.sz = sop->mid_sector->floorz - actor->spr.pos.Z;
actor->user.sang = actor->spr.ang;
@ -10271,7 +10271,7 @@ void SpawnBigGunFlames(DSWActor* actor, DSWActor* Operator, SECTOR_OBJECTp sop,
}
expActor->user.pos.X = actor->user.pos.X;
expActor->user.sy = actor->user.sy;
expActor->user.pos.Y = actor->user.pos.Y;
expActor->user.sz = actor->user.sz;
}
@ -17189,7 +17189,7 @@ DSWActor* SpawnBubble(DSWActor* actor)
actorNew->spr.xrepeat = 8 + (RANDOM_P2(8 << 8) >> 8);
actorNew->spr.yrepeat = actorNew->spr.xrepeat;
actorNew->user.pos.X = actorNew->spr.xrepeat;
actorNew->user.sy = actorNew->spr.yrepeat;
actorNew->user.pos.Y = actorNew->spr.yrepeat;
actorNew->user.ceiling_dist = Z(1);
actorNew->user.floor_dist = Z(1);
actorNew->spr.shade = actor->spr.sector()->floorshade - 10;
@ -17285,16 +17285,16 @@ int DoBubble(DSWActor* actor)
actor->spr.zvel = 768;
actor->user.pos.X += 1;
actor->user.sy += 1;
actor->user.pos.Y += 1;
if (actor->user.pos.X > 32)
{
actor->user.pos.X = 32;
actor->user.sy = 32;
actor->user.pos.Y = 32;
}
actor->spr.xrepeat = actor->user.pos.X + (RANDOM_P2(8 << 8) >> 8) - 4;
actor->spr.yrepeat = actor->user.sy + (RANDOM_P2(8 << 8) >> 8) - 4;
actor->spr.yrepeat = actor->user.pos.Y + (RANDOM_P2(8 << 8) >> 8) - 4;
if (actor->spr.pos.Z < actor->spr.sector()->ceilingz)
{