- SW: second batch of spr.pos wraps.

This commit is contained in:
Christoph Oelckers 2022-02-01 19:41:58 +01:00
parent 871f0c4ec6
commit 8ca4d85069
5 changed files with 20 additions and 35 deletions

View file

@ -1174,9 +1174,7 @@ void RipperHatch(DSWActor* actor)
{
auto actorNew = insertActor(actor->sector(), STAT_DEFAULT);
ClearOwner(actorNew);
actorNew->spr.pos.X = actor->spr.pos.X;
actorNew->spr.pos.Y = actor->spr.pos.Y;
actorNew->spr.pos.Z = actor->spr.pos.Z;
actorNew->set_int_pos(actor->int_pos());
actorNew->spr.xrepeat = actorNew->spr.yrepeat = 64;
actorNew->spr.ang = rip_ang[i];
actorNew->spr.pal = 0;

View file

@ -835,16 +835,9 @@ void SectorExp(DSWActor* actor, sectortype* sectp, short orig_ang, int zh)
actor->spr.cstat &= ~(CSTAT_SPRITE_ALIGNMENT_WALL|CSTAT_SPRITE_ALIGNMENT_FLOOR);
SectorMidPoint(sectp, &x, &y, &z);
actor->spr.ang = orig_ang;
actor->spr.pos.X = x;
actor->spr.pos.Y = y;
actor->spr.pos.Z = z;
// randomize the explosions
actor->spr.ang += RANDOM_P2(256) - 128;
actor->spr.pos.X += RANDOM_P2(1024) - 512;
actor->spr.pos.Y += RANDOM_P2(1024) - 512;
actor->spr.pos.Z = zh;
actor->spr.ang = orig_ang + RANDOM_P2(256) - 128;
actor->set_int_pos({ x + RANDOM_P2(256) - 128, y + RANDOM_P2(1024) - 512, zh });
// setup vars needed by SectorExp
ChangeActorSect(actor, sectp);

View file

@ -536,25 +536,26 @@ int DoSkelTeleport(DSWActor* actor)
{
int x,y;
x = actor->spr.pos.X;
y = actor->spr.pos.Y;
auto pos = actor->int_pos();
x = pos.X;
y = pos.Y;
while (true)
{
actor->spr.pos.X = x;
actor->spr.pos.Y = y;
pos.X = x;
pos.Y = y;
if (RANDOM_P2(1024) < 512)
actor->spr.pos.X += 512 + RANDOM_P2(1024);
pos.X += 512 + RANDOM_P2(1024);
else
actor->spr.pos.X -= 512 + RANDOM_P2(1024);
pos.X -= 512 + RANDOM_P2(1024);
if (RANDOM_P2(1024) < 512)
actor->spr.pos.Y += 512 + RANDOM_P2(1024);
pos.Y += 512 + RANDOM_P2(1024);
else
actor->spr.pos.Y -= 512 + RANDOM_P2(1024);
pos.Y -= 512 + RANDOM_P2(1024);
SetActorZ(actor, &actor->spr.pos);
SetActorZ(actor, &pos);
if (actor->insector())
break;

View file

@ -303,9 +303,7 @@ DSWActor* TrackClonePoint(DSWActor* actor)
actorNew->spr.cstat = 0;
actorNew->spr.extra = 0;
actorNew->spr.pos.X = actor->spr.pos.X;
actorNew->spr.pos.Y = actor->spr.pos.Y;
actorNew->spr.pos.Z = actor->spr.pos.Z;
actorNew->set_int_pos(actor->spr.pos);
actorNew->spr.ang = actor->spr.ang;
actorNew->spr.lotag = actor->spr.lotag;
actorNew->spr.hitag = actor->spr.hitag;
@ -1602,8 +1600,7 @@ void MovePoints(SECTOR_OBJECT* sop, short delta_ang, int nx, int ny)
PlayerMove = false;
// move child sprite along also
sop->sp_child->spr.pos.X = sop->pmid.X;
sop->sp_child->spr.pos.Y = sop->pmid.Y;
sop->sp_child->set_int_xy(sop->pmid.X, sop->pmid.Y);
// setting floorz if need be
@ -1703,8 +1700,7 @@ PlayerPart:
}
}
actor->spr.pos.X = sop->pmid.X - actor->user.pos.X;
actor->spr.pos.Y = sop->pmid.Y - actor->user.pos.Y;
actor->set_int_xy(sop->pmid.X - actor->user.pos.X, sop->pmid.Y - actor->user.pos.Y);
// sprites z update
if ((sop->flags & SOBJ_SPRITE_OBJ))
@ -3323,8 +3319,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
nx = MOVEx(100, lActor->spr.ang);
ny = MOVEy(100, lActor->spr.ang);
actor->spr.pos.X = lActor->spr.pos.X + nx;
actor->spr.pos.Y = lActor->spr.pos.Y + ny;
actor->set_int_xy(lActor->spr.pos.X + nx, lActor->spr.pos.Y + ny);
actor->spr.ang = NORM_ANGLE(lActor->spr.ang + 1024);

View file

@ -159,9 +159,7 @@ void SpawnVis(DSWActor* parentActor, sectortype* sect, int x, int y, int z, int
actorNew = insertActor(sect, STAT_VIS_ON);
actorNew->spr.pos.X = x;
actorNew->spr.pos.Y = y;
actorNew->spr.pos.Z = z - Z(20);
actorNew->set_int_pos({ x, y, z - Z(20) });
}
actorNew->spr.cstat = 0;