mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-21 00:20:59 +00:00
- wrapped user.zclip reads.
This commit is contained in:
parent
4021d13e8d
commit
a630f27a48
6 changed files with 17 additions and 16 deletions
|
@ -410,8 +410,8 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* perso
|
||||||
actor->user.zclip = Z(48);
|
actor->user.zclip = Z(48);
|
||||||
actor->user.lo_step = Z(32);
|
actor->user.lo_step = Z(32);
|
||||||
|
|
||||||
actor->user.floor_dist = (actor->user.zclip - actor->user.lo_step) * zinttoworld;
|
actor->user.floor_dist = (actor->user.int_zclip() - actor->user.lo_step) * zinttoworld;
|
||||||
actor->user.ceiling_dist = (ActorSizeZ(actor) - actor->user.zclip) * zinttoworld;
|
actor->user.ceiling_dist = (ActorSizeZ(actor) - actor->user.int_zclip()) * zinttoworld;
|
||||||
|
|
||||||
actor->user.Radius = 400;
|
actor->user.Radius = 400;
|
||||||
|
|
||||||
|
|
|
@ -936,6 +936,7 @@ struct USER
|
||||||
int int_z_tgt() const { return z_tgt * zworldtoint; }
|
int int_z_tgt() const { return z_tgt * zworldtoint; }
|
||||||
int int_ceiling_dist() const { return ceiling_dist * zworldtoint; }
|
int int_ceiling_dist() const { return ceiling_dist * zworldtoint; }
|
||||||
int int_floor_dist() const { return floor_dist * zworldtoint; }
|
int int_floor_dist() const { return floor_dist * zworldtoint; }
|
||||||
|
int int_zclip() const { return zclip/* * zworldtoint*/; }
|
||||||
|
|
||||||
//
|
//
|
||||||
// Variables that can be used by actors and Player
|
// Variables that can be used by actors and Player
|
||||||
|
@ -967,6 +968,7 @@ struct USER
|
||||||
TObjPtr<DSWActor*> flagOwnerActor;
|
TObjPtr<DSWActor*> flagOwnerActor;
|
||||||
TObjPtr<DSWActor*> WpnGoalActor;
|
TObjPtr<DSWActor*> WpnGoalActor;
|
||||||
|
|
||||||
|
double hiz, loz;
|
||||||
double oz; // serialized copy of sprite.oz
|
double oz; // serialized copy of sprite.oz
|
||||||
double z_tgt;
|
double z_tgt;
|
||||||
double ceiling_dist;
|
double ceiling_dist;
|
||||||
|
@ -993,7 +995,6 @@ struct USER
|
||||||
|
|
||||||
// clipmove
|
// clipmove
|
||||||
int16_t lo_step;
|
int16_t lo_step;
|
||||||
double hiz, loz;
|
|
||||||
int zclip; // z height to move up for clipmove
|
int zclip; // z height to move up for clipmove
|
||||||
int active_range;
|
int active_range;
|
||||||
sectortype* hi_sectp, *lo_sectp;
|
sectortype* hi_sectp, *lo_sectp;
|
||||||
|
|
|
@ -490,7 +490,7 @@ int DoHornetDeath(DSWActor* actor)
|
||||||
|
|
||||||
if (actor->user.Flags & (SPR_FALLING))
|
if (actor->user.Flags & (SPR_FALLING))
|
||||||
{
|
{
|
||||||
actor->user.loz = actor->user.zclip * zinttoworld;
|
actor->user.loz = actor->user.int_zclip() * zinttoworld;
|
||||||
DoFall(actor);
|
DoFall(actor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -737,8 +737,8 @@ int SetupSerp(DSWActor* actor)
|
||||||
// size of step can walk off of
|
// size of step can walk off of
|
||||||
actor->user.lo_step = Z(40);
|
actor->user.lo_step = Z(40);
|
||||||
|
|
||||||
actor->user.floor_dist = (actor->user.zclip - actor->user.lo_step) * zinttoworld;
|
actor->user.floor_dist = (actor->user.int_zclip() - actor->user.lo_step) * zinttoworld;
|
||||||
actor->user.ceiling_dist = (ActorSizeZ(actor) - actor->user.zclip) * zinttoworld;
|
actor->user.ceiling_dist = (ActorSizeZ(actor) - actor->user.int_zclip()) * zinttoworld;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,16 +232,16 @@ void SpikeAlign(DSWActor* actor)
|
||||||
if ((int8_t)SP_TAG7(actor) < 0)
|
if ((int8_t)SP_TAG7(actor) < 0)
|
||||||
{
|
{
|
||||||
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
|
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
|
||||||
alignceilslope(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.zclip);
|
alignceilslope(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.int_zclip());
|
||||||
else
|
else
|
||||||
alignflorslope(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.zclip);
|
alignflorslope(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.int_zclip());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
|
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
|
||||||
SOBJ_AlignCeilingToPoint(&SectorObject[SP_TAG7(actor)], actor->int_pos().X, actor->int_pos().Y, actor->user.zclip);
|
SOBJ_AlignCeilingToPoint(&SectorObject[SP_TAG7(actor)], actor->int_pos().X, actor->int_pos().Y, actor->user.int_zclip());
|
||||||
else
|
else
|
||||||
SOBJ_AlignFloorToPoint(&SectorObject[SP_TAG7(actor)], actor->int_pos().X, actor->int_pos().Y, actor->user.zclip);
|
SOBJ_AlignFloorToPoint(&SectorObject[SP_TAG7(actor)], actor->int_pos().X, actor->int_pos().Y, actor->user.int_zclip());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2250,7 +2250,7 @@ void SpriteSetup(void)
|
||||||
actor->user.zclip = florz;
|
actor->user.zclip = florz;
|
||||||
|
|
||||||
// start off
|
// start off
|
||||||
actor->user.pos.Z = actor->user.zclip;
|
actor->user.pos.Z = actor->user.int_zclip();
|
||||||
actor->user.z_tgt = actor->spr.pos.Z;
|
actor->user.z_tgt = actor->spr.pos.Z;
|
||||||
if (start_on)
|
if (start_on)
|
||||||
{
|
{
|
||||||
|
@ -2261,7 +2261,7 @@ void SpriteSetup(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// set orig z
|
// set orig z
|
||||||
actor->user.oz = actor->user.zclip * zinttoworld;
|
actor->user.oz = actor->user.int_zclip() * zinttoworld;
|
||||||
actor->opos.Z = actor->user.oz;
|
actor->opos.Z = actor->user.oz;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2269,7 +2269,7 @@ void SpriteSetup(void)
|
||||||
actor->user.zclip = ceilz;
|
actor->user.zclip = ceilz;
|
||||||
|
|
||||||
// start off
|
// start off
|
||||||
actor->user.pos.Z = actor->user.zclip;
|
actor->user.pos.Z = actor->user.int_zclip();
|
||||||
actor->user.z_tgt = actor->spr.pos.Z;
|
actor->user.z_tgt = actor->spr.pos.Z;
|
||||||
if (start_on)
|
if (start_on)
|
||||||
{
|
{
|
||||||
|
@ -2280,7 +2280,7 @@ void SpriteSetup(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// set orig z
|
// set orig z
|
||||||
actor->user.oz = actor->user.zclip * zinttoworld;
|
actor->user.oz = actor->user.int_zclip() * zinttoworld;
|
||||||
actor->opos.Z = actor->user.oz;
|
actor->opos.Z = actor->user.oz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6232,7 +6232,7 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// move the center point up for moving
|
// move the center point up for moving
|
||||||
zh = actor->user.zclip;
|
zh = actor->user.int_zclip();
|
||||||
clippos.Z -= zh;
|
clippos.Z -= zh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6426,7 +6426,7 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
zh = actor->user.zclip;
|
zh = actor->user.int_zclip();
|
||||||
clippos.Z -= zh;
|
clippos.Z -= zh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue