- int_hiz/int_loz replacements.

This commit is contained in:
Christoph Oelckers 2022-08-20 22:49:30 +02:00
parent 425f4055b4
commit 467ab9f7ee
8 changed files with 53 additions and 53 deletions

View file

@ -304,7 +304,7 @@ void DoDebrisCurrent(DSWActor* actor)
move_sprite(actor, nx, ny, 0, actor->user.ceiling_dist, actor->user.floor_dist, 0, ACTORMOVETICS);
}
actor->set_int_z(actor->user.int_loz());
actor->spr.pos.Z = actor->user.loz;
}
int DoActorSectorDamage(DSWActor* actor)
@ -349,7 +349,7 @@ int DoActorSectorDamage(DSWActor* actor)
}
// note that most squishing is done in vator.c
if (actor->user.lo_sectp && actor->user.hi_sectp && labs(actor->user.int_loz() - actor->user.int_hiz()) < (ActorSizeZ(actor) >> 1))
if (actor->user.lo_sectp && actor->user.hi_sectp && abs(actor->user.int_loz() - actor->user.int_hiz()) < (ActorSizeZ(actor) >> 1))
{
actor->user.Health = 0;
if (SpawnShrap(actor, nullptr, WPN_NM_SECTOR_SQUISH))
@ -434,7 +434,7 @@ int DoActorDebris(DSWActor* actor)
}
else
{
actor->set_int_z(actor->user.int_loz());
actor->spr.pos.Z = actor->user.loz;
}
return 0;
@ -718,7 +718,7 @@ int DoActorFall(DSWActor* actor)
actor->add_int_z(actor->user.jump_speed * ACTORMOVETICS);
// Stick like glue when you hit the ground
if (actor->int_pos().Z > actor->user.int_loz())
if (actor->spr.pos.Z > actor->user.loz)
{
DoActorStopFall(actor);
}
@ -728,7 +728,7 @@ int DoActorFall(DSWActor* actor)
int DoActorStopFall(DSWActor* actor)
{
actor->set_int_z(actor->user.int_loz());
actor->spr.pos.Z = actor->user.loz;
actor->user.Flags &= ~(SPR_FALLING | SPR_JUMPING);
actor->spr.cstat &= ~(CSTAT_SPRITE_YFLIP);

View file

@ -693,7 +693,7 @@ int InitCoolgCircle(DSWActor* actor)
// z velocity
actor->user.jump_speed = 400 + RANDOM_P2(256);
if (labs(actor->user.pos.Z - actor->user.int_hiz()) < abs(actor->user.pos.Z - actor->user.int_loz()))
if (abs(actor->user.pos.Z - actor->user.int_hiz()) < abs(actor->user.pos.Z - actor->user.int_loz()))
actor->user.jump_speed = -actor->user.jump_speed;
actor->user.WaitTics = (RandomRange(3)+1) * 120;
@ -773,7 +773,7 @@ int DoCoolgDeath(DSWActor* actor)
DoFindGroundPoint(actor);
// on the ground
if (actor->int_pos().Z >= actor->user.int_loz())
if (actor->spr.pos.Z >= actor->user.loz)
{
actor->user.Flags &= ~(SPR_FALLING|SPR_SLIDING);
actor->spr.cstat &= ~(CSTAT_SPRITE_YFLIP); // If upside down, reset it

View file

@ -534,7 +534,7 @@ int DoEelDeath(DSWActor* actor)
DoFindGroundPoint(actor);
// on the ground
if (actor->int_pos().Z >= actor->user.int_loz())
if (actor->spr.pos.Z >= actor->user.loz)
{
actor->user.Flags &= ~(SPR_FALLING|SPR_SLIDING);
if (RandomRange(1000) > 500)

View file

@ -513,7 +513,7 @@ int DoHornetDeath(DSWActor* actor)
actor->user.coll = move_sprite(actor, nx, ny, 0L, actor->user.ceiling_dist, actor->user.floor_dist, 1, ACTORMOVETICS);
// on the ground
if (actor->int_pos().Z >= actor->user.int_loz())
if (actor->spr.pos.Z >= actor->user.loz)
{
actor->user.Flags &= ~(SPR_FALLING|SPR_SLIDING);
actor->spr.cstat &= ~(CSTAT_SPRITE_YFLIP); // If upside down, reset it

View file

@ -279,9 +279,9 @@ int DoWallBloodDrip(DSWActor* actor)
actor->add_int_z(actor->spr.zvel);
}
if (actor->int_pos().Z >= actor->user.int_loz())
if (actor->spr.pos.Z >= actor->user.loz)
{
actor->set_int_z(actor->user.int_loz());
actor->spr.pos.Z = actor->user.loz;
SpawnFloorSplash(actor);
KillActor(actor);
return 0;
@ -468,7 +468,7 @@ int DoBloodSpray(DSWActor* actor)
case kHitSector:
{
// hit floor
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing
@ -643,7 +643,7 @@ int DoPhosphorus(DSWActor* actor)
else
{
// hit a sector
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
// hit a floor
if (!(actor->user.Flags & SPR_BOUNCE))
@ -672,7 +672,7 @@ int DoPhosphorus(DSWActor* actor)
else
{
// hit floor
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing
@ -849,7 +849,7 @@ int DoChemBomb(DSWActor* actor)
else
{
// hit a sector
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
// hit a floor
if (!(actor->user.Flags & SPR_BOUNCE))
@ -888,7 +888,7 @@ int DoChemBomb(DSWActor* actor)
else
{
// hit floor
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing
@ -1064,7 +1064,7 @@ int DoCaltrops(DSWActor* actor)
else
{
// hit a sector
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
// hit a floor
if (!(actor->user.Flags & SPR_BOUNCE))
@ -1094,7 +1094,7 @@ int DoCaltrops(DSWActor* actor)
else
{
// hit floor
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing

View file

@ -234,7 +234,7 @@ int SetupSkull(DSWActor* actor)
if (ActorZOfBottom(actor) > actor->user.int_loz() - Z(16))
{
actor->set_int_z(actor->user.int_loz() + Z(tileTopOffset(actor->spr.picnum)));
actor->spr.pos.Z = actor->user.loz + tileTopOffset(actor->spr.picnum);
actor->user.loz = actor->spr.pos.Z;
// leave 8 pixels above the ground
@ -373,9 +373,9 @@ int DoSkullJump(DSWActor* actor)
return 0;
}
if ((actor->int_pos().Z > actor->user.int_loz() - Z(36)))
if (actor->spr.pos.Z > actor->user.loz - 36)
{
actor->set_int_z(actor->user.int_loz() - Z(36));
actor->spr.pos.Z = actor->user.loz - 36;
UpdateSinglePlayKills(actor);
DoSkullBeginDeath(actor);
return 0;
@ -439,7 +439,7 @@ int DoSkullWait(DSWActor* actor)
}
// below the floor type
if (actor->int_pos().Z > actor->user.int_loz())
if (actor->spr.pos.Z > actor->user.loz)
{
// look for closest player every once in a while
if (dist < 3500)
@ -619,7 +619,7 @@ int SetupBetty(DSWActor* actor)
if (ActorZOfBottom(actor) > actor->user.int_loz() - Z(16))
{
actor->set_int_z(actor->user.int_loz() + Z(tileTopOffset(actor->spr.picnum)));
actor->spr.pos.Z = actor->user.loz + tileTopOffset(actor->spr.picnum);
actor->user.loz = actor->spr.pos.Z;
// leave 8 pixels above the ground
@ -751,9 +751,9 @@ int DoBettyJump(DSWActor* actor)
return 0;
}
if ((actor->int_pos().Z > actor->user.int_loz() - Z(36)))
if (actor->spr.pos.Z > actor->user.loz - 36)
{
actor->set_int_z(actor->user.int_loz() - Z(36));
actor->spr.pos.Z = actor->user.loz - 36;
UpdateSinglePlayKills(actor);
DoBettyBeginDeath(actor);
return 0;
@ -811,7 +811,7 @@ int DoBettyWait(DSWActor* actor)
}
// below the floor type
if (actor->int_pos().Z > actor->user.int_loz())
if (actor->spr.pos.Z > actor->user.loz)
{
// look for closest player every once in a while
if (dist < 3500)

View file

@ -4483,7 +4483,7 @@ void DoActorZrange(DSWActor* actor)
}
}
// !AIC - puts getzrange results into USER varaible actor->user.int_loz(). actor->user.hiz, actor->user.lo_sectp, actor->user.hi_sectp, etc.
// !AIC - puts getzrange results into USER varaible actor->user.loz. actor->user.hiz, actor->user.lo_sectp, actor->user.hi_sectp, etc.
// The loz and hiz are used a lot.
int DoActorGlobZ(DSWActor* actor)
@ -4637,7 +4637,7 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
{
// cancel move
actor->spr.pos = apos;
//actor->spr.z = actor->user.int_loz(); // place on ground in case you are in the air
//actor->spr.pos.Z = actor->user.loz; // place on ground in case you are in the air
actor->user.loz = loz;
actor->user.hiz = hiz;
actor->user.lowActor = lowActor;
@ -4653,7 +4653,7 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
{
// cancel move
actor->spr.pos = apos;
//actor->spr.z = actor->user.int_loz(); // place on ground in case you are in the air
//actor->spr.pos.Z = actor->user.loz; // place on ground in case you are in the air
actor->user.loz = loz;
actor->user.hiz = hiz;
actor->user.lowActor = lowActor;
@ -6271,7 +6271,7 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in
actor->spr.cstat = tempstat;
// !AIC - puts getzrange results into USER varaible actor->user.int_loz(). actor->user.hiz, actor->user.lo_sectp, actor->user.hi_sectp, etc.
// !AIC - puts getzrange results into USER varaible actor->user.loz. actor->user.hiz, actor->user.lo_sectp, actor->user.hi_sectp, etc.
// Takes info from global variables
DoActorGlobZ(actor);
@ -6613,9 +6613,9 @@ Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int cei
actor->user.hi_sectp = actor->user.lo_sectp = actor->sector();
actor->user.highActor = nullptr; actor->user.lowActor = nullptr;
actor->set_int_z(actor->user.int_loz() - Z(8));
actor->spr.pos.Z = actor->user.loz - 8;
if (labs(actor->user.int_hiz() - actor->user.int_loz()) < Z(12))
if (abs(actor->user.hiz - actor->user.loz) < 12)
{
// we've gone into a very small place - kill it
retval.setVoid();

View file

@ -3813,7 +3813,7 @@ int DoVomit(DSWActor* actor)
ChangeState(actor, s_VomitSplash);
DoFindGroundPoint(actor);
MissileWaterAdjust(actor);
actor->set_int_z(actor->user.int_loz());
actor->spr.pos.Z = actor->user.loz;
actor->user.WaitTics = 60;
actor->user.pos.X = actor->spr.xrepeat;
actor->user.pos.Y = actor->spr.yrepeat;
@ -4263,7 +4263,7 @@ bool WeaponMoveHit(DSWActor* actor)
ASSERT(sectp->extra != -1);
// hit floor - closer to floor than ceiling
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
// hit a floor sprite
if (actor->user.lowActor)
@ -7398,7 +7398,7 @@ int DoStar(DSWActor* actor)
DoActorZrange(actor);
MissileWaterAdjust(actor);
if (actor->int_pos().Z > actor->user.int_loz())
if (actor->spr.pos.Z > actor->user.loz)
{
KillActor(actor);
return true;
@ -7481,7 +7481,7 @@ int DoStar(DSWActor* actor)
bool did_hit_wall;
auto hit_sect = actor->user.coll.hitSector;
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
if (hit_sect->hasU() && FixedToInt(hit_sect->depth_fixed) > 0)
{
@ -7511,7 +7511,7 @@ int DoStar(DSWActor* actor)
actor->user.change.X = MulScale(actor->user.change.X, 64000 + (RandomRange(64000) - 32000), 16);
actor->user.change.Y = MulScale(actor->user.change.Y, 64000 + (RandomRange(64000) - 32000), 16);
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
actor->user.change.Z = MulScale(actor->user.change.Z, 50000, 16); // floor
else
actor->user.change.Z = MulScale(actor->user.change.Z, 40000, 16); // ceiling
@ -7553,7 +7553,7 @@ int DoStar(DSWActor* actor)
// 32000 to 96000
actor->user.change.X = MulScale(actor->user.change.X, 64000 + (RandomRange(64000) - 32000), 16);
actor->user.change.Y = MulScale(actor->user.change.Y, 64000 + (RandomRange(64000) - 32000), 16);
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
actor->user.change.Z = MulScale(actor->user.change.Z, 50000, 16); // floor
else
actor->user.change.Z = MulScale(actor->user.change.Z, 40000, 16); // ceiling
@ -8303,7 +8303,7 @@ int DoGrenade(DSWActor* actor)
else
{
// hit a sector
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
// hit a floor
if (!(actor->user.Flags & SPR_BOUNCE))
@ -8339,7 +8339,7 @@ int DoGrenade(DSWActor* actor)
else
{
// hit floor
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing underwater
@ -8502,7 +8502,7 @@ int DoVulcanBoulder(DSWActor* actor)
else
{
// hit a sloped sector
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
// hit a floor
actor->user.change.X = MulScale(actor->user.change.X, 30000, 16);
@ -8527,7 +8527,7 @@ int DoVulcanBoulder(DSWActor* actor)
else
{
// hit unsloped floor
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
actor->user.coll.setNone();
actor->user.Counter = 0;
@ -8855,7 +8855,7 @@ int DoMine(DSWActor* actor)
else if ((hitActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR))
{
// hit floor
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
actor->user.Flags2 |= (SPR2_ATTACH_FLOOR);
else
actor->user.Flags2 |= (SPR2_ATTACH_CEILING);
@ -8907,7 +8907,7 @@ int DoMine(DSWActor* actor)
SetMineStuck(actor);
// hit floor
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
actor->user.Flags2 |= (SPR2_ATTACH_FLOOR);
else
actor->user.Flags2 |= (SPR2_ATTACH_CEILING);
@ -10809,7 +10809,7 @@ int DoNapalm(DSWActor* actor)
DoFindGroundPoint(expActor);
MissileWaterAdjust(expActor);
expActor->set_int_z(expActor->user.int_loz());
expActor->spr.pos.Z = expActor->user.loz;
expActor->backupz();
if (actor->user.Flags & (SPR_UNDERWATER))
@ -16989,7 +16989,7 @@ int SpawnSplash(DSWActor* actor)
DoActorZrange(actor);
MissileWaterAdjust(actor);
auto actorNew = SpawnActor(STAT_MISSILE, SPLASH, s_Splash, actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.int_loz(), actor->int_ang(), 0);
auto actorNew = SpawnActor(STAT_MISSILE, SPLASH, s_Splash, actor->sector(), DVector3(actor->spr.pos.XY(), actor->user.loz), actor->spr.angle, 0);
if (sectu && (sectp->extra & SECTFX_LIQUID_MASK) == SECTFX_LIQUID_LAVA)
actorNew->user.spal = actorNew->spr.pal = PALETTE_RED_LIGHTING;
@ -17043,7 +17043,7 @@ bool MissileHitDiveArea(DSWActor* actor)
if (SpriteInDiveArea(actor))
{
// make sure you are close to the floor
if (actor->int_pos().Z < ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z < (actor->user.hiz + actor->user.loz) * 0.5)
return false;
// Check added by Jim because of sprite bridge over water
@ -17060,7 +17060,7 @@ bool MissileHitDiveArea(DSWActor* actor)
else if (SpriteInUnderwaterArea(actor))
{
// make sure you are close to the ceiling
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
return false;
actor->user.Flags &= ~(SPR_UNDERWATER);
@ -17952,7 +17952,7 @@ int DoShrapVelocity(DSWActor* actor)
else
{
// hit a sector
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
// hit a floor
if (!(actor->user.Flags & SPR_BOUNCE))
@ -17981,9 +17981,9 @@ int DoShrapVelocity(DSWActor* actor)
else
{
// hit floor
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
actor->set_int_z(actor->user.int_loz());
actor->spr.pos.Z = actor->user.loz;
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing underwater
@ -18254,9 +18254,9 @@ int DoItemFly(DSWActor* actor)
case kHitSector:
{
// hit floor
if (actor->int_pos().Z > ((actor->user.int_hiz() + actor->user.int_loz()) >> 1))
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) * 0.5))
{
actor->set_int_z(actor->user.int_loz());
actor->spr.pos.Z = actor->user.loz;
actor->user.Counter = 0;
actor->spr.xvel = 0;
actor->user.change.Z = actor->user.change.X = actor->user.change.Y = 0;