- floatified user.oz.

This commit is contained in:
Christoph Oelckers 2022-08-20 22:31:35 +02:00
parent a7d62f944b
commit 620f7c5430
5 changed files with 21 additions and 21 deletions

View file

@ -514,7 +514,7 @@ void KeepActorOnFloor(DSWActor* actor)
// was swimming but have now stopped
actor->user.Flags &= ~(SPR_SWIMMING);
actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
actor->set_int_z(actor->user.oz = actor->user.int_loz());
actor->spr.pos.Z = actor->user.oz = actor->user.loz;
actor->backupz();
return;
}
@ -525,7 +525,7 @@ void KeepActorOnFloor(DSWActor* actor)
}
// are swimming
actor->set_int_z(actor->user.oz = actor->user.int_loz() - Z(depth));
actor->spr.pos.Z = actor->user.oz = actor->user.loz - depth;
actor->backupz();
}
else
@ -534,7 +534,7 @@ void KeepActorOnFloor(DSWActor* actor)
if (actor->user.Rot == actor->user.ActorActionSet->Run || actor->user.Rot == actor->user.ActorActionSet->Swim)
{
NewStateGroup(actor, actor->user.ActorActionSet->Swim);
actor->set_int_z(actor->user.oz = actor->user.int_loz() - Z(depth));
actor->spr.pos.Z = actor->user.oz = actor->user.loz - depth;
actor->backupz();
actor->user.Flags |= (SPR_SWIMMING);
actor->spr.cstat |= (CSTAT_SPRITE_YCENTER);
@ -543,7 +543,7 @@ void KeepActorOnFloor(DSWActor* actor)
{
actor->user.Flags &= ~(SPR_SWIMMING);
actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
actor->set_int_z(actor->user.oz = actor->user.int_loz());
actor->spr.pos.Z = actor->user.oz = actor->user.loz;
actor->backupz();
}
}
@ -558,17 +558,17 @@ void KeepActorOnFloor(DSWActor* actor)
#if 1
if (actor->user.Flags & (SPR_MOVED))
{
actor->set_int_z(actor->user.oz = actor->user.int_loz());
actor->spr.pos.Z = actor->user.oz = actor->user.loz;
actor->backupz();
}
else
{
int ceilz, florz;
double ceilz, florz;
Collision ctrash, ftrash;
FAFgetzrangepoint(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(),
&ceilz, &ctrash, &florz, &ftrash);
actor->set_int_z(actor->user.oz = florz);
actor->spr.pos.Z = actor->user.oz = florz;
actor->backupz();
}
#endif

View file

@ -930,7 +930,7 @@ struct USER
memset(&WallP, 0, sizeof(USER) - myoffsetof(USER, WallP));
}
int int_oz() const { return oz; }
int int_oz() const { return oz * zworldtoint; }
int int_loz() const { return loz * zworldtoint; }
int int_hiz() const { return hiz * zworldtoint; }
@ -964,10 +964,10 @@ struct USER
TObjPtr<DSWActor*> flagOwnerActor;
TObjPtr<DSWActor*> WpnGoalActor;
double oz; // serialized copy of sprite.oz
int Flags;
int Flags2;
int Tics;
int oz; // serialized copy of sprite.oz
int16_t RotNum;
int16_t ID;

View file

@ -6367,7 +6367,7 @@ void MoveSkipSavePos(void)
{
if (!actor->hasU()) continue;
actor->backuppos();
actor->user.oz = actor->opos.Z * zworldtoint;
actor->user.oz = actor->opos.Z;
}
}
}
@ -6384,7 +6384,7 @@ void MoveSkipSavePos(void)
{
if (!actor->hasU()) continue;
actor->backuppos();
actor->user.oz = actor->opos.Z * zworldtoint;
actor->user.oz = actor->opos.Z;
}
}
}

View file

@ -850,7 +850,7 @@ void SpawnUser(DSWActor* actor, short id, STATE* state)
actor->user.motion_blur_dist = 256;
actor->backuppos();
actor->user.oz = actor->opos.Z * zworldtoint;
actor->user.oz = actor->opos.Z;
actor->user.active_range = MIN_ACTIVE_RANGE;
@ -2058,7 +2058,7 @@ void SpriteSetup(void)
// set orig z
actor->opos.Z = sectp->floorz;
actor->user.oz = actor->opos.Z * zworldtoint;
actor->user.oz = actor->opos.Z;
}
else
{
@ -2079,7 +2079,7 @@ void SpriteSetup(void)
// set orig z
actor->opos.Z = sectp->ceilingz;
actor->user.oz = actor->opos.Z * zworldtoint;
actor->user.oz = actor->opos.Z;
}
@ -2261,8 +2261,8 @@ void SpriteSetup(void)
}
// set orig z
actor->user.oz = actor->user.zclip;
actor->opos.Z = actor->user.int_oz() * zinttoworld;
actor->user.oz = actor->user.zclip * zinttoworld;
actor->opos.Z = actor->user.oz;
}
else
{
@ -2280,8 +2280,8 @@ void SpriteSetup(void)
}
// set orig z
actor->user.oz = actor->user.zclip;
actor->opos.Z = actor->user.int_oz() * zinttoworld;
actor->user.oz = actor->user.zclip * zinttoworld;
actor->opos.Z = actor->user.oz;
}
change_actor_stat(actor, STAT_SPIKE);
@ -6328,7 +6328,7 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in
void MissileWarpUpdatePos(DSWActor* actor, sectortype* sect)
{
actor->backuppos();
actor->user.oz = actor->opos.Z * zworldtoint;
actor->user.oz = actor->opos.Z;
ChangeActorSect(actor, sect);
MissileZrange(actor);
}
@ -6336,7 +6336,7 @@ void MissileWarpUpdatePos(DSWActor* actor, sectortype* sect)
void ActorWarpUpdatePos(DSWActor* actor, sectortype* sect)
{
actor->backuppos();
actor->user.oz = actor->opos.Z * zworldtoint;
actor->user.oz = actor->opos.Z;
ChangeActorSect(actor, sect);
DoActorZrange(actor);
}

View file

@ -830,7 +830,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
itActor->user.RotNum = 0;
itActor->backuppos();
itActor->user.oz = itActor->opos.Z * zworldtoint;
itActor->user.oz = itActor->opos.Z;
switch (itActor->spr.statnum)
{