- use float coords for spawning some SW actors.

This commit is contained in:
Christoph Oelckers 2022-08-17 00:37:51 +02:00
parent 0c8ed75d54
commit 086c699df0
4 changed files with 11 additions and 19 deletions

View file

@ -1329,7 +1329,7 @@ Collision move_scan(DSWActor* actor, int ang, int dist, int *stopx, int *stopy,
uint32_t cliptype = CLIPMASK_ACTOR;
int sang;
int x, y, z, loz, hiz;
int loz, hiz;
DSWActor* highActor;
DSWActor* lowActor;
sectortype* lo_sectp,* hi_sectp, *ssp;
@ -1338,9 +1338,7 @@ Collision move_scan(DSWActor* actor, int ang, int dist, int *stopx, int *stopy,
// moves out a bit but keeps the sprites original postion/sector.
// save off position info
x = actor->int_pos().X;
y = actor->int_pos().Y;
z = actor->int_pos().Z;
auto pos = actor->spr.pos;
sang = actor->int_ang();
loz = actor->user.loz;
hiz = actor->user.hiz;
@ -1366,7 +1364,7 @@ Collision move_scan(DSWActor* actor, int ang, int dist, int *stopx, int *stopy,
*stopz = actor->int_pos().Z;
// reset position information
actor->set_int_pos({ x, y, z });
actor->spr.pos = pos;
actor->set_int_ang(sang);
actor->user.loz = loz;
actor->user.hiz = hiz;

View file

@ -509,7 +509,7 @@ DSWActor* CopySprite(sprt const* tsp, sectortype* newsector)
auto actorNew = insertActor(newsector, STAT_FAF_COPY);
actorNew->set_int_pos(tsp->int_pos());
actorNew->spr.pos = tsp->pos;
actorNew->spr.cstat = tsp->cstat;
actorNew->spr.picnum = tsp->picnum;
actorNew->spr.pal = tsp->pal;

View file

@ -148,7 +148,7 @@ void SpawnVis(DSWActor* parentActor, sectortype* sect, int x, int y, int z, int
ASSERT(parentActor->hasU());
parentActor->user.Flags2 |= (SPR2_CHILDREN);
actorNew->set_int_pos(parentActor->int_pos());
actorNew->spr.pos = parentActor->spr.pos;
parentActor->user.Flags2 |= (SPR2_VIS_SHADING);
}

View file

@ -4469,7 +4469,7 @@ int DoFireballFlames(DSWActor* actor)
DSWActor* attach = actor->user.attachActor;
if (attach != nullptr)
{
actor->set_int_pos({ attach->int_pos().X, attach->int_pos().Y, int_ActorZOfMiddle(attach) });
actor->spr.pos = DVector3(attach->spr.pos.XY(), ActorZOfMiddle(attach));
if ((attach->spr.extra & SPRX_BURNABLE))
{
@ -11137,7 +11137,7 @@ int DoRing(DSWActor* actor)
else
z = int_ActorZOfMiddle(own) + Z(30);
actor->set_int_pos({ own->int_pos().X, own->int_pos().Y, z });
actor->spr.pos = DVector3(own->spr.pos.XY(), z * zinttoworld);
// go out until its time to come back in
if (actor->user.Counter2 == false)
@ -11271,7 +11271,7 @@ int DoSerpRing(DSWActor* actor)
z = own->int_pos().Z - actor->user.pos.Z;
// move the center with the player
actor->set_int_pos({ own->int_pos().X, own->int_pos().Y, z });
actor->spr.pos = DVector3(own->spr.pos.XY(), z * zinttoworld);
// go out until its time to come back in
@ -15112,9 +15112,7 @@ bool HitscanSpriteAdjust(DSWActor* actor, walltype* hit_wall)
auto sect = actor->sector();
Collision coll;
auto pos = actor->int_pos();
clipmove(pos, &sect, xvect, yvect, 4, 4 << 8, 4 << 8, CLIPMASK_MISSILE, coll);
actor->set_int_pos(pos);
clipmove(actor->spr.pos, &sect, xvect, yvect, 4, 4 << 8, 4 << 8, CLIPMASK_MISSILE, coll);
if (actor->sector() != sect)
ChangeActorSect(actor, sect);
@ -17433,9 +17431,7 @@ void QueueHole(sectortype* hit_sect, walltype* hit_wall, int hit_x, int hit_y, i
auto sect = spawnedActor->sector();
Collision coll;
auto pos = spawnedActor->int_pos();
clipmove(pos, &sect, nx, ny, 0, 0, 0, CLIPMASK_MISSILE, coll, 1);
spawnedActor->set_int_pos(pos);
clipmove(spawnedActor->spr.pos, &sect, nx, ny, 0, 0, 0, CLIPMASK_MISSILE, coll, 1);
if (spawnedActor->sector() != sect)
ChangeActorSect(spawnedActor, sect);
@ -17746,9 +17742,7 @@ DSWActor* QueueWallBlood(DSWActor* actor, short ang)
auto sect = spawnedActor->sector();
Collision coll;
auto pos = spawnedActor->int_pos();
clipmove(pos, &sect, nx, ny, 0, 0, 0, CLIPMASK_MISSILE, coll, 1);
spawnedActor->set_int_pos(pos);
clipmove(spawnedActor->spr.pos, &sect, nx, ny, 0, 0, 0, CLIPMASK_MISSILE, coll, 1);
if (spawnedActor->sector() != sect)
ChangeActorSect(spawnedActor, sect);