- renamed ang to __int_angle

This commit is contained in:
Christoph Oelckers 2022-08-16 23:15:16 +02:00
parent 9bac3b8857
commit 735b9a8fed
124 changed files with 2053 additions and 2031 deletions

View file

@ -41,7 +41,7 @@ static inline void get_wallspr_points(DCoreActor* actor, int32_t *x1, int32_t *x
//These lines get the 2 points of the rotated sprite
//Given: (x1, y1) starts out as the center point
const int32_t tilenum=actor->spr.picnum, ang=actor->spr.ang;
const int32_t tilenum=actor->spr.picnum, ang=actor->spr.__int_angle;
const int32_t xrepeat = actor->spr.xrepeat;
int32_t xoff = tileLeftOffset(tilenum) + actor->spr.xoffset;
int32_t k, l, dax, day;
@ -69,8 +69,8 @@ static inline void get_floorspr_points(DCoreActor *spr, int32_t px, int32_t py,
int32_t *y1, int32_t *y2, int32_t *y3, int32_t *y4, int heinum = 0)
{
const int32_t tilenum = spr->spr.picnum;
const int32_t cosang = bcos(spr->spr.ang);
const int32_t sinang = bsin(spr->spr.ang);
const int32_t cosang = bcos(spr->spr.__int_angle);
const int32_t sinang = bsin(spr->spr.__int_angle);
vec2_t const span = { tileWidth(tilenum), tileHeight(tilenum)};
vec2_t const repeat = { spr->spr.xrepeat, spr->spr.yrepeat };
@ -141,7 +141,7 @@ static int32_t spriteGetZOfSlope(DCoreActor* actor, int32_t dax, int32_t day)
if (heinum == 0)
return actor->int_pos().Z;
int const j = DMulScale(bsin(actor->spr.ang + 1024), day - actor->int_pos().Y, -bsin(actor->spr.ang + 512), dax - actor->int_pos().X, 4);
int const j = DMulScale(bsin(actor->spr.__int_angle + 1024), day - actor->int_pos().Y, -bsin(actor->spr.__int_angle + 512), dax - actor->int_pos().X, 4);
return actor->int_pos().Z + MulScale(heinum, j, 18);
}
@ -642,8 +642,8 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
if (clipinsideboxline(cent.X, cent.Y, p1.X, p1.Y, p2.X, p2.Y, rad) != 0)
{
vec2_t v = { MulScale(bcos(actor->spr.ang + 256), walldist, 14),
MulScale(bsin(actor->spr.ang + 256), walldist, 14) };
vec2_t v = { MulScale(bcos(actor->spr.__int_angle + 256), walldist, 14),
MulScale(bsin(actor->spr.__int_angle + 256), walldist, 14) };
if ((p1.X-pos->X) * (p2.Y-pos->Y) >= (p2.X-pos->X) * (p1.Y-pos->Y)) // Front
addclipline(p1.X+v.X, p1.Y+v.Y, p2.X+v.Y, p2.Y-v.X, obj, false);
@ -692,8 +692,8 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
get_floorspr_points(actor, 0, 0, &rxi[0], &rxi[1], &rxi[2], &rxi[3],
&ryi[0], &ryi[1], &ryi[2], &ryi[3], heinum);
vec2_t v = { MulScale(bcos(actor->spr.ang - 256), walldist, 14),
MulScale(bsin(actor->spr.ang - 256), walldist, 14) };
vec2_t v = { MulScale(bcos(actor->spr.__int_angle - 256), walldist, 14),
MulScale(bsin(actor->spr.__int_angle - 256), walldist, 14) };
if ((rxi[0]-pos->X) * (ryi[1]-pos->Y) < (rxi[1]-pos->X) * (ryi[0]-pos->Y))
{
@ -723,8 +723,8 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
// the rest is for slope sprites only.
const int32_t tilenum = actor->spr.picnum;
const int32_t cosang = bcos(actor->spr.ang);
const int32_t sinang = bsin(actor->spr.ang);
const int32_t cosang = bcos(actor->spr.__int_angle);
const int32_t sinang = bsin(actor->spr.__int_angle);
vec2_t const span = { tileWidth(tilenum), tileHeight(tilenum) };
vec2_t const repeat = { actor->spr.xrepeat, actor->spr.yrepeat };
vec2_t adjofs = { tileLeftOffset(tilenum), tileTopOffset(tilenum) };
@ -752,8 +752,8 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
int32_t x2 = x1 - MulScale(sinang, rspanx, 16);
int32_t y2 = y1 + MulScale(cosang, rspanx, 16);
vec2_t const v = { MulScale(bcos(actor->spr.ang - 256), walldist, 14),
MulScale(bsin(actor->spr.ang - 256), walldist, 14) };
vec2_t const v = { MulScale(bcos(actor->spr.__int_angle - 256), walldist, 14),
MulScale(bsin(actor->spr.__int_angle - 256), walldist, 14) };
if (clipinsideboxline(cent.X, cent.Y, x1, y1, x2, y2, rad) != 0)
{
@ -1202,8 +1202,8 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas
get_floorspr_points(actor, pos.X, pos.Y, &v1.X, &v2.X, &v3.X, &v4.X,
&v1.Y, &v2.Y, &v3.Y, &v4.Y, spriteGetSlope(actor));
vec2_t const da = { MulScale(bcos(actor->spr.ang - 256), walldist + 4, 14),
MulScale(bsin(actor->spr.ang - 256), walldist + 4, 14) };
vec2_t const da = { MulScale(bcos(actor->spr.__int_angle - 256), walldist + 4, 14),
MulScale(bsin(actor->spr.__int_angle - 256), walldist + 4, 14) };
v1.X += da.X; v2.X -= da.Y; v3.X -= da.X; v4.X += da.Y;
v1.Y += da.Y; v2.Y += da.X; v3.Y -= da.Y; v4.Y -= da.X;
@ -1512,8 +1512,8 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire
{
int32_t x3, y3, x4, y4;
int32_t const heinum = spriteGetSlope(actor);
int32_t const dax = (heinum * sintable[(actor->spr.ang + 1024) & 2047]) << 1;
int32_t const day = (heinum * sintable[(actor->spr.ang + 512) & 2047]) << 1;
int32_t const dax = (heinum * sintable[(actor->spr.__int_angle + 1024) & 2047]) << 1;
int32_t const day = (heinum * sintable[(actor->spr.__int_angle + 512) & 2047]) << 1;
int32_t const j = (vz << 8) - DMulScale(dax, vy, -day, vx, 15);
if (j == 0) continue;
if ((cstat & 64) != 0)

View file

@ -495,7 +495,7 @@ DEFINE_FIELD_NAMED(DCoreActor, spr.cstat, cstat)
DEFINE_FIELD_NAMED(DCoreActor, spr.cstat2, cstat2)
DEFINE_FIELD_NAMED(DCoreActor, spr.picnum, picnum)
DEFINE_FIELD_NAMED(DCoreActor, spr.statnum, statnum)
DEFINE_FIELD_NAMED(DCoreActor, spr.ang, ang)
DEFINE_FIELD_NAMED(DCoreActor, spr.__int_angle, ang)
DEFINE_FIELD_NAMED(DCoreActor, spr.pos, pos)
DEFINE_FIELD_NAMED(DCoreActor, spr.xvel, xvel)
DEFINE_FIELD_NAMED(DCoreActor, spr.yvel, yvel)

View file

@ -107,6 +107,17 @@ public:
spr.pos.Y = y * inttoworld;
}
const int16_t int_ang() const
{
return spr.__int_angle;
}
void set_int_ang(int a)
{
spr.__int_angle = int16_t(a);
}
// Same as above but with invertex y and z axes to match the renderer's coordinate system.
DVector3 render_pos() const
{
@ -174,7 +185,7 @@ public:
int16_t interpolatedang(double const smoothratio)
{
return interpolatedangle(oang, spr.ang, smoothratio, 16);
return interpolatedangle(oang, spr.__int_angle, smoothratio, 16);
}
void backupx()
@ -205,7 +216,7 @@ public:
void backupang()
{
oang = spr.ang;
oang = spr.__int_angle;
}
void backuploc()

View file

@ -104,7 +104,7 @@ bool calcChaseCamPos(int* px, int* py, int* pz, DCoreActor* act, sectortype** ps
else
{
// same as wall calculation.
daang = buildang(act->spr.ang - 512);
daang = buildang(act->spr.__int_angle - 512);
newdist = nx * daang.bsin() + ny * -daang.bcos();
if (abs(nx) > abs(ny))
@ -305,8 +305,8 @@ void GetWallSpritePosition(const tspritetype* spr, vec2_t pos, vec2_t* out, bool
leftofs = ((int)tex->GetDisplayLeftOffset() + spr->xoffset);
}
int x = bsin(spr->ang) * spr->xrepeat;
int y = -bcos(spr->ang) * spr->xrepeat;
int x = bsin(spr->__int_angle) * spr->xrepeat;
int y = -bcos(spr->__int_angle) * spr->xrepeat;
int xoff = leftofs;
if (spr->cstat & CSTAT_SPRITE_XFLIP) xoff = -xoff;
@ -356,8 +356,8 @@ void TGetFlatSpritePosition(const spritetypebase* spr, vec2_t pos, vec2_t* out,
int sprcenterx = (width >> 1) + leftofs;
int sprcentery = (height >> 1) + topofs;
int cosang = bcos(spr->ang);
int sinang = bsin(spr->ang);
int cosang = bcos(spr->__int_angle);
int sinang = bsin(spr->__int_angle);
int cosangslope = DivScale(cosang, ratio, 12);
int sinangslope = DivScale(sinang, ratio, 12);
@ -571,7 +571,7 @@ tspritetype* renderAddTsprite(tspriteArray& tsprites, DCoreActor* actor)
tspr->yoffset = actor->spr.yoffset;
tspr->sectp = actor->spr.sectp;
tspr->statnum = actor->spr.statnum;
tspr->ang = actor->spr.ang;
tspr->__int_angle = actor->spr.__int_angle;
tspr->xvel = actor->spr.xvel;
tspr->yvel = actor->spr.yvel;
tspr->zvel = actor->spr.zvel;

View file

@ -339,7 +339,7 @@ inline int32_t tspriteGetZOfSlope(const tspritetype* tspr, int dax, int day)
int heinum = tspriteGetSlope(tspr);
if (heinum == 0) return tspr->int_pos().Z;
int const j = DMulScale(bsin(tspr->ang + 1024), day - tspr->int_pos().Y, -bsin(tspr->ang + 512), dax - tspr->int_pos().X, 4);
int const j = DMulScale(bsin(tspr->__int_angle + 1024), day - tspr->int_pos().Y, -bsin(tspr->__int_angle + 512), dax - tspr->int_pos().X, 4);
return tspr->int_pos().Z + MulScale(heinum, j, 18);
}

View file

@ -313,7 +313,7 @@ static void ReadSpriteV7(FileReader& fr, spritetype& spr, int& secno)
spr.yoffset = fr.ReadInt8();
secno = fr.ReadInt16();
spr.statnum = fr.ReadInt16();
spr.ang = fr.ReadInt16();
spr.__int_angle = fr.ReadInt16();
spr.intowner = fr.ReadInt16();
spr.xvel = fr.ReadInt16();
spr.yvel = fr.ReadInt16();
@ -339,7 +339,7 @@ static void ReadSpriteV6(FileReader& fr, spritetype& spr, int& secno)
spr.xoffset = fr.ReadInt8();
spr.yoffset = fr.ReadInt8();
spr.picnum = fr.ReadInt16();
spr.ang = fr.ReadInt16();
spr.__int_angle = fr.ReadInt16();
spr.xvel = fr.ReadInt16();
spr.yvel = fr.ReadInt16();
spr.zvel = fr.ReadInt16();
@ -366,7 +366,7 @@ static void ReadSpriteV5(FileReader& fr, spritetype& spr, int& secno)
spr.xrepeat = fr.ReadUInt8();
spr.yrepeat = fr.ReadUInt8();
spr.picnum = fr.ReadInt16();
spr.ang = fr.ReadInt16();
spr.__int_angle = fr.ReadInt16();
spr.xvel = fr.ReadInt16();
spr.yvel = fr.ReadInt16();
spr.zvel = fr.ReadInt16();

View file

@ -464,7 +464,7 @@ struct spritetypebase
ESpriteFlags cstat;
int16_t picnum;
int16_t statnum;
int16_t ang;
int16_t __int_angle;
int16_t xvel;
int16_t yvel;
union { int16_t zvel, inittype; }; // inittype, type and flags are for Blood.
@ -492,6 +492,17 @@ struct spritetypebase
{
return { int(pos.X * worldtoint), int(pos.Y * worldtoint), int(pos.Z * zworldtoint) };
}
const int16_t int_ang() const
{
return __int_angle;
}
void set_int_ang(int a)
{
__int_angle = int16_t(a);
}
};

View file

@ -684,7 +684,7 @@ void BunchDrawer::ProcessSection(int sectionnum, bool portal)
if ((actor->spr.cstat & (CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_MASK)) != (CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_WALL) ||
(r_voxels && tiletovox[actor->spr.picnum] >= 0 && voxmodels[tiletovox[actor->spr.picnum]]) ||
(r_voxels && gi->Voxelize(actor->spr.picnum) > -1) ||
DMulScale(bcos(actor->spr.ang), -sx, bsin(actor->spr.ang), -sy, 6) > 0)
DMulScale(bcos(actor->spr.__int_angle), -sx, bsin(actor->spr.__int_angle), -sy, 6) > 0)
if (!renderAddTsprite(di->tsprites, actor))
break;
}

View file

@ -318,13 +318,13 @@ void HWDrawInfo::DispatchSprites()
if (actor->sprext.renderflags & SPREXT_AWAY1)
{
tspr->add_int_x(bcos(tspr->ang, -13));
tspr->add_int_y(bsin(tspr->ang, -13));
tspr->add_int_x(bcos(tspr->__int_angle, -13));
tspr->add_int_y(bsin(tspr->__int_angle, -13));
}
else if (actor->sprext.renderflags & SPREXT_AWAY2)
{
tspr->add_int_x(-bcos(tspr->ang, -13));
tspr->add_int_y(-bsin(tspr->ang, -13));
tspr->add_int_x(-bcos(tspr->__int_angle, -13));
tspr->add_int_y(-bsin(tspr->__int_angle, -13));
}
switch (tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK)

View file

@ -459,7 +459,7 @@ bool HWSprite::ProcessVoxel(HWDrawInfo* di, voxmodel_t* vox, tspritetype* spr, s
visibility = sectorVisibility(sector);
voxel = vox;
auto ang = spr->ang + ownerActor->sprext.angoff;
auto ang = spr->__int_angle + ownerActor->sprext.angoff;
if ((spr->clipdist & TSPR_MDLROTATE) || rotate)
{
int myclock = (PlayClock << 3) + MulScale(4 << 3, (int)di->Viewpoint.TicFrac, 16);

View file

@ -63,13 +63,13 @@ static walltype* IsOnWall(tspritetype* tspr, int height, DVector2& outpos)
// Intentionally include two sided walls. Even on them the sprite should be projected onto the wall for better results.
auto d = wal.delta();
int walang = getangle(d.X, d.Y);
int deltaang = abs((((walang - tspr->ang) & 2047) << 21) >> 21);
int deltaang = abs((((walang - tspr->__int_angle) & 2047) << 21) >> 21);
const int maxangdelta = 1;
// angle of the sprite must either be the wall's normal or the negative wall's normal to be aligned.
if (deltaang >= 512 - maxangdelta && deltaang <= 512 + maxangdelta)
{
if (!((tspr->ang) & 510))
if (!((tspr->__int_angle) & 510))
{
// orthogonal lines do not check the actual position so that certain off-sector sprites get handled properly.
// In Wanton Destruction's airplane level there's such a sprite assigned to the wrong sector.
@ -1102,7 +1102,7 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec
int HWWall::CheckWallSprite(tspritetype* spr, tspritetype* last)
{
// If the position changed we need to recalculate everything.
if (spr->pos.XY() != last->pos.XY() || spr->sectp != last->sectp || spr->ang != last->ang) return 3;
if (spr->pos.XY() != last->pos.XY() || spr->sectp != last->sectp || spr->__int_angle != last->__int_angle) return 3;
// if the horizontal orientation changes we need to recalculate the walls this attaches to, but not the positioning.
if (spr->xrepeat != last->xrepeat || spr->xoffset != last->xoffset || spr->picnum != last->picnum || ((spr->cstat ^ last->cstat) & CSTAT_SPRITE_XFLIP)) return 2;

View file

@ -461,7 +461,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, spritetype &c, spritet
("yoffset", c.yoffset, def->yoffset)
("statnum", c.statnum)
("sectnum", c.sectp)
("ang", c.ang, def->ang)
("ang", c.__int_angle, def->__int_angle)
("owner", c.intowner, def->intowner)
("xvel", c.xvel, def->xvel)
("yvel", c.yvel, def->yvel)

View file

@ -337,7 +337,7 @@ DEFINE_PROPERTY(statnum, I, CoreActor)
DEFINE_PROPERTY(angle, I, CoreActor)
{
PROP_INT_PARM(i, 0);
bag.Info->ActorInfo()->defsprite.ang = i;
bag.Info->ActorInfo()->defsprite.__int_angle = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_ANG;
}

View file

@ -84,7 +84,7 @@ DEFINE_FIELD_X(walltype, walltype, yrepeat)
DEFINE_FIELD_NAMED_X(tspritetype, tspritetype, sectp, sector)
DEFINE_FIELD_X(tspritetype, tspritetype, cstat)
DEFINE_FIELD_X(tspritetype, tspritetype, statnum)
DEFINE_FIELD_X(tspritetype, tspritetype, ang)
DEFINE_FIELD_NAMED_X(tspritetype, tspritetype, __int_angle, ang)
DEFINE_FIELD_X(tspritetype, tspritetype, xvel)
DEFINE_FIELD_X(tspritetype, tspritetype, yvel)
DEFINE_FIELD_X(tspritetype, tspritetype, zvel)

View file

@ -2724,7 +2724,7 @@ static void actNapalmMove(DBloodActor* actor)
int spawnparam[2];
spawnparam[0] = actor->xspr.data4 >> 1;
spawnparam[1] = actor->xspr.data4 - spawnparam[0];
int ang = actor->spr.ang;
int ang = actor->spr.__int_angle;
actor->vel.X = 0;
actor->vel.Y = 0;
actor->vel.Z = 0;
@ -2732,7 +2732,7 @@ static void actNapalmMove(DBloodActor* actor)
{
int t1 = Random(0x33333) + 0x33333;
int rndang = Random2(0x71);
actor->spr.ang = (rndang + ang + 2048) & 2047;
actor->spr.__int_angle = (rndang + ang + 2048) & 2047;
auto spawned = actFireThing(actor, 0, 0, -0x93d0, kThingNapalmBall, t1);
spawned->SetOwner(actor->GetOwner());
seqSpawn(61, spawned, nNapalmClient);
@ -2968,7 +2968,7 @@ static bool actKillModernDude(DBloodActor* actor, DAMAGE_TYPE damageType)
else
{
seqKill(actor);
DBloodActor* pEffect = gFX.fxSpawnActor((FX_ID)52, actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.ang);
DBloodActor* pEffect = gFX.fxSpawnActor((FX_ID)52, actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.__int_angle);
if (pEffect != nullptr)
{
pEffect->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FACING;
@ -3862,7 +3862,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
if (missileActor->hasX())
{
actPostSprite(missileActor, kStatDecoration);
if (missileActor->spr.ang == 1024) sfxPlay3DSound(missileActor, 307, -1, 0);
if (missileActor->spr.__int_angle == 1024) sfxPlay3DSound(missileActor, 307, -1, 0);
missileActor->spr.type = kSpriteDecoration;
seqSpawn(9, missileActor, -1);
}
@ -3881,7 +3881,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
if (pWallHit)
{
auto pFX = gFX.fxSpawnActor(FX_52, missileActor->sector(), missileActor->int_pos().X, missileActor->int_pos().Y, missileActor->int_pos().Z, 0);
if (pFX) pFX->spr.ang = (GetWallAngle(pWallHit) + 512) & 2047;
if (pFX) pFX->spr.__int_angle = (GetWallAngle(pWallHit) + 512) & 2047;
}
break;
}
@ -3974,7 +3974,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
missileActor->spr.picnum = 2123;
missileActor->SetTarget(actorHit);
missileActor->xspr.TargetPos.Z = missileActor->int_pos().Z - actorHit->int_pos().Z;
missileActor->xspr.goalAng = getangle(missileActor->int_pos().X - actorHit->int_pos().X, missileActor->int_pos().Y - actorHit->int_pos().Y) - actorHit->spr.ang;
missileActor->xspr.goalAng = getangle(missileActor->int_pos().X - actorHit->int_pos().X, missileActor->int_pos().Y - actorHit->int_pos().Y) - actorHit->spr.__int_angle;
missileActor->xspr.state = 1;
actPostSprite(missileActor, kStatFlare);
missileActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
@ -4101,8 +4101,8 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
static void actKickObject(DBloodActor* kicker, DBloodActor* kicked)
{
int nSpeed = ClipLow(approxDist(kicker->vel.X, kicker->vel.Y) * 2, 0xaaaaa);
kicked->vel.X = MulScale(nSpeed, Cos(kicker->spr.ang + Random2(85)), 30);
kicked->vel.Y = MulScale(nSpeed, Sin(kicker->spr.ang + Random2(85)), 30);
kicked->vel.X = MulScale(nSpeed, Cos(kicker->spr.__int_angle + Random2(85)), 30);
kicked->vel.Y = MulScale(nSpeed, Sin(kicker->spr.__int_angle + Random2(85)), 30);
kicked->vel.Z = MulScale(nSpeed, -0x2000, 14);
kicked->spr.flags = 7;
}
@ -4720,7 +4720,7 @@ static Collision MoveThing(DBloodActor* actor)
}
}
if (actor->vel.X || actor->vel.Y)
actor->spr.ang = getangle(actor->vel.X, actor->vel.Y);
actor->spr.__int_angle = getangle(actor->vel.X, actor->vel.Y);
return lhit;
}
@ -5953,8 +5953,8 @@ static void actCheckTraps()
int y = actor->int_pos().Y;
int z = actor->int_pos().Z;
int t = (actor->xspr.data1 << 23) / 120;
int dx = MulScale(t, Cos(actor->spr.ang), 30);
int dy = MulScale(t, Sin(actor->spr.ang), 30);
int dx = MulScale(t, Cos(actor->spr.__int_angle), 30);
int dy = MulScale(t, Sin(actor->spr.__int_angle), 30);
for (int i = 0; i < 2; i++)
{
auto pFX = gFX.fxSpawnActor(FX_32, actor->sector(), x, y, z, 0);
@ -5967,8 +5967,8 @@ static void actCheckTraps()
x += (dx / 2) >> 12;
y += (dy / 2) >> 12;
}
dy = bsin(actor->spr.ang);
dx = bcos(actor->spr.ang);
dy = bsin(actor->spr.__int_angle);
dx = bcos(actor->spr.__int_angle);
gVectorData[kVectorTchernobogBurn].maxDist = actor->xspr.data1 << 9;
actFireVector(actor, 0, 0, dx, dy, Random2(0x8888), kVectorTchernobogBurn);
}
@ -6150,8 +6150,8 @@ void actCheckFlares()
}
if (target->hasX() && target->xspr.health > 0)
{
int x = target->int_pos().X + mulscale30r(Cos(actor->xspr.goalAng + target->spr.ang), target->spr.clipdist * 2);
int y = target->int_pos().Y + mulscale30r(Sin(actor->xspr.goalAng + target->spr.ang), target->spr.clipdist * 2);
int x = target->int_pos().X + mulscale30r(Cos(actor->xspr.goalAng + target->spr.__int_angle), target->spr.clipdist * 2);
int y = target->int_pos().Y + mulscale30r(Sin(actor->xspr.goalAng + target->spr.__int_angle), target->spr.clipdist * 2);
int z = target->int_pos().Z + actor->xspr.TargetPos.Z;
vec3_t pos = { x, y, z };
SetActor(actor, &pos);
@ -6243,7 +6243,7 @@ DBloodActor* actSpawnDude(DBloodActor* source, int nType, int a3, int a4)
{
auto spawned = actSpawnSprite(source, kStatDude);
if (!spawned) return nullptr;
int angle = source->spr.ang;
int angle = source->spr.__int_angle;
int nDude = nType - kDudeBase;
int x, y, z;
z = a4 + source->int_pos().Z;
@ -6260,7 +6260,7 @@ DBloodActor* actSpawnDude(DBloodActor* source, int nType, int a3, int a4)
spawned->spr.type = nType;
if (!VanillaMode())
spawned->spr.inittype = nType;
spawned->spr.ang = angle;
spawned->spr.__int_angle = angle;
vec3_t pos = { x, y, z };
SetActor(spawned, &pos);
spawned->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL | CSTAT_SPRITE_BLOOD_BIT1;
@ -6407,21 +6407,21 @@ DBloodActor* actSpawnThing(sectortype* pSector, int x, int y, int z, int nThingT
DBloodActor* actFireThing(DBloodActor* actor, int a2, int a3, int a4, int thingType, int a6)
{
assert(thingType >= kThingBase && thingType < kThingMax);
int x = actor->int_pos().X + MulScale(a2, Cos(actor->spr.ang + 512), 30);
int y = actor->int_pos().Y + MulScale(a2, Sin(actor->spr.ang + 512), 30);
int x = actor->int_pos().X + MulScale(a2, Cos(actor->spr.__int_angle + 512), 30);
int y = actor->int_pos().Y + MulScale(a2, Sin(actor->spr.__int_angle + 512), 30);
int z = actor->int_pos().Z + a3;
x += MulScale(actor->spr.clipdist, Cos(actor->spr.ang), 28);
y += MulScale(actor->spr.clipdist, Sin(actor->spr.ang), 28);
x += MulScale(actor->spr.clipdist, Cos(actor->spr.__int_angle), 28);
y += MulScale(actor->spr.clipdist, Sin(actor->spr.__int_angle), 28);
if (HitScan(actor, z, x - actor->int_pos().X, y - actor->int_pos().Y, 0, CLIPMASK0, actor->spr.clipdist) != -1)
{
x = gHitInfo.hitpos.X - MulScale(actor->spr.clipdist << 1, Cos(actor->spr.ang), 28);
y = gHitInfo.hitpos.Y - MulScale(actor->spr.clipdist << 1, Sin(actor->spr.ang), 28);
x = gHitInfo.hitpos.X - MulScale(actor->spr.clipdist << 1, Cos(actor->spr.__int_angle), 28);
y = gHitInfo.hitpos.Y - MulScale(actor->spr.clipdist << 1, Sin(actor->spr.__int_angle), 28);
}
auto fired = actSpawnThing(actor->sector(), x, y, z, thingType);
fired->SetOwner(actor);
fired->spr.ang = actor->spr.ang;
fired->vel.X = MulScale(a6, Cos(fired->spr.ang), 30);
fired->vel.Y = MulScale(a6, Sin(fired->spr.ang), 30);
fired->spr.__int_angle = actor->spr.__int_angle;
fired->vel.X = MulScale(a6, Cos(fired->spr.__int_angle), 30);
fired->vel.Y = MulScale(a6, Sin(fired->spr.__int_angle), 30);
fired->vel.Z = MulScale(a6, a4, 14);
fired->vel.X += actor->vel.X / 2;
fired->vel.Y += actor->vel.Y / 2;
@ -6519,25 +6519,25 @@ DBloodActor* actFireMissile(DBloodActor* actor, int a2, int a3, int a4, int a5,
assert(nType >= kMissileBase && nType < kMissileMax);
bool impact = false;
const MissileType* pMissileInfo = &missileInfo[nType - kMissileBase];
int x = actor->int_pos().X + MulScale(a2, Cos(actor->spr.ang + 512), 30);
int y = actor->int_pos().Y + MulScale(a2, Sin(actor->spr.ang + 512), 30);
int x = actor->int_pos().X + MulScale(a2, Cos(actor->spr.__int_angle + 512), 30);
int y = actor->int_pos().Y + MulScale(a2, Sin(actor->spr.__int_angle + 512), 30);
int z = actor->int_pos().Z + a3;
int clipdist = pMissileInfo->clipDist + actor->spr.clipdist;
x += MulScale(clipdist, Cos(actor->spr.ang), 28);
y += MulScale(clipdist, Sin(actor->spr.ang), 28);
x += MulScale(clipdist, Cos(actor->spr.__int_angle), 28);
y += MulScale(clipdist, Sin(actor->spr.__int_angle), 28);
int hit = HitScan(actor, z, x - actor->int_pos().X, y - actor->int_pos().Y, 0, CLIPMASK0, clipdist);
if (hit != -1)
{
if (hit == 3 || hit == 0)
{
impact = true;
x = gHitInfo.hitpos.X - MulScale(Cos(actor->spr.ang), 16, 30);
y = gHitInfo.hitpos.Y - MulScale(Sin(actor->spr.ang), 16, 30);
x = gHitInfo.hitpos.X - MulScale(Cos(actor->spr.__int_angle), 16, 30);
y = gHitInfo.hitpos.Y - MulScale(Sin(actor->spr.__int_angle), 16, 30);
}
else
{
x = gHitInfo.hitpos.X - MulScale(pMissileInfo->clipDist << 1, Cos(actor->spr.ang), 28);
y = gHitInfo.hitpos.Y - MulScale(pMissileInfo->clipDist << 1, Sin(actor->spr.ang), 28);
x = gHitInfo.hitpos.X - MulScale(pMissileInfo->clipDist << 1, Cos(actor->spr.__int_angle), 28);
y = gHitInfo.hitpos.Y - MulScale(pMissileInfo->clipDist << 1, Sin(actor->spr.__int_angle), 28);
}
}
auto spawned = actSpawnSprite(actor->sector(), x, y, z, 5, 1);
@ -6551,7 +6551,7 @@ DBloodActor* actFireMissile(DBloodActor* actor, int a2, int a3, int a4, int a5,
spawned->spr.xrepeat = pMissileInfo->xrepeat;
spawned->spr.yrepeat = pMissileInfo->yrepeat;
spawned->spr.picnum = pMissileInfo->picnum;
spawned->spr.ang = (actor->spr.ang + pMissileInfo->angleOfs) & 2047;
spawned->spr.__int_angle = (actor->spr.__int_angle + pMissileInfo->angleOfs) & 2047;
spawned->vel.X = MulScale(pMissileInfo->velocity, a4, 14);
spawned->vel.Y = MulScale(pMissileInfo->velocity, a5, 14);
spawned->vel.Z = MulScale(pMissileInfo->velocity, a6, 14);
@ -6751,7 +6751,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
auto pFX = gFX.fxSpawnActor(pVectorData->surfHit[nnSurf].fx1, pSector, xx, yy, zz, 0);
if (pFX)
{
pFX->spr.ang = (GetWallAngle(pWall) + 512) & 2047;
pFX->spr.__int_angle = (GetWallAngle(pWall) + 512) & 2047;
pFX->spr.cstat |= CSTAT_SPRITE_ALIGNMENT_WALL;
}
}
@ -6855,7 +6855,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
if (pFX)
{
pFX->vel.Z = 0x2222;
pFX->spr.ang = (GetWallAngle(pWall) + 512) & 2047;
pFX->spr.__int_angle = (GetWallAngle(pWall) + 512) & 2047;
pFX->spr.cstat |= CSTAT_SPRITE_ALIGNMENT_WALL;
}
}

View file

@ -250,9 +250,9 @@ bool CanMove(DBloodActor* actor, DBloodActor* target, int nAngle, int nRange)
void aiChooseDirection(DBloodActor* actor, int a3)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
int vc = ((a3 + 1024 - actor->spr.ang) & 2047) - 1024;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int vc = ((a3 + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int dx = actor->vel.X;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
@ -260,30 +260,30 @@ void aiChooseDirection(DBloodActor* actor, int a3)
int v8 = 341;
if (vc < 0)
v8 = -341;
if (CanMove(actor, actor->GetTarget(), actor->spr.ang + vc, vsi))
actor->xspr.goalAng = actor->spr.ang + vc;
else if (CanMove(actor, actor->GetTarget(), actor->spr.ang + vc / 2, vsi))
actor->xspr.goalAng = actor->spr.ang + vc / 2;
else if (CanMove(actor, actor->GetTarget(), actor->spr.ang - vc / 2, vsi))
actor->xspr.goalAng = actor->spr.ang - vc / 2;
else if (CanMove(actor, actor->GetTarget(), actor->spr.ang + v8, vsi))
actor->xspr.goalAng = actor->spr.ang + v8;
else if (CanMove(actor, actor->GetTarget(), actor->spr.ang, vsi))
actor->xspr.goalAng = actor->spr.ang;
else if (CanMove(actor, actor->GetTarget(), actor->spr.ang - v8, vsi))
actor->xspr.goalAng = actor->spr.ang - v8;
if (CanMove(actor, actor->GetTarget(), actor->spr.__int_angle + vc, vsi))
actor->xspr.goalAng = actor->spr.__int_angle + vc;
else if (CanMove(actor, actor->GetTarget(), actor->spr.__int_angle + vc / 2, vsi))
actor->xspr.goalAng = actor->spr.__int_angle + vc / 2;
else if (CanMove(actor, actor->GetTarget(), actor->spr.__int_angle - vc / 2, vsi))
actor->xspr.goalAng = actor->spr.__int_angle - vc / 2;
else if (CanMove(actor, actor->GetTarget(), actor->spr.__int_angle + v8, vsi))
actor->xspr.goalAng = actor->spr.__int_angle + v8;
else if (CanMove(actor, actor->GetTarget(), actor->spr.__int_angle, vsi))
actor->xspr.goalAng = actor->spr.__int_angle;
else if (CanMove(actor, actor->GetTarget(), actor->spr.__int_angle - v8, vsi))
actor->xspr.goalAng = actor->spr.__int_angle - v8;
//else if (actor->spr.flags&2)
//actor->xspr.goalAng = actor->spr.ang+341;
//actor->xspr.goalAng = actor->spr.__int_angle+341;
else // Weird..
actor->xspr.goalAng = actor->spr.ang + 341;
actor->xspr.goalAng = actor->spr.__int_angle + 341;
if (Chance(0x8000))
actor->xspr.dodgeDir = 1;
else
actor->xspr.dodgeDir = -1;
if (!CanMove(actor, actor->GetTarget(), actor->spr.ang + actor->xspr.dodgeDir * 512, 512))
if (!CanMove(actor, actor->GetTarget(), actor->spr.__int_angle + actor->xspr.dodgeDir * 512, 512))
{
actor->xspr.dodgeDir = -actor->xspr.dodgeDir;
if (!CanMove(actor, actor->GetTarget(), actor->spr.ang + actor->xspr.dodgeDir * 512, 512))
if (!CanMove(actor, actor->GetTarget(), actor->spr.__int_angle + actor->xspr.dodgeDir * 512, 512))
actor->xspr.dodgeDir = 0;
}
}
@ -298,13 +298,13 @@ void aiMoveForward(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
if (abs(nAng) > 341)
return;
actor->vel.X += MulScale(pDudeInfo->frontSpeed, Cos(actor->spr.ang), 30);
actor->vel.Y += MulScale(pDudeInfo->frontSpeed, Sin(actor->spr.ang), 30);
actor->vel.X += MulScale(pDudeInfo->frontSpeed, Cos(actor->spr.__int_angle), 30);
actor->vel.Y += MulScale(pDudeInfo->frontSpeed, Sin(actor->spr.__int_angle), 30);
}
//---------------------------------------------------------------------------
@ -317,9 +317,9 @@ void aiMoveTurn(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
}
//---------------------------------------------------------------------------
@ -332,13 +332,13 @@ void aiMoveDodge(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
if (actor->xspr.dodgeDir)
{
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int dx = actor->vel.X;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
@ -1520,7 +1520,7 @@ void aiThinkTarget(DBloodActor* actor)
if (!cansee(x, y, z, pSector, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - ((pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2), actor->sector()))
continue;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
aiSetTarget(actor, pPlayer->actor);
@ -1565,7 +1565,7 @@ void aiLookForTarget(DBloodActor* actor)
continue;
if (!cansee(x, y, z, pSector, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - ((pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2), actor->sector()))
continue;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
aiSetTarget(actor, pPlayer->actor);

View file

@ -65,8 +65,8 @@ void batBiteSeqCallback(int, DBloodActor* actor)
{
if (!actor->ValidateTarget(__FUNCTION__)) return;
auto pTarget = actor->GetTarget();
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
DUDEINFO* pDudeInfoT = getDudeInfo(pTarget->spr.type);
@ -108,7 +108,7 @@ static void batThinkTarget(DBloodActor* actor)
continue;
if (!cansee(x, y, z, pSector, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - ((pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2), actor->sector()))
continue;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
aiSetTarget(actor, pPlayer->actor);
@ -141,7 +141,7 @@ static void batThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
aiNewState(actor, &batSearch);
batThinkTarget(actor);
}
@ -168,7 +168,7 @@ static void batThinkPonder(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
int height2 = (getDudeInfo(pTarget->spr.type)->eyeHeight * pTarget->spr.yrepeat) << 2;
int top, bottom;
@ -203,11 +203,11 @@ static void batMoveDodgeUp(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int dx = actor->vel.X;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
@ -226,13 +226,13 @@ static void batMoveDodgeDown(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
if (actor->xspr.dodgeDir == 0)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int dx = actor->vel.X;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
@ -274,7 +274,7 @@ static void batThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
// Should be dudeInfo[pTarget->spr.type-kDudeBase]
int height2 = (pDudeInfo->eyeHeight * pTarget->spr.yrepeat) << 2;
@ -310,21 +310,21 @@ static void batMoveForward(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->spr.ang = (actor->spr.ang + 256) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + 256) & 2047;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);
if ((unsigned int)Random(64) < 32 && nDist <= 0x200)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -341,13 +341,13 @@ static void batMoveSwoop(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->xspr.goalAng = (actor->spr.ang + 512) & 2047;
actor->xspr.goalAng = (actor->spr.__int_angle + 512) & 2047;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
@ -355,8 +355,8 @@ static void batMoveSwoop(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x600) && nDist <= 0x200)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -371,13 +371,13 @@ static void batMoveFly(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->spr.ang = (actor->spr.ang + 512) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + 512) & 2047;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
@ -385,8 +385,8 @@ static void batMoveFly(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x4000) && nDist <= 0x200)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);

View file

@ -66,8 +66,8 @@ void SlashSeqCallback(int, DBloodActor* actor)
{
if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget();
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
// Correct ?
int dz = actor->int_pos().Z - target->int_pos().Z;
dx += Random3(4000 - 700 * gGameOptions.nDifficulty);
@ -80,8 +80,8 @@ void SlashSeqCallback(int, DBloodActor* actor)
void StompSeqCallback(int, DBloodActor* actor)
{
int angx = bcos(actor->spr.ang);
int angy = bsin(actor->spr.ang);
int angx = bcos(actor->spr.__int_angle);
int angy = bsin(actor->spr.__int_angle);
int x = actor->int_pos().X;
int y = actor->int_pos().Y;
int z = actor->int_pos().Z;
@ -184,7 +184,7 @@ static void beastThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
{
if (pXSector && pXSector->Underwater)
aiNewState(actor, &beastSwimSearch);
@ -238,7 +238,7 @@ static void beastThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector()))
{
@ -335,7 +335,7 @@ static void beastThinkSwimGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
aiNewState(actor, &beastSwimSearch);
aiThinkTarget(actor);
}
@ -368,7 +368,7 @@ static void beastThinkSwimChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = pDudeInfo->eyeHeight + actor->int_pos().Z;
int top, bottom;
GetActorExtents(actor, &top, &bottom);
@ -398,9 +398,9 @@ static void beastMoveForward(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
if (abs(nAng) > 341)
return;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
@ -408,29 +408,29 @@ static void beastMoveForward(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= 0x400 && Random(64) < 32)
return;
actor->vel.X += MulScale(pDudeInfo->frontSpeed, Cos(actor->spr.ang), 30);
actor->vel.Y += MulScale(pDudeInfo->frontSpeed, Sin(actor->spr.ang), 30);
actor->vel.X += MulScale(pDudeInfo->frontSpeed, Cos(actor->spr.__int_angle), 30);
actor->vel.Y += MulScale(pDudeInfo->frontSpeed, Sin(actor->spr.__int_angle), 30);
}
static void sub_628A0(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->spr.ang = (actor->spr.ang + 256) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + 256) & 2047;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);
if (Random(64) < 32 && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -451,13 +451,13 @@ static void sub_62AE0(DBloodActor* actor)
auto target = actor->GetTarget();
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->xspr.goalAng = (actor->spr.ang + 512) & 2047;
actor->xspr.goalAng = (actor->spr.__int_angle + 512) & 2047;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
@ -466,8 +466,8 @@ static void sub_62AE0(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x600) && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -486,13 +486,13 @@ static void sub_62D7C(DBloodActor* actor)
auto target = actor->GetTarget();
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->spr.ang = (actor->spr.ang + 512) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + 512) & 2047;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
@ -501,8 +501,8 @@ static void sub_62D7C(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x4000) && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);

View file

@ -77,8 +77,8 @@ void eelBiteSeqCallback(int, DBloodActor* actor)
}
auto target = actor->GetTarget();
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type);
@ -120,7 +120,7 @@ static void eelThinkTarget(DBloodActor* actor)
continue;
if (!cansee(x, y, z, pSector, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - ((pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2), actor->sector()))
continue;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
pDudeExtraE->thinkTime = 0;
@ -155,7 +155,7 @@ static void eelThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
aiNewState(actor, &eelSearch);
eelThinkTarget(actor);
}
@ -182,7 +182,7 @@ static void eelThinkPonder(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
int height2 = (getDudeInfo(target->spr.type)->eyeHeight * target->spr.yrepeat) << 2;
int top, bottom;
@ -217,11 +217,11 @@ static void eelMoveDodgeUp(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int dx = actor->vel.X;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
@ -240,13 +240,13 @@ static void eelMoveDodgeDown(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
if (actor->xspr.dodgeDir == 0)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int dx = actor->vel.X;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
@ -288,7 +288,7 @@ static void eelThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
int top, bottom;
GetActorExtents(actor, &top, &bottom);
@ -320,21 +320,21 @@ static void eelMoveForward(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2;
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->spr.ang = (actor->spr.ang + 256) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + 256) & 2047;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);
if (nDist <= 0x399)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -351,9 +351,9 @@ static void eelMoveSwoop(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2;
if (abs(nAng) > 341)
return;
@ -362,8 +362,8 @@ static void eelMoveSwoop(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x8000) && nDist <= 0x399)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -378,9 +378,9 @@ static void eelMoveAscend(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2;
if (abs(nAng) > 341)
return;
@ -389,8 +389,8 @@ static void eelMoveAscend(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x4000) && nDist <= 0x399)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);

View file

@ -89,7 +89,7 @@ static void burnThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
{
switch (actor->spr.type)
{
@ -193,7 +193,7 @@ static void burnThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector()))
{

View file

@ -59,8 +59,8 @@ AISTATE tinycaleb139698 = { kAiStateOther, 8, -1, 120, NULL, aiMoveTurn, NULL, &
void SeqAttackCallback(int, DBloodActor* actor)
{
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
int dz = actor->dudeSlope;
dx += Random2(1500);
dy += Random2(1500);
@ -99,7 +99,7 @@ static void calebThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
{
if (pXSector && pXSector->Underwater)
aiNewState(actor, &tinycalebSwimSearch);
@ -151,7 +151,7 @@ static void calebThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector()))
{
@ -217,7 +217,7 @@ static void calebThinkSwimGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
aiNewState(actor, &tinycalebSwimSearch);
aiThinkTarget(actor);
}
@ -249,7 +249,7 @@ static void calebThinkSwimChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = pDudeInfo->eyeHeight + actor->int_pos().Z;
int top, bottom;
GetActorExtents(actor, &top, &bottom);
@ -276,21 +276,21 @@ static void sub_65D04(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->spr.ang = (actor->spr.ang + 256) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + 256) & 2047;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);
if (Random(64) < 32 && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -312,13 +312,13 @@ static void sub_65F44(DBloodActor* actor)
auto target = actor->GetTarget();
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->xspr.goalAng = (actor->spr.ang + 512) & 2047;
actor->xspr.goalAng = (actor->spr.__int_angle + 512) & 2047;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
@ -327,8 +327,8 @@ static void sub_65F44(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x600) && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -348,13 +348,13 @@ static void sub_661E0(DBloodActor* actor)
auto target = actor->GetTarget();
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->spr.ang = (actor->spr.ang + 512) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + 512) & 2047;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
@ -363,8 +363,8 @@ static void sub_661E0(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x4000) && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);

View file

@ -57,8 +57,8 @@ AISTATE cerberus1398AC = { kAiStateOther, 7, -1, 120, NULL, aiMoveTurn, NULL, &c
void cerberusBiteSeqCallback(int, DBloodActor* actor)
{
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) {
Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax");
return;
@ -82,8 +82,8 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor)
int z = height; // ???
TARGETTRACK tt1 = { 0x10000, 0x10000, 0x100, 0x55, 0x1aaaaa };
Aim aim;
aim.dx = bcos(actor->spr.ang);
aim.dy = bsin(actor->spr.ang);
aim.dx = bcos(actor->spr.__int_angle);
aim.dy = bsin(actor->spr.__int_angle);
aim.dz = actor->dudeSlope;
int nClosest = 0x7fffffff;
BloodStatIterator it(kStatDude);
@ -104,8 +104,8 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor)
y2 += (actor2->vel.Y * t) >> 12;
z2 += (actor2->vel.Z * t) >> 8;
}
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
int ty = y + MulScale(Sin(actor->spr.ang), nDist, 30);
int tx = x + MulScale(Cos(actor->spr.__int_angle), nDist, 30);
int ty = y + MulScale(Sin(actor->spr.__int_angle), nDist, 30);
int tz = z + MulScale(actor->dudeSlope, nDist, 10);
int tsr = MulScale(9460, nDist, 10);
int top, bottom;
@ -119,7 +119,7 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor)
if (nDist2 < nClosest)
{
int nAngle = getangle(x2 - x, y2 - y);
int nDeltaAngle = ((nAngle - actor->spr.ang + 1024) & 2047) - 1024;
int nDeltaAngle = ((nAngle - actor->spr.__int_angle + 1024) & 2047) - 1024;
if (abs(nDeltaAngle) <= tt1.at8)
{
int tz1 = actor2->int_pos().Z - actor->int_pos().Z;
@ -158,8 +158,8 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor)
TARGETTRACK tt1 = { 0x10000, 0x10000, 0x100, 0x55, 0x1aaaaa };
Aim aim;
int ax, ay, az;
aim.dx = ax = bcos(actor->spr.ang);
aim.dy = ay = bsin(actor->spr.ang);
aim.dx = ax = bcos(actor->spr.__int_angle);
aim.dy = ay = bsin(actor->spr.__int_angle);
aim.dz = actor->dudeSlope;
az = 0;
int nClosest = 0x7fffffff;
@ -181,8 +181,8 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor)
y2 += (actor->vel.Y * t) >> 12;
z2 += (actor->vel.Z * t) >> 8;
}
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
int ty = y + MulScale(Sin(actor->spr.ang), nDist, 30);
int tx = x + MulScale(Cos(actor->spr.__int_angle), nDist, 30);
int ty = y + MulScale(Sin(actor->spr.__int_angle), nDist, 30);
int tz = z + MulScale(actor->dudeSlope, nDist, 10);
int tsr = MulScale(9460, nDist, 10);
int top, bottom;
@ -196,7 +196,7 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor)
if (nDist2 < nClosest)
{
int nAngle = getangle(x2 - x, y2 - y);
int nDeltaAngle = ((nAngle - actor->spr.ang + 1024) & 2047) - 1024;
int nDeltaAngle = ((nAngle - actor->spr.__int_angle + 1024) & 2047) - 1024;
if (abs(nDeltaAngle) <= tt1.at8)
{
DUDEINFO* pDudeInfo2 = getDudeInfo(actor2->spr.type);
@ -269,7 +269,7 @@ static void cerberusThinkTarget(DBloodActor* actor)
continue;
if (!cansee(x, y, z, pSector, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - ((pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2), actor->sector()))
continue;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
pDudeExtraE->thinkTime = 0;
@ -301,7 +301,7 @@ static void cerberusThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
{
switch (actor->spr.type) {
case kDudeCerberusTwoHead:
@ -371,7 +371,7 @@ static void cerberusThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector()))
{

View file

@ -75,8 +75,8 @@ AISTATE cultistSwimRecoil = { kAiStateRecoil, 5, -1, 0, NULL, NULL, NULL, &culti
void TommySeqCallback(int, DBloodActor* actor)
{
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
int dz = actor->dudeSlope;
dx += Random3((5 - gGameOptions.nDifficulty) * 1000);
dy += Random3((5 - gGameOptions.nDifficulty) * 1000);
@ -89,8 +89,8 @@ void TeslaSeqCallback(int, DBloodActor* actor)
{
if (Chance(gCultTeslaFireChance[gGameOptions.nDifficulty]))
{
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
int dz = actor->dudeSlope;
dx += Random3((5 - gGameOptions.nDifficulty) * 1000);
dy += Random3((5 - gGameOptions.nDifficulty) * 1000);
@ -102,8 +102,8 @@ void TeslaSeqCallback(int, DBloodActor* actor)
void ShotSeqCallback(int, DBloodActor* actor)
{
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
int dz = actor->dudeSlope;
dx += Random2((5 - gGameOptions.nDifficulty) * 1000 - 500);
dy += Random2((5 - gGameOptions.nDifficulty) * 1000 - 500);
@ -199,7 +199,7 @@ static void cultThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 5120 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 5120 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
{
switch (actor->xspr.medium)
{
@ -273,7 +273,7 @@ static void cultThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist > 0 && nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector()))
{

View file

@ -84,8 +84,8 @@ void SlashFSeqCallback(int, DBloodActor* actor)
int height = (actor->spr.yrepeat * pDudeInfo->eyeHeight) << 2;
int height2 = (target->spr.yrepeat * pDudeInfoT->eyeHeight) << 2;
int dz = height - height2;
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
actFireVector(actor, 0, 0, dx, dy, dz, kVectorGargSlash);
int r1 = Random(50);
int r2 = Random(50);
@ -111,8 +111,8 @@ void BlastSSeqCallback(int, DBloodActor* actor)
int z = height;
TARGETTRACK tt = { 0x10000, 0x10000, 0x100, 0x55, 0x1aaaaa };
Aim aim;
aim.dx = bcos(actor->spr.ang);
aim.dy = bsin(actor->spr.ang);
aim.dx = bcos(actor->spr.__int_angle);
aim.dy = bsin(actor->spr.__int_angle);
aim.dz = actor->dudeSlope;
int nClosest = 0x7fffffff;
BloodStatIterator it(kStatDude);
@ -133,8 +133,8 @@ void BlastSSeqCallback(int, DBloodActor* actor)
y2 += (actor->vel.Y * t) >> 12;
z2 += (actor->vel.Z * t) >> 8;
}
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
int ty = y + MulScale(Sin(actor->spr.ang), nDist, 30);
int tx = x + MulScale(Cos(actor->spr.__int_angle), nDist, 30);
int ty = y + MulScale(Sin(actor->spr.__int_angle), nDist, 30);
int tz = z + MulScale(actor->dudeSlope, nDist, 10);
int tsr = MulScale(9460, nDist, 10);
int top, bottom;
@ -148,7 +148,7 @@ void BlastSSeqCallback(int, DBloodActor* actor)
if (nDist2 < nClosest)
{
int nAngle = getangle(x2 - x, y2 - y);
int nDeltaAngle = ((nAngle - actor->spr.ang + 1024) & 2047) - 1024;
int nDeltaAngle = ((nAngle - actor->spr.__int_angle + 1024) & 2047) - 1024;
if (abs(nDeltaAngle) <= tt.at8)
{
int tz1 = actor2->int_pos().Z - actor->int_pos().Z;
@ -229,7 +229,7 @@ static void gargThinkTarget(DBloodActor* actor)
continue;
if (!cansee(x, y, z, pSector, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - ((pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2), actor->sector()))
continue;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
pDudeExtraE->thinkTime = 0;
@ -267,7 +267,7 @@ static void gargThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
aiNewState(actor, &gargoyleFSearch);
aiThinkTarget(actor);
}
@ -279,11 +279,11 @@ static void gargMoveDodgeUp(DBloodActor* actor)
return;
}
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int dx = actor->vel.X;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
@ -305,13 +305,13 @@ static void gargMoveDodgeDown(DBloodActor* actor)
return;
}
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
if (actor->xspr.dodgeDir == 0)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int dx = actor->vel.X;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
@ -357,7 +357,7 @@ static void gargThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
// Should be dudeInfo[target->spr.type-kDudeBase]
int height2 = (pDudeInfo->eyeHeight * target->spr.yrepeat) << 2;
@ -523,21 +523,21 @@ static void gargMoveForward(DBloodActor* actor)
return;
}
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->spr.ang = (actor->spr.ang + 256) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + 256) & 2047;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);
if ((unsigned int)Random(64) < 32 && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -557,13 +557,13 @@ static void gargMoveSlow(DBloodActor* actor)
return;
}
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->xspr.goalAng = (actor->spr.ang + 512) & 2047;
actor->xspr.goalAng = (actor->spr.__int_angle + 512) & 2047;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
@ -571,8 +571,8 @@ static void gargMoveSlow(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x600) && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -598,13 +598,13 @@ static void gargMoveSwoop(DBloodActor* actor)
return;
}
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->xspr.goalAng = (actor->spr.ang + 512) & 2047;
actor->xspr.goalAng = (actor->spr.__int_angle + 512) & 2047;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
@ -612,8 +612,8 @@ static void gargMoveSwoop(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x600) && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -638,13 +638,13 @@ static void gargMoveFly(DBloodActor* actor)
return;
}
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->spr.ang = (actor->spr.ang + 512) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + 512) & 2047;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
@ -652,8 +652,8 @@ static void gargMoveFly(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x4000) && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);

View file

@ -69,8 +69,8 @@ void ghostSlashSeqCallback(int, DBloodActor* actor)
int height = (actor->spr.yrepeat * pDudeInfo->eyeHeight) << 2;
int height2 = (target->spr.yrepeat * pDudeInfoT->eyeHeight) << 2;
int dz = height - height2;
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
sfxPlay3DSound(actor, 1406, 0, 0);
actFireVector(actor, 0, 0, dx, dy, dz, kVectorGhost);
int r1 = Random(50);
@ -97,8 +97,8 @@ void ghostBlastSeqCallback(int, DBloodActor* actor)
int z = height;
TARGETTRACK tt = { 0x10000, 0x10000, 0x100, 0x55, 0x1aaaaa };
Aim aim;
aim.dx = bcos(actor->spr.ang);
aim.dy = bsin(actor->spr.ang);
aim.dx = bcos(actor->spr.__int_angle);
aim.dy = bsin(actor->spr.__int_angle);
aim.dz = actor->dudeSlope;
int nClosest = 0x7fffffff;
BloodStatIterator it(kStatDude);
@ -119,8 +119,8 @@ void ghostBlastSeqCallback(int, DBloodActor* actor)
y2 += (actor->vel.Y * t) >> 12;
z2 += (actor->vel.Z * t) >> 8;
}
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
int ty = y + MulScale(Sin(actor->spr.ang), nDist, 30);
int tx = x + MulScale(Cos(actor->spr.__int_angle), nDist, 30);
int ty = y + MulScale(Sin(actor->spr.__int_angle), nDist, 30);
int tz = z + MulScale(actor->dudeSlope, nDist, 10);
int tsr = MulScale(9460, nDist, 10);
int top, bottom;
@ -134,7 +134,7 @@ void ghostBlastSeqCallback(int, DBloodActor* actor)
if (nDist2 < nClosest)
{
int nAngle = getangle(x2 - x, y2 - y);
int nDeltaAngle = ((nAngle - actor->spr.ang + 1024) & 2047) - 1024;
int nDeltaAngle = ((nAngle - actor->spr.__int_angle + 1024) & 2047) - 1024;
if (abs(nDeltaAngle) <= tt.at8)
{
int tz1 = actor2->int_pos().Z - actor->int_pos().Z;
@ -209,7 +209,7 @@ static void ghostThinkTarget(DBloodActor* actor)
continue;
if (!cansee(x, y, z, pSector, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - ((pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2), actor->sector()))
continue;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
pDudeExtraE->thinkTime = 0;
@ -246,7 +246,7 @@ static void ghostThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
aiNewState(actor, &ghostSearch);
aiThinkTarget(actor);
}
@ -258,11 +258,11 @@ static void ghostMoveDodgeUp(DBloodActor* actor)
return;
}
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int dx = actor->vel.X;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
@ -284,13 +284,13 @@ static void ghostMoveDodgeDown(DBloodActor* actor)
return;
}
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
if (actor->xspr.dodgeDir == 0)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int dx = actor->vel.X;
int dy = actor->vel.Y;
int t1 = DMulScale(dx, nCos, dy, nSin, 30);
@ -336,7 +336,7 @@ static void ghostThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
// Should be dudeInfo[target->spr.type-kDudeBase]
int height2 = (pDudeInfo->eyeHeight * target->spr.yrepeat) << 2;
@ -419,21 +419,21 @@ static void ghostMoveForward(DBloodActor* actor)
return;
}
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->spr.ang = (actor->spr.ang + 256) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + 256) & 2047;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);
if ((unsigned int)Random(64) < 32 && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -453,13 +453,13 @@ static void ghostMoveSlow(DBloodActor* actor)
return;
}
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->xspr.goalAng = (actor->spr.ang + 512) & 2047;
actor->xspr.goalAng = (actor->spr.__int_angle + 512) & 2047;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
@ -467,8 +467,8 @@ static void ghostMoveSlow(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x600) && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -491,13 +491,13 @@ static void ghostMoveSwoop(DBloodActor* actor)
return;
}
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->xspr.goalAng = (actor->spr.ang + 512) & 2047;
actor->xspr.goalAng = (actor->spr.__int_angle + 512) & 2047;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
@ -505,8 +505,8 @@ static void ghostMoveSwoop(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x600) && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -528,13 +528,13 @@ static void ghostMoveFly(DBloodActor* actor)
return;
}
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->spr.ang = (actor->spr.ang + 512) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + 512) & 2047;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
@ -542,8 +542,8 @@ static void ghostMoveFly(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x4000) && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);

View file

@ -61,8 +61,8 @@ void GillBiteSeqCallback(int, DBloodActor* actor)
{
if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget();
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
int dz = actor->int_pos().Z - target->int_pos().Z;
dx += Random3(2000);
dy += Random3(2000);
@ -90,7 +90,7 @@ static void gillThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
{
if (pXSector && pXSector->Underwater)
aiNewState(actor, &gillBeastSwimSearch);
@ -139,7 +139,7 @@ static void gillThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector()))
{
@ -204,7 +204,7 @@ static void gillThinkSwimGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
aiNewState(actor, &gillBeastSwimSearch);
aiThinkTarget(actor);
}
@ -236,7 +236,7 @@ static void gillThinkSwimChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = pDudeInfo->eyeHeight + actor->int_pos().Z;
int top, bottom;
GetActorExtents(actor, &top, &bottom);
@ -266,21 +266,21 @@ static void sub_6CB00(DBloodActor* actor)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2;
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->spr.ang = (actor->spr.ang + 256) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + 256) & 2047;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);
if (Random(64) < 32 && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -301,13 +301,13 @@ static void sub_6CD74(DBloodActor* actor)
auto target = actor->GetTarget();
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2;
if (abs(nAng) > 341)
{
actor->xspr.goalAng = (actor->spr.ang + 512) & 2047;
actor->xspr.goalAng = (actor->spr.__int_angle + 512) & 2047;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
@ -316,8 +316,8 @@ static void sub_6CD74(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x600) && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -336,13 +336,13 @@ static void sub_6D03C(DBloodActor* actor)
auto target = actor->GetTarget();
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2;
if (abs(nAng) > 341)
{
actor->spr.ang = (actor->spr.ang + 512) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + 512) & 2047;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
@ -351,8 +351,8 @@ static void sub_6D03C(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (Chance(0x4000) && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);

View file

@ -71,7 +71,7 @@ static void handThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
aiNewState(actor, &handSearch);
aiThinkTarget(actor);
}
@ -104,7 +104,7 @@ static void handThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector()))
{

View file

@ -44,8 +44,8 @@ AISTATE houndBurn = { kAiStateChase, 7, nHoundBurnClient, 60, NULL, NULL, NULL,
void houndBiteSeqCallback(int, DBloodActor* actor)
{
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) {
Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax");
return;
@ -64,7 +64,7 @@ void houndBiteSeqCallback(int, DBloodActor* actor)
void houndBurnSeqCallback(int, DBloodActor* actor)
{
actFireMissile(actor, 0, 0, bcos(actor->spr.ang), bsin(actor->spr.ang), 0, kMissileFlameHound);
actFireMissile(actor, 0, 0, bcos(actor->spr.__int_angle), bsin(actor->spr.__int_angle), 0, kMissileFlameHound);
}
static void houndThinkSearch(DBloodActor* actor)
@ -86,7 +86,7 @@ static void houndThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
aiNewState(actor, &houndSearch);
aiThinkTarget(actor);
}
@ -121,7 +121,7 @@ static void houndThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector()))
{

View file

@ -55,7 +55,7 @@ static void innocThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
aiNewState(actor, &innocentSearch);
aiThinkTarget(actor);
}
@ -88,7 +88,7 @@ static void innocThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector()))
{

View file

@ -144,7 +144,7 @@ static void aiPodMove(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery) {
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery) {
switch (actor->spr.type) {
case kDudePodGreen:
case kDudePodFire:
@ -201,7 +201,7 @@ static void aiPodChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector()))
{

View file

@ -43,8 +43,8 @@ AISTATE ratBite = { kAiStateChase, 6, nRatBiteClient, 120, NULL, NULL, NULL, &ra
void ratBiteSeqCallback(int, DBloodActor* actor)
{
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget();
@ -67,7 +67,7 @@ static void ratThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
aiNewState(actor, &ratSearch);
aiThinkTarget(actor);
}
@ -99,7 +99,7 @@ static void ratThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector()))
{

View file

@ -59,8 +59,8 @@ static void spidBlindEffect(DBloodActor* actor, int nBlind, int max)
void SpidBiteSeqCallback(int, DBloodActor* actor)
{
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
dx += Random2(2000);
dy += Random2(2000);
int dz = Random2(2000);
@ -107,8 +107,8 @@ void SpidBiteSeqCallback(int, DBloodActor* actor)
void SpidJumpSeqCallback(int, DBloodActor* actor)
{
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
dx += Random2(200);
dy += Random2(200);
int dz = Random2(200);
@ -144,11 +144,11 @@ void SpidBirthSeqCallback(int, DBloodActor* actor)
DBloodActor* spawned = nullptr;
if (target->IsPlayerActor() && pDudeExtraE->birthCounter < 10)
{
if (nDist < 0x1a00 && nDist > 0x1400 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 0x1a00 && nDist > 0x1400 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
spawned = actSpawnDude(actor, kDudeSpiderRed, actor->spr.clipdist, 0);
else if (nDist < 0x1400 && nDist > 0xc00 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
else if (nDist < 0x1400 && nDist > 0xc00 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
spawned = actSpawnDude(actor, kDudeSpiderBrown, actor->spr.clipdist, 0);
else if (nDist < 0xc00 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
else if (nDist < 0xc00 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
spawned = actSpawnDude(actor, kDudeSpiderBrown, actor->spr.clipdist, 0);
if (spawned)
@ -176,7 +176,7 @@ static void spidThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
aiNewState(actor, &spidSearch);
aiThinkTarget(actor);
}
@ -207,7 +207,7 @@ static void spidThinkChase(DBloodActor* actor)
}
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist) {
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector())) {

View file

@ -66,8 +66,8 @@ void sub_71BD4(int, DBloodActor* actor)
int z = height;
TARGETTRACK tt = { 0x10000, 0x10000, 0x100, 0x55, 0x100000 };
Aim aim;
aim.dx = bcos(actor->spr.ang);
aim.dy = bsin(actor->spr.ang);
aim.dx = bcos(actor->spr.__int_angle);
aim.dy = bsin(actor->spr.__int_angle);
aim.dz = actor->dudeSlope;
int nClosest = 0x7fffffff;
BloodStatIterator it(kStatDude);
@ -88,8 +88,8 @@ void sub_71BD4(int, DBloodActor* actor)
y2 += (actor->vel.Y * t) >> 12;
z2 += (actor->vel.Z * t) >> 8;
}
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
int ty = y + MulScale(Sin(actor->spr.ang), nDist, 30);
int tx = x + MulScale(Cos(actor->spr.__int_angle), nDist, 30);
int ty = y + MulScale(Sin(actor->spr.__int_angle), nDist, 30);
int tz = z + MulScale(actor->dudeSlope, nDist, 10);
int tsr = MulScale(9460, nDist, 10);
int top, bottom;
@ -103,7 +103,7 @@ void sub_71BD4(int, DBloodActor* actor)
if (nDist2 < nClosest)
{
int nAngle = getangle(x2 - x, y2 - y);
int nDeltaAngle = ((nAngle - actor->spr.ang + 1024) & 2047) - 1024;
int nDeltaAngle = ((nAngle - actor->spr.__int_angle + 1024) & 2047) - 1024;
if (abs(nDeltaAngle) <= tt.at8)
{
int tz1 = actor2->int_pos().Z - actor->int_pos().Z;
@ -130,8 +130,8 @@ void sub_720AC(int, DBloodActor* actor)
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int height = actor->spr.yrepeat * pDudeInfo->eyeHeight;
int ax, ay, az;
ax = bcos(actor->spr.ang);
ay = bsin(actor->spr.ang);
ax = bcos(actor->spr.__int_angle);
ay = bsin(actor->spr.__int_angle);
int x = actor->int_pos().X;
int y = actor->int_pos().Y;
int z = height;
@ -160,8 +160,8 @@ void sub_720AC(int, DBloodActor* actor)
y2 += (actor->vel.Y * t) >> 12;
z2 += (actor->vel.Z * t) >> 8;
}
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
int ty = y + MulScale(Sin(actor->spr.ang), nDist, 30);
int tx = x + MulScale(Cos(actor->spr.__int_angle), nDist, 30);
int ty = y + MulScale(Sin(actor->spr.__int_angle), nDist, 30);
int tz = z + MulScale(actor->dudeSlope, nDist, 10);
int tsr = MulScale(9460, nDist, 10);
int top, bottom;
@ -175,7 +175,7 @@ void sub_720AC(int, DBloodActor* actor)
if (nDist2 < nClosest)
{
int nAngle = getangle(x2 - x, y2 - y);
int nDeltaAngle = ((nAngle - actor->spr.ang + 1024) & 2047) - 1024;
int nDeltaAngle = ((nAngle - actor->spr.__int_angle + 1024) & 2047) - 1024;
if (abs(nDeltaAngle) <= tt.at8)
{
int tz1 = actor2->int_pos().Z - actor->int_pos().Z;
@ -236,7 +236,7 @@ static void sub_725A4(DBloodActor* actor)
continue;
if (!cansee(x, y, z, pSector, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - ((pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2), actor->sector()))
continue;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
pDudeExtraE->thinkTime = 0;
@ -268,7 +268,7 @@ static void sub_72850(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
aiNewState(actor, &tchernobogSearch);
aiThinkTarget(actor);
}
@ -304,7 +304,7 @@ static void sub_72934(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector()))
{

View file

@ -139,7 +139,7 @@ static bool genDudeAdjustSlope(DBloodActor* actor, int dist, int weaponType, int
for (int i = -8191; i < 8192; i += by)
{
HitScan(actor, actor->int_pos().Z, bcos(actor->spr.ang), bsin(actor->spr.ang), i, clipMask, dist);
HitScan(actor, actor->int_pos().Z, bcos(actor->spr.__int_angle), bsin(actor->spr.__int_angle), i, clipMask, dist);
if (!fStart && actor->GetTarget() == gHitInfo.actor()) fStart = i;
else if (fStart && actor->GetTarget() != gHitInfo.actor())
{
@ -198,8 +198,8 @@ void punchCallback(int, DBloodActor* actor)
if (target->IsDudeActor())
nZOffset2 = getDudeInfo(target->spr.type)->eyeHeight * target->spr.yrepeat << 2;
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
int dz = nZOffset1 - nZOffset2;
if (!playGenDudeSound(actor, kGenDudeSndAttackMelee))
@ -229,7 +229,7 @@ void genDudeAttack1(int, DBloodActor* actor)
if (pExtra->weaponType == kGenDudeWeaponHitscan)
{
dx = bcos(actor->spr.ang); dy = bsin(actor->spr.ang); dz = actor->dudeSlope;
dx = bcos(actor->spr.__int_angle); dy = bsin(actor->spr.__int_angle); dz = actor->dudeSlope;
// dispersal modifiers here in case if non-melee enemy
if (!dudeIsMelee(actor))
{
@ -266,7 +266,7 @@ void genDudeAttack1(int, DBloodActor* actor)
}
else if (pExtra->weaponType == kGenDudeWeaponMissile)
{
dx = bcos(actor->spr.ang); dy = bsin(actor->spr.ang); dz = actor->dudeSlope;
dx = bcos(actor->spr.__int_angle); dy = bsin(actor->spr.__int_angle); dz = actor->dudeSlope;
// dispersal modifiers here
dx += Random3(dispersion); dy += Random3(dispersion); dz += Random3(dispersion >> 1);
@ -426,7 +426,7 @@ static void unicultThinkGoto(DBloodActor* actor)
aiChooseDirection(actor, nAngle);
// if reached target, change to search mode
if (approxDist(dx, dy) < 5120 && abs(actor->spr.ang - nAngle) < getDudeInfo(actor->spr.type)->periphery)
if (approxDist(dx, dy) < 5120 && abs(actor->spr.__int_angle - nAngle) < getDudeInfo(actor->spr.type)->periphery)
{
if (spriteIsUnderwater(actor, false)) aiGenDudeNewState(actor, &genDudeSearchW);
else aiGenDudeNewState(actor, &genDudeSearchL);
@ -516,7 +516,7 @@ static void unicultThinkChase(DBloodActor* actor)
}
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
int losAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int losAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int eyeAboveZ = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (dist > pDudeInfo->seeDist || !cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(),
@ -744,9 +744,9 @@ static void unicultThinkChase(DBloodActor* actor)
{
int objDist = -1; int targetDist = -1; int hit = -1;
if (weaponType == kGenDudeWeaponHitscan)
hit = HitScan(actor, actor->int_pos().Z, bcos(actor->spr.ang), bsin(actor->spr.ang), actor->dudeSlope, CLIPMASK1, dist);
hit = HitScan(actor, actor->int_pos().Z, bcos(actor->spr.__int_angle), bsin(actor->spr.__int_angle), actor->dudeSlope, CLIPMASK1, dist);
else if (weaponType == kGenDudeWeaponMissile)
hit = HitScan(actor, actor->int_pos().Z, bcos(actor->spr.ang), bsin(actor->spr.ang), actor->dudeSlope, CLIPMASK0, dist);
hit = HitScan(actor, actor->int_pos().Z, bcos(actor->spr.__int_angle), bsin(actor->spr.__int_angle), actor->dudeSlope, CLIPMASK0, dist);
if (hit >= 0)
{
@ -859,7 +859,7 @@ static void unicultThinkChase(DBloodActor* actor)
else if (weaponType == kGenDudeWeaponHitscan && hscn)
{
if (genDudeAdjustSlope(actor, dist, weaponType)) break;
VectorScan(actor, 0, 0, bcos(actor->spr.ang), bsin(actor->spr.ang), actor->dudeSlope, dist, 1);
VectorScan(actor, 0, 0, bcos(actor->spr.__int_angle), bsin(actor->spr.__int_angle), actor->dudeSlope, dist, 1);
if (actor == gHitInfo.actor()) break;
bool immune = nnExtIsImmune(hitactor, gVectorData[curWeapon].dmgType);
@ -919,7 +919,7 @@ static void unicultThinkChase(DBloodActor* actor)
if (hit == 4 && weaponType == kGenDudeWeaponHitscan && hscn)
{
bool masked = (pHWall->cstat & CSTAT_WALL_MASKED);
if (masked) VectorScan(actor, 0, 0, bcos(actor->spr.ang), bsin(actor->spr.ang), actor->dudeSlope, dist, 1);
if (masked) VectorScan(actor, 0, 0, bcos(actor->spr.__int_angle), bsin(actor->spr.__int_angle), actor->dudeSlope, dist, 1);
if ((actor != gHitInfo.actor()) && (pHWall->type != kWallGib || !masked || pXHWall == NULL || !pXHWall->triggerVector || pXHWall->locked))
{
@ -1114,21 +1114,21 @@ void aiGenDudeMoveForward(DBloodActor* actor)
if (pExtra->canFly)
{
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->spr.ang = (actor->spr.ang + 256) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + 256) & 2047;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);
if ((unsigned int)Random(64) < 32 && nDist <= 0x400)
return;
int nCos = Cos(actor->spr.ang);
int nSin = Sin(actor->spr.ang);
int nCos = Cos(actor->spr.__int_angle);
int nSin = Sin(actor->spr.__int_angle);
int vx = actor->vel.X;
int vy = actor->vel.Y;
int t1 = DMulScale(vx, nCos, vy, nSin, 30);
@ -1142,15 +1142,15 @@ void aiGenDudeMoveForward(DBloodActor* actor)
}
else
{
int dang = ((kAng180 + actor->xspr.goalAng - actor->spr.ang) & 2047) - kAng180;
actor->spr.ang = ((actor->spr.ang + ClipRange(dang, -maxTurn, maxTurn)) & 2047);
int dang = ((kAng180 + actor->xspr.goalAng - actor->spr.__int_angle) & 2047) - kAng180;
actor->spr.__int_angle = ((actor->spr.__int_angle + ClipRange(dang, -maxTurn, maxTurn)) & 2047);
// don't move forward if trying to turn around
if (abs(dang) > kAng60)
return;
int sin = Sin(actor->spr.ang);
int cos = Cos(actor->spr.ang);
int sin = Sin(actor->spr.__int_angle);
int cos = Cos(actor->spr.__int_angle);
int frontSpeed = actor->genDudeExtra.moveSpeed;
actor->vel.X += MulScale(cos, frontSpeed, 30);
@ -1174,31 +1174,31 @@ void aiGenDudeChooseDirection(DBloodActor* actor, int a3, int xvel, int yvel)
// TO-DO: Take in account if sprite is flip-x, so enemy select correct angle
int vc = ((a3 + 1024 - actor->spr.ang) & 2047) - 1024;
int t1 = DMulScale(xvel, Cos(actor->spr.ang), yvel, Sin(actor->spr.ang), 30);
int vc = ((a3 + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int t1 = DMulScale(xvel, Cos(actor->spr.__int_angle), yvel, Sin(actor->spr.__int_angle), 30);
int vsi = ((t1 * 15) >> 12) / 2; int v8 = (vc >= 0) ? 341 : -341;
if (CanMove(actor, actor->GetTarget(), actor->spr.ang + vc, vsi))
actor->xspr.goalAng = actor->spr.ang + vc;
else if (CanMove(actor, actor->GetTarget(), actor->spr.ang + vc / 2, vsi))
actor->xspr.goalAng = actor->spr.ang + vc / 2;
else if (CanMove(actor, actor->GetTarget(), actor->spr.ang - vc / 2, vsi))
actor->xspr.goalAng = actor->spr.ang - vc / 2;
else if (CanMove(actor, actor->GetTarget(), actor->spr.ang + v8, vsi))
actor->xspr.goalAng = actor->spr.ang + v8;
else if (CanMove(actor, actor->GetTarget(), actor->spr.ang, vsi))
actor->xspr.goalAng = actor->spr.ang;
else if (CanMove(actor, actor->GetTarget(), actor->spr.ang - v8, vsi))
actor->xspr.goalAng = actor->spr.ang - v8;
if (CanMove(actor, actor->GetTarget(), actor->spr.__int_angle + vc, vsi))
actor->xspr.goalAng = actor->spr.__int_angle + vc;
else if (CanMove(actor, actor->GetTarget(), actor->spr.__int_angle + vc / 2, vsi))
actor->xspr.goalAng = actor->spr.__int_angle + vc / 2;
else if (CanMove(actor, actor->GetTarget(), actor->spr.__int_angle - vc / 2, vsi))
actor->xspr.goalAng = actor->spr.__int_angle - vc / 2;
else if (CanMove(actor, actor->GetTarget(), actor->spr.__int_angle + v8, vsi))
actor->xspr.goalAng = actor->spr.__int_angle + v8;
else if (CanMove(actor, actor->GetTarget(), actor->spr.__int_angle, vsi))
actor->xspr.goalAng = actor->spr.__int_angle;
else if (CanMove(actor, actor->GetTarget(), actor->spr.__int_angle - v8, vsi))
actor->xspr.goalAng = actor->spr.__int_angle - v8;
else
actor->xspr.goalAng = actor->spr.ang + 341;
actor->xspr.goalAng = actor->spr.__int_angle + 341;
actor->xspr.dodgeDir = (Chance(0x8000)) ? 1 : -1;
if (!CanMove(actor, actor->GetTarget(), actor->spr.ang + actor->xspr.dodgeDir * 512, 512))
if (!CanMove(actor, actor->GetTarget(), actor->spr.__int_angle + actor->xspr.dodgeDir * 512, 512))
{
actor->xspr.dodgeDir = -actor->xspr.dodgeDir;
if (!CanMove(actor, actor->GetTarget(), actor->spr.ang + actor->xspr.dodgeDir * 512, 512))
if (!CanMove(actor, actor->GetTarget(), actor->spr.__int_angle + actor->xspr.dodgeDir * 512, 512))
actor->xspr.dodgeDir = 0;
}
}
@ -1404,7 +1404,7 @@ void removeLeech(DBloodActor* actLeech, bool delSprite)
{
if (actLeech != nullptr)
{
auto effectactor = gFX.fxSpawnActor((FX_ID)52, actLeech->sector(), actLeech->int_pos().X, actLeech->int_pos().Y, actLeech->int_pos().Z, actLeech->spr.ang);
auto effectactor = gFX.fxSpawnActor((FX_ID)52, actLeech->sector(), actLeech->int_pos().X, actLeech->int_pos().Y, actLeech->int_pos().Z, actLeech->spr.__int_angle);
if (effectactor != nullptr)
{
effectactor->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FACING;
@ -1800,10 +1800,10 @@ void dudeLeechOperate(DBloodActor* actor, const EVENT& event)
int t = DivScale(nDist, 0x1aaaaa, 12);
x += (actTarget->vel.X * t) >> 12;
y += (actTarget->vel.Y * t) >> 12;
int angBak = actor->spr.ang;
actor->spr.ang = getangle(x - actor->int_pos().X, y - actor->int_pos().Y);
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int angBak = actor->spr.__int_angle;
actor->spr.__int_angle = getangle(x - actor->int_pos().X, y - actor->int_pos().Y);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
int tz = actTarget->int_pos().Z - (actTarget->spr.yrepeat * pDudeInfo->aimHeight) * 4;
int dz = DivScale(tz - top - 256, nDist, 10);
int nMissileType = kMissileLifeLeechAltNormal + (actor->xspr.data3 ? 1 : 0);
@ -1820,7 +1820,7 @@ void dudeLeechOperate(DBloodActor* actor, const EVENT& event)
evPostActor(actor, t2, kCallbackLeechStateTimer);
actor->xspr.data3 = ClipLow(actor->xspr.data3 - 1, 0);
}
actor->spr.ang = angBak;
actor->spr.__int_angle = angBak;
}
}
@ -1875,7 +1875,7 @@ bool doExplosion(DBloodActor* actor, int nType)
DBloodActor* genDudeSpawn(DBloodActor* source, DBloodActor* actor, int nDist)
{
auto spawned = actSpawnSprite(actor, kStatDude);
int x, y, z = actor->int_pos().Z, nAngle = actor->spr.ang, nType = kDudeModernCustom;
int x, y, z = actor->int_pos().Z, nAngle = actor->spr.__int_angle, nType = kDudeModernCustom;
if (nDist > 0)
{
@ -1891,7 +1891,7 @@ DBloodActor* genDudeSpawn(DBloodActor* source, DBloodActor* actor, int nDist)
}
spawned->spr.type = nType; spawned->spr.ang = nAngle;
spawned->spr.type = nType; spawned->spr.__int_angle = nAngle;
vec3_t pos = { x, y, z };
SetActor(spawned, &pos);
spawned->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL | CSTAT_SPRITE_BLOOD_BIT1;

View file

@ -96,7 +96,7 @@ static void zombaThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 921 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 921 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
aiNewState(actor, &zombieASearch);
aiThinkTarget(actor);
}
@ -133,7 +133,7 @@ static void zombaThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector()))
{
@ -179,7 +179,7 @@ static void zombaThinkPonder(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector()))
{
@ -223,7 +223,7 @@ static void myThinkTarget(DBloodActor* actor)
continue;
if (!cansee(x, y, z, pSector, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - ((pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2), actor->sector()))
continue;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
aiSetTarget(actor, pPlayer->actor);
@ -266,7 +266,7 @@ static void entryAIdle(DBloodActor* actor)
static void entryEStand(DBloodActor* actor)
{
sfxPlay3DSound(actor, 1100, -1, 0);
actor->spr.ang = getangle(actor->xspr.TargetPos.X - actor->int_pos().X, actor->xspr.TargetPos.Y - actor->int_pos().Y);
actor->spr.__int_angle = getangle(actor->xspr.TargetPos.X - actor->int_pos().X, actor->xspr.TargetPos.Y - actor->int_pos().Y);
}
END_BLD_NS

View file

@ -55,7 +55,7 @@ void zombfHackSeqCallback(int, DBloodActor* actor)
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat);
DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type);
int height2 = (pDudeInfoT->eyeHeight * target->spr.yrepeat);
actFireVector(actor, 0, 0, bcos(actor->spr.ang), bsin(actor->spr.ang), height - height2, kVectorCleaver);
actFireVector(actor, 0, 0, bcos(actor->spr.__int_angle), bsin(actor->spr.__int_angle), height - height2, kVectorCleaver);
}
void PukeSeqCallback(int, DBloodActor* actor)
@ -77,7 +77,7 @@ void PukeSeqCallback(int, DBloodActor* actor)
void ThrowSeqCallback(int, DBloodActor* actor)
{
actFireMissile(actor, 0, -getDudeInfo(actor->spr.type)->eyeHeight, bcos(actor->spr.ang), bsin(actor->spr.ang), 0, kMissileButcherKnife);
actFireMissile(actor, 0, -getDudeInfo(actor->spr.type)->eyeHeight, bcos(actor->spr.__int_angle), bsin(actor->spr.__int_angle), 0, kMissileButcherKnife);
}
static void zombfThinkSearch(DBloodActor* actor)
@ -95,7 +95,7 @@ static void zombfThinkGoto(DBloodActor* actor)
int nAngle = getangle(dx, dy);
int nDist = approxDist(dx, dy);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && abs(actor->spr.ang - nAngle) < pDudeInfo->periphery)
if (nDist < 512 && abs(actor->spr.__int_angle - nAngle) < pDudeInfo->periphery)
aiNewState(actor, &zombieFSearch);
aiThinkTarget(actor);
}
@ -128,7 +128,7 @@ static void zombfThinkChase(DBloodActor* actor)
int nDist = approxDist(dx, dy);
if (nDist <= pDudeInfo->seeDist)
{
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024;
int nDeltaAngle = ((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) << 2;
if (cansee(target->int_pos().X, target->int_pos().Y, target->int_pos().Z, target->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - height, actor->sector()))
{

View file

@ -101,7 +101,7 @@ tspritetype* viewInsertTSprite(tspriteArray& tsprites, sectortype* pSector, int
{
pos = parentTSprite->pos;
pTSprite->ownerActor = parentTSprite->ownerActor;
pTSprite->ang = parentTSprite->ang;
pTSprite->__int_angle = parentTSprite->__int_angle;
}
pos.X += gCameraAng.fcos() * 2;
pos.Y += gCameraAng.fsin() * 2;
@ -272,7 +272,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF
}
case kViewEffectTrail:
{
int nAng = pTSprite->ang;
int nAng = pTSprite->__int_angle;
if (pTSprite->cstat & CSTAT_SPRITE_ALIGNMENT_WALL)
{
nAng = (nAng + 512) & 2047;
@ -451,7 +451,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF
pNSprite->pal = 2;
pNSprite->xrepeat = pNSprite->yrepeat = 64;
pNSprite->cstat |= CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_YFLIP | CSTAT_SPRITE_TRANSLUCENT;
pNSprite->ang = pTSprite->ang;
pNSprite->__int_angle = pTSprite->__int_angle;
pNSprite->ownerActor = pTSprite->ownerActor;
break;
}
@ -469,7 +469,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF
pNSprite->pal = 2;
pNSprite->xrepeat = pNSprite->yrepeat = nShade;
pNSprite->cstat |= CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_TRANSLUCENT;
pNSprite->ang = pTSprite->ang;
pNSprite->__int_angle = pTSprite->__int_angle;
pNSprite->ownerActor = pTSprite->ownerActor;
break;
}
@ -507,17 +507,17 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF
auto& nVoxel = voxelIndex[nTile];
if (cl_showweapon == 2 && r_voxels && nVoxel != -1)
{
pNSprite->ang = (gView->actor->spr.ang + 512) & 2047; // always face viewer
pNSprite->__int_angle = (gView->actor->spr.__int_angle + 512) & 2047; // always face viewer
pNSprite->cstat |= CSTAT_SPRITE_ALIGNMENT_SLAB;
pNSprite->cstat &= ~CSTAT_SPRITE_YFLIP;
pNSprite->picnum = nVoxel;
if (pPlayer->curWeapon == kWeapLifeLeech) // position lifeleech behind player
{
pNSprite->add_int_x(MulScale(128, Cos(gView->actor->spr.ang), 30));
pNSprite->add_int_y(MulScale(128, Sin(gView->actor->spr.ang), 30));
pNSprite->add_int_x(MulScale(128, Cos(gView->actor->spr.__int_angle), 30));
pNSprite->add_int_y(MulScale(128, Sin(gView->actor->spr.__int_angle), 30));
}
if ((pPlayer->curWeapon == kWeapLifeLeech) || (pPlayer->curWeapon == kWeapVoodooDoll)) // make lifeleech/voodoo doll always face viewer like sprite
pNSprite->ang = (pNSprite->ang + 512) & 2047; // offset angle 90 degrees
pNSprite->__int_angle = (pNSprite->__int_angle + 512) & 2047; // offset angle 90 degrees
}
break;
}
@ -579,7 +579,7 @@ void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t
if (cl_interpolate && owneractor->interpolated && !(pTSprite->flags & 512))
{
pTSprite->pos = owneractor->interpolatedvec3(gInterpolate);
pTSprite->ang = owneractor->interpolatedang(gInterpolate);
pTSprite->__int_angle = owneractor->interpolatedang(gInterpolate);
}
int nAnim = 0;
switch (picanm[nTile].extra & 7) {
@ -610,7 +610,7 @@ void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t
}
int dX = cX - pTSprite->int_pos().X;
int dY = cY - pTSprite->int_pos().Y;
RotateVector(&dX, &dY, 128 - pTSprite->ang);
RotateVector(&dX, &dY, 128 - pTSprite->__int_angle);
nAnim = GetOctant(dX, dY);
if (nAnim <= 4)
{
@ -632,7 +632,7 @@ void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t
}
int dX = cX - pTSprite->int_pos().X;
int dY = cY - pTSprite->int_pos().Y;
RotateVector(&dX, &dY, 128 - pTSprite->ang);
RotateVector(&dX, &dY, 128 - pTSprite->__int_angle);
nAnim = GetOctant(dX, dY);
break;
}
@ -669,7 +669,7 @@ void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t
pTSprite->picnum = voxelIndex[pTSprite->picnum];
if ((picanm[nTile].extra & 7) == 7)
{
pTSprite->ang = myclock & 2047;
pTSprite->__int_angle = myclock & 2047;
}
}
}
@ -902,8 +902,8 @@ void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t
auto pNTSprite = viewAddEffect(tsprites, nTSprite, kViewEffectShoot);
if (pNTSprite) {
POSTURE* pPosture = &pPlayer->pPosture[pPlayer->lifeMode][pPlayer->posture];
pNTSprite->add_int_x(MulScale(pPosture->zOffset, Cos(pTSprite->ang), 28));
pNTSprite->add_int_y(MulScale(pPosture->zOffset, Sin(pTSprite->ang), 28));
pNTSprite->add_int_x(MulScale(pPosture->zOffset, Cos(pTSprite->__int_angle), 28));
pNTSprite->add_int_y(MulScale(pPosture->zOffset, Sin(pTSprite->__int_angle), 28));
pNTSprite->set_int_z(pPlayer->actor->int_pos().Z - pPosture->xOffset);
}
}
@ -979,7 +979,7 @@ void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t
{
int dX = cX - pTSprite->int_pos().X;
int dY = cY - pTSprite->int_pos().Y;
RotateVector(&dX, &dY, 128 - pTSprite->ang);
RotateVector(&dX, &dY, 128 - pTSprite->__int_angle);
nAnim = GetOctant(dX, dY);
if (nAnim <= 4)
{
@ -996,7 +996,7 @@ void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t
{
int dX = cX - pTSprite->int_pos().X;
int dY = cY - pTSprite->int_pos().Y;
RotateVector(&dX, &dY, 128 - pTSprite->ang);
RotateVector(&dX, &dY, 128 - pTSprite->__int_angle);
nAnim = GetOctant(dX, dY);
break;
}

View file

@ -198,7 +198,7 @@ void fxBloodSpurt(DBloodActor* actor, sectortype*) // 6
auto pFX = gFX.fxSpawnActor(FX_27, actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, 0);
if (pFX)
{
pFX->spr.ang = 0;
pFX->spr.__int_angle = 0;
pFX->vel.X = actor->vel.X >> 8;
pFX->vel.Y = actor->vel.Y >> 8;
pFX->vel.Z = actor->vel.Z >> 8;
@ -237,8 +237,8 @@ void fxDynPuff(DBloodActor* actor, sectortype*) // 8
if (actor->vel.Z)
{
int nDist = (actor->spr.xrepeat * (tileWidth(actor->spr.picnum) / 2)) >> 2;
int x = actor->int_pos().X + MulScale(nDist, Cos(actor->spr.ang - 512), 30);
int y = actor->int_pos().Y + MulScale(nDist, Sin(actor->spr.ang - 512), 30);
int x = actor->int_pos().X + MulScale(nDist, Cos(actor->spr.__int_angle - 512), 30);
int y = actor->int_pos().Y + MulScale(nDist, Sin(actor->spr.__int_angle - 512), 30);
int z = actor->int_pos().Z;
auto pFX = gFX.fxSpawnActor(FX_7, actor->sector(), x, y, z, 0);
if (pFX)
@ -467,7 +467,7 @@ void fxBloodBits(DBloodActor* actor, sectortype*) // 14
int x = actor->int_pos().X + MulScale(nDist, Cos(nAngle), 28);
int y = actor->int_pos().Y + MulScale(nDist, Sin(nAngle), 28);
gFX.fxSpawnActor(FX_48, actor->sector(), x, y, actor->int_pos().Z, 0);
if (actor->spr.ang == 1024)
if (actor->spr.__int_angle == 1024)
{
int nChannel = 28 + (actor->GetIndex() & 2); // this is a little stupid...
sfxPlay3DSound(actor, 385, nChannel, 1);
@ -476,7 +476,7 @@ void fxBloodBits(DBloodActor* actor, sectortype*) // 14
{
auto pFX = gFX.fxSpawnActor(FX_36, actor->sector(), x, y, floorZ - 64, 0);
if (pFX)
pFX->spr.ang = nAngle;
pFX->spr.__int_angle = nAngle;
}
gFX.remove(actor);
}
@ -625,7 +625,7 @@ void fxPodBloodSpray(DBloodActor* actor, sectortype*) // 18
pFX = gFX.fxSpawnActor(FX_54, actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, 0);
if (pFX)
{
pFX->spr.ang = 0;
pFX->spr.__int_angle = 0;
pFX->vel.X = actor->vel.X >> 8;
pFX->vel.Y = actor->vel.Y >> 8;
pFX->vel.Z = actor->vel.Z >> 8;
@ -653,7 +653,7 @@ void fxPodBloodSplat(DBloodActor* actor, sectortype*) // 19
int nDist = Random(16) << 4;
int x = actor->int_pos().X + MulScale(nDist, Cos(nAngle), 28);
int y = actor->int_pos().Y + MulScale(nDist, Sin(nAngle), 28);
if (actor->spr.ang == 1024 && actor->spr.type == 53)
if (actor->spr.__int_angle == 1024 && actor->spr.type == 53)
{
int nChannel = 28 + (actor->GetIndex() & 2);
assert(nChannel < 32);
@ -665,13 +665,13 @@ void fxPodBloodSplat(DBloodActor* actor, sectortype*) // 19
if (Chance(0x500) || actor->spr.type == kThingPodGreenBall)
pFX = gFX.fxSpawnActor(FX_55, actor->sector(), x, y, floorZ - 64, 0);
if (pFX)
pFX->spr.ang = nAngle;
pFX->spr.__int_angle = nAngle;
}
else
{
pFX = gFX.fxSpawnActor(FX_32, actor->sector(), x, y, floorZ - 64, 0);
if (pFX)
pFX->spr.ang = nAngle;
pFX->spr.__int_angle = nAngle;
}
gFX.remove(actor);
}
@ -709,7 +709,7 @@ void sub_76A08(DBloodActor* actor, DBloodActor* actor2, PLAYER* pPlayer) // ???
int top, bottom;
GetActorExtents(actor, &top, &bottom);
actor->set_int_pos({ actor2->int_pos().X, actor2->int_pos().Y, actor2->sector()->int_floorz() - (bottom - actor->int_pos().Z) });
actor->spr.ang = actor2->spr.ang;
actor->spr.__int_angle = actor2->spr.__int_angle;
ChangeActorSect(actor, actor2->sector());
sfxPlay3DSound(actor2, 201, -1, 0);
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
@ -746,7 +746,7 @@ void DropVoodooCb(DBloodActor* actor, sectortype*) // unused
evPostActor(actor, 0, kCallbackRemove);
return;
}
actor->spr.ang = getangle(Owner->int_pos().X - actor->int_pos().X, Owner->int_pos().Y - actor->int_pos().Y);
actor->spr.__int_angle = getangle(Owner->int_pos().X - actor->int_pos().X, Owner->int_pos().Y - actor->int_pos().Y);
if (actor->hasX())
{
if (actor->xspr.data1 == 0)

View file

@ -477,7 +477,7 @@ void dbLoadMap(const char* pPath, int* pX, int* pY, int* pZ, short* pAngle, int*
pSprite->picnum = LittleShort(load.picnum);
int secno = LittleShort(load.sectnum);
pSprite->statnum = LittleShort(load.statnum);
pSprite->ang = LittleShort(load.ang);
pSprite->__int_angle = LittleShort(load.ang);
pSprite->intowner = LittleShort(load.owner);
pSprite->xvel = LittleShort(load.index);
pSprite->yvel = LittleShort(load.yvel);

View file

@ -276,7 +276,7 @@ void fxSpawnBlood(DBloodActor* actor, int)
auto bloodactor = gFX.fxSpawnActor(FX_27, actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, 0);
if (bloodactor)
{
bloodactor->spr.ang = 1024;
bloodactor->spr.__int_angle = 1024;
bloodactor->vel.X = Random2(0x6aaaa);
bloodactor->vel.Y = Random2(0x6aaaa);
bloodactor->vel.Z = -(int)Random(0x10aaaa) - 100;
@ -306,7 +306,7 @@ void fxSpawnPodStuff(DBloodActor* actor, int)
spawnactor = gFX.fxSpawnActor(FX_54, actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, 0);
if (spawnactor)
{
spawnactor->spr.ang = 1024;
spawnactor->spr.__int_angle = 1024;
spawnactor->vel.X = Random2(0x6aaaa);
spawnactor->vel.Y = Random2(0x6aaaa);
spawnactor->vel.Z = -(int)Random(0x10aaaa) - 100;
@ -322,17 +322,17 @@ void fxSpawnPodStuff(DBloodActor* actor, int)
void fxSpawnEjectingBrass(DBloodActor* actor, int z, int a3, int a4)
{
int x = actor->int_pos().X + MulScale(actor->spr.clipdist - 4, Cos(actor->spr.ang), 28);
int y = actor->int_pos().Y + MulScale(actor->spr.clipdist - 4, Sin(actor->spr.ang), 28);
x += MulScale(a3, Cos(actor->spr.ang + 512), 30);
y += MulScale(a3, Sin(actor->spr.ang + 512), 30);
int x = actor->int_pos().X + MulScale(actor->spr.clipdist - 4, Cos(actor->spr.__int_angle), 28);
int y = actor->int_pos().Y + MulScale(actor->spr.clipdist - 4, Sin(actor->spr.__int_angle), 28);
x += MulScale(a3, Cos(actor->spr.__int_angle + 512), 30);
y += MulScale(a3, Sin(actor->spr.__int_angle + 512), 30);
auto pBrass = gFX.fxSpawnActor((FX_ID)(FX_37 + Random(3)), actor->sector(), x, y, z, 0);
if (pBrass)
{
if (!VanillaMode())
pBrass->spr.ang = Random(2047);
pBrass->spr.__int_angle = Random(2047);
int nDist = (a4 << 18) / 120 + Random2(((a4 / 4) << 18) / 120);
int nAngle = actor->spr.ang + Random2(56) + 512;
int nAngle = actor->spr.__int_angle + Random2(56) + 512;
pBrass->vel.X = MulScale(nDist, Cos(nAngle), 30);
pBrass->vel.Y = MulScale(nDist, Sin(nAngle), 30);
pBrass->vel.Z = actor->vel.Z - (0x20000 + (Random2(40) << 18) / 120);
@ -347,17 +347,17 @@ void fxSpawnEjectingBrass(DBloodActor* actor, int z, int a3, int a4)
void fxSpawnEjectingShell(DBloodActor* actor, int z, int a3, int a4)
{
int x = actor->int_pos().X + MulScale(actor->spr.clipdist - 4, Cos(actor->spr.ang), 28);
int y = actor->int_pos().Y + MulScale(actor->spr.clipdist - 4, Sin(actor->spr.ang), 28);
x += MulScale(a3, Cos(actor->spr.ang + 512), 30);
y += MulScale(a3, Sin(actor->spr.ang + 512), 30);
int x = actor->int_pos().X + MulScale(actor->spr.clipdist - 4, Cos(actor->spr.__int_angle), 28);
int y = actor->int_pos().Y + MulScale(actor->spr.clipdist - 4, Sin(actor->spr.__int_angle), 28);
x += MulScale(a3, Cos(actor->spr.__int_angle + 512), 30);
y += MulScale(a3, Sin(actor->spr.__int_angle + 512), 30);
auto pShell = gFX.fxSpawnActor((FX_ID)(FX_40 + Random(3)), actor->sector(), x, y, z, 0);
if (pShell)
{
if (!VanillaMode())
pShell->spr.ang = Random(2047);
pShell->spr.__int_angle = Random(2047);
int nDist = (a4 << 18) / 120 + Random2(((a4 / 4) << 18) / 120);
int nAngle = actor->spr.ang + Random2(56) + 512;
int nAngle = actor->spr.__int_angle + Random2(56) + 512;
pShell->vel.X = MulScale(nDist, Cos(nAngle), 30);
pShell->vel.Y = MulScale(nDist, Sin(nAngle), 30);
pShell->vel.Z = actor->vel.Z - (0x20000 + (Random2(20) << 18) / 120);

View file

@ -393,8 +393,8 @@ int HitScan(DBloodActor* actor, int z, int dx, int dy, int dz, unsigned int nMas
actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN;
if (nRange)
{
hitscangoal.X = x + MulScale(nRange << 4, Cos(actor->spr.ang), 30);
hitscangoal.Y = y + MulScale(nRange << 4, Sin(actor->spr.ang), 30);
hitscangoal.X = x + MulScale(nRange << 4, Cos(actor->spr.__int_angle), 30);
hitscangoal.Y = y + MulScale(nRange << 4, Sin(actor->spr.__int_angle), 30);
}
else
{
@ -435,15 +435,15 @@ int VectorScan(DBloodActor* actor, int nOffset, int nZOffset, int dx, int dy, in
int nNum = 256;
gHitInfo.clearObj();
int x1 = actor->int_pos().X + MulScale(nOffset, Cos(actor->spr.ang + 512), 30);
int y1 = actor->int_pos().Y + MulScale(nOffset, Sin(actor->spr.ang + 512), 30);
int x1 = actor->int_pos().X + MulScale(nOffset, Cos(actor->spr.__int_angle + 512), 30);
int y1 = actor->int_pos().Y + MulScale(nOffset, Sin(actor->spr.__int_angle + 512), 30);
int z1 = actor->int_pos().Z + nZOffset;
auto bakCstat = actor->spr.cstat;
actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN;
if (nRange)
{
hitscangoal.X = x1 + MulScale(nRange << 4, Cos(actor->spr.ang), 30);
hitscangoal.Y = y1 + MulScale(nRange << 4, Sin(actor->spr.ang), 30);
hitscangoal.X = x1 + MulScale(nRange << 4, Cos(actor->spr.__int_angle), 30);
hitscangoal.Y = y1 + MulScale(nRange << 4, Sin(actor->spr.__int_angle), 30);
}
else
{

View file

@ -262,7 +262,7 @@ static DBloodActor* nnExtSpawnDude(DBloodActor* sourceactor, DBloodActor* origin
if (nType < kDudeBase || nType >= kDudeMax || (pDudeActor = actSpawnSprite(origin, kStatDude)) == NULL)
return NULL;
int angle = origin->spr.ang;
int angle = origin->spr.__int_angle;
int x, y, z = a4 + origin->int_pos().Z;
if (a3 < 0)
{
@ -279,7 +279,7 @@ static DBloodActor* nnExtSpawnDude(DBloodActor* sourceactor, DBloodActor* origin
SetActor(pDudeActor, &pos);
pDudeActor->spr.type = nType;
pDudeActor->spr.ang = angle;
pDudeActor->spr.__int_angle = angle;
pDudeActor->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL;
pDudeActor->spr.clipdist = getDudeInfo(nType)->clipdist;
@ -1342,8 +1342,8 @@ void nnExtProcessSuperSprites()
int nSpeed = approxDist(pact->vel.X, pact->vel.Y);
nSpeed = ClipLow(nSpeed - MulScale(nSpeed, mass, 6), 0x9000 - (mass << 3));
debrisactor->vel.X += MulScale(nSpeed, Cos(pPlayer->actor->spr.ang), 30);
debrisactor->vel.Y += MulScale(nSpeed, Sin(pPlayer->actor->spr.ang), 30);
debrisactor->vel.X += MulScale(nSpeed, Cos(pPlayer->actor->spr.__int_angle), 30);
debrisactor->vel.Y += MulScale(nSpeed, Sin(pPlayer->actor->spr.__int_angle), 30);
debrisactor->hit.hit.setSprite(pPlayer->actor);
}
@ -1357,21 +1357,21 @@ void nnExtProcessSuperSprites()
if (debrisactor->vel.X || debrisactor->vel.Y)
debrisactor->xspr.goalAng = getangle(debrisactor->vel.X, debrisactor->vel.Y) & 2047;
int ang = debrisactor->spr.ang & 2047;
int ang = debrisactor->spr.__int_angle & 2047;
if ((uwater = spriteIsUnderwater(debrisactor)) == false) evKillActor(debrisactor, kCallbackEnemeyBubble);
else if (Chance(0x1000 - mass))
{
if (debrisactor->vel.Z > 0x100) debrisBubble(debrisactor);
if (ang == debrisactor->xspr.goalAng)
{
debrisactor->xspr.goalAng = (debrisactor->spr.ang + Random3(kAng60)) & 2047;
debrisactor->xspr.goalAng = (debrisactor->spr.__int_angle + Random3(kAng60)) & 2047;
debrisBubble(debrisactor);
}
}
int angStep = ClipLow(mulscale8(1, ((abs(debrisactor->vel.X) + abs(debrisactor->vel.Y)) >> 5)), (uwater) ? 1 : 0);
if (ang < debrisactor->xspr.goalAng) debrisactor->spr.ang = ClipHigh(ang + angStep, debrisactor->xspr.goalAng);
else if (ang > debrisactor->xspr.goalAng) debrisactor->spr.ang = ClipLow(ang - angStep, debrisactor->xspr.goalAng);
if (ang < debrisactor->xspr.goalAng) debrisactor->spr.__int_angle = ClipHigh(ang + angStep, debrisactor->xspr.goalAng);
else if (ang > debrisactor->xspr.goalAng) debrisactor->spr.__int_angle = ClipLow(ang - angStep, debrisactor->xspr.goalAng);
auto pSector = debrisactor->sector();
int cz = getceilzofslopeptr(pSector, debrisactor->int_pos().X, debrisactor->int_pos().Y);
@ -2791,7 +2791,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
// set random goal ang for swimming so they start turning
if ((flags & kPhysDebrisSwim) && !targetactor->vel.X && !targetactor->vel.Y && !targetactor->vel.Z)
targetactor->xspr.goalAng = (targetactor->spr.ang + Random3(kAng45)) & 2047;
targetactor->xspr.goalAng = (targetactor->spr.__int_angle + Random3(kAng45)) & 2047;
if (targetactor->xspr.physAttr & kPhysDebrisVector)
targetactor->spr.cstat |= CSTAT_SPRITE_BLOCK_HITSCAN;
@ -3065,9 +3065,9 @@ void useVelocityChanger(DBloodActor* actor, sectortype* sect, DBloodActor* initi
}
else
{
if (toEvnAng) nAng = initiator->spr.ang;
else if (toSrcAng) nAng = actor->spr.ang;
else nAng = pSprite->spr.ang;
if (toEvnAng) nAng = initiator->spr.__int_angle;
else if (toSrcAng) nAng = actor->spr.__int_angle;
else nAng = pSprite->spr.__int_angle;
nAng = nAng & 2047;
@ -3281,11 +3281,11 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
{
if (pPlayer)
{
pPlayer->angle.settarget(buildang(sourceactor->spr.ang));
pPlayer->angle.settarget(buildang(sourceactor->spr.__int_angle));
pPlayer->angle.lockinput();
}
else if (isDude) sourceactor->xspr.goalAng = actor->spr.ang = sourceactor->spr.ang;
else actor->spr.ang = sourceactor->spr.ang;
else if (isDude) sourceactor->xspr.goalAng = actor->spr.__int_angle = sourceactor->spr.__int_angle;
else actor->spr.__int_angle = sourceactor->spr.__int_angle;
}
#endif
@ -3299,7 +3299,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
if (sourceactor->xspr.data3 & kModernTypeFlag2)
{
int vAng = getVelocityAngle(actor);
RotatePoint(&actor->vel.X, &actor->vel.Y, (sourceactor->spr.ang - vAng) & 2047, actor->int_pos().X, actor->int_pos().Y);
RotatePoint(&actor->vel.X, &actor->vel.Y, (sourceactor->spr.__int_angle - vAng) & 2047, actor->int_pos().X, actor->int_pos().Y);
}
if (sourceactor->xspr.data3 & kModernTypeFlag4)
@ -3307,7 +3307,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
}
if (sourceactor->xspr.data2 == 1)
changeSpriteAngle(actor, sourceactor->spr.ang);
changeSpriteAngle(actor, sourceactor->spr.__int_angle);
viewBackupSpriteLoc(actor);
@ -3402,7 +3402,7 @@ void useEffectGen(DBloodActor* sourceactor, DBloodActor* actor)
if (sourceactor->spr.flags & kModernTypeFlag4)
{
pEffect->spr.ang = sourceactor->spr.ang;
pEffect->spr.__int_angle = sourceactor->spr.__int_angle;
}
if (pEffect->spr.cstat & CSTAT_SPRITE_ONE_SIDE)
@ -3453,29 +3453,29 @@ void useSectorWindGen(DBloodActor* sourceactor, sectortype* pSector)
if ((sourceactor->spr.flags & kModernTypeFlag1))
pXSector->panAlways = pXSector->windAlways = 1;
int ang = sourceactor->spr.ang;
int ang = sourceactor->spr.__int_angle;
if (sourceactor->xspr.data4 <= 0)
{
if ((sourceactor->xspr.data1 & 0x0002))
{
while (sourceactor->spr.ang == ang)
sourceactor->spr.ang = nnExtRandom(-kAng360, kAng360) & 2047;
while (sourceactor->spr.__int_angle == ang)
sourceactor->spr.__int_angle = nnExtRandom(-kAng360, kAng360) & 2047;
}
}
else if (sourceactor->spr.cstat & CSTAT_SPRITE_MOVE_FORWARD) sourceactor->spr.ang += sourceactor->xspr.data4;
else if (sourceactor->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE) sourceactor->spr.ang -= sourceactor->xspr.data4;
else if (sourceactor->spr.cstat & CSTAT_SPRITE_MOVE_FORWARD) sourceactor->spr.__int_angle += sourceactor->xspr.data4;
else if (sourceactor->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE) sourceactor->spr.__int_angle -= sourceactor->xspr.data4;
else if (sourceactor->xspr.sysData1 == 0)
{
if ((ang += sourceactor->xspr.data4) >= kAng180) sourceactor->xspr.sysData1 = 1;
sourceactor->spr.ang = ClipHigh(ang, kAng180);
sourceactor->spr.__int_angle = ClipHigh(ang, kAng180);
}
else
{
if ((ang -= sourceactor->xspr.data4) <= -kAng180) sourceactor->xspr.sysData1 = 0;
sourceactor->spr.ang = ClipLow(ang, -kAng180);
sourceactor->spr.__int_angle = ClipLow(ang, -kAng180);
}
pXSector->windAng = sourceactor->spr.ang;
pXSector->windAng = sourceactor->spr.__int_angle;
if (sourceactor->xspr.data3 > 0 && sourceactor->xspr.data3 < 4)
{
@ -3835,7 +3835,7 @@ void useSeqSpawnerGen(DBloodActor* sourceactor, int objType, sectortype* pSector
if (sourceactor->spr.flags & kModernTypeFlag4)
{
spawned->spr.ang = sourceactor->spr.ang;
spawned->spr.__int_angle = sourceactor->spr.__int_angle;
}
// should be: the more is seqs, the shorter is timer
@ -4481,7 +4481,7 @@ bool condCheckDude(DBloodActor* aCond, int cmpOp, bool PUSH)
var = cansee(objActor->int_pos().X, objActor->int_pos().Y, objActor->int_pos().Z, objActor->sector(), targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - eyeAboveZ, targ->sector());
if (cond == 4 && var > 0)
{
var = ((1024 + getangle(dx, dy) - objActor->spr.ang) & 2047) - 1024;
var = ((1024 + getangle(dx, dy) - objActor->spr.__int_angle) & 2047) - 1024;
var = (abs(var) < ((arg1 <= 0) ? pInfo->periphery : ClipHigh(arg1, 2048)));
}
break;
@ -4604,7 +4604,7 @@ bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH)
switch (cond)
{
default: break;
case 0: return condCmp((arg3 == 0) ? (objActor->spr.ang & 2047) : objActor->spr.ang, arg1, arg2, cmpOp);
case 0: return condCmp((arg3 == 0) ? (objActor->spr.__int_angle & 2047) : objActor->spr.__int_angle, arg1, arg2, cmpOp);
case 5: return condCmp(objActor->spr.statnum, arg1, arg2, cmpOp);
case 6: return ((objActor->spr.flags & kHitagRespawn) || objActor->spr.statnum == kStatRespawn);
case 7: return condCmp(spriteGetSlope(objActor), arg1, arg2, cmpOp);
@ -4665,15 +4665,15 @@ bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH)
if ((pPlayer = getPlayerById(objActor->spr.type)) != NULL)
var = HitScan(objActor, pPlayer->zWeapon, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, arg1, arg3 << 1);
else if (objActor->IsDudeActor())
var = HitScan(objActor, objActor->int_pos().Z, bcos(objActor->spr.ang), bsin(objActor->spr.ang), (!objActor->hasX()) ? 0 : objActor->dudeSlope, arg1, arg3 << 1);
var = HitScan(objActor, objActor->int_pos().Z, bcos(objActor->spr.__int_angle), bsin(objActor->spr.__int_angle), (!objActor->hasX()) ? 0 : objActor->dudeSlope, arg1, arg3 << 1);
else if ((objActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FLOOR)
{
var3 = (objActor->spr.cstat & CSTAT_SPRITE_YFLIP) ? 0x10000 << 1 : -(0x10000 << 1);
var = HitScan(objActor, objActor->int_pos().Z, Cos(objActor->spr.ang) >> 16, Sin(objActor->spr.ang) >> 16, var3, arg1, arg3 << 1);
var = HitScan(objActor, objActor->int_pos().Z, Cos(objActor->spr.__int_angle) >> 16, Sin(objActor->spr.__int_angle) >> 16, var3, arg1, arg3 << 1);
}
else
{
var = HitScan(objActor, objActor->int_pos().Z, bcos(objActor->spr.ang), bsin(objActor->spr.ang), 0, arg1, arg3 << 1);
var = HitScan(objActor, objActor->int_pos().Z, bcos(objActor->spr.__int_angle), bsin(objActor->spr.__int_angle), 0, arg1, arg3 << 1);
}
if (var < 0)
@ -5189,7 +5189,7 @@ bool aiFightDudeCanSeeTarget(DBloodActor* dudeactor, DUDEINFO* pDudeInfo, DBlood
if (cansee(dudeactor->int_pos().X, dudeactor->int_pos().Y, dudeactor->int_pos().Z, dudeactor->sector(), targetactor->int_pos().X, targetactor->int_pos().Y, targetactor->int_pos().Z - eyeAboveZ, targetactor->sector()))
{
/*int nAngle = getangle(dx, dy);
int losAngle = ((1024 + nAngle - dudeactor->spr.ang) & 2047) - 1024;
int losAngle = ((1024 + nAngle - dudeactor->spr.__int_angle) & 2047) - 1024;
// is the target visible?
if (abs(losAngle) < 2048) // 360 deg periphery here*/
@ -6099,7 +6099,7 @@ bool modernTypeOperateSprite(DBloodActor* actor, EVENT& event)
if (actor->xspr.data4 != 0) break;
else if (actor->spr.flags & kModernTypeFlag1)
{
pPlayer->angle.settarget(buildang(actor->spr.ang));
pPlayer->angle.settarget(buildang(actor->spr.__int_angle));
pPlayer->angle.lockinput();
}
else if (valueIsBetween(actor->xspr.data2, -kAng360, kAng360))
@ -6537,8 +6537,8 @@ void useUniMissileGen(DBloodActor* sourceactor, DBloodActor* actor)
}
else
{
dx = bcos(actor->spr.ang);
dy = bsin(actor->spr.ang);
dx = bcos(actor->spr.__int_angle);
dy = bsin(actor->spr.__int_angle);
dz = sourceactor->xspr.data3 << 6; // add slope controlling
if (dz > 0x10000) dz = 0x10000;
else if (dz < -0x10000) dz = -0x10000;
@ -7742,35 +7742,35 @@ void nnExtAiSetDirection(DBloodActor* actor, int a3)
{
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
int vc = ((a3 + 1024 - actor->spr.ang) & 2047) - 1024;
int t1 = DMulScale(actor->vel.X, Cos(actor->spr.ang), actor->vel.Y, Sin(actor->spr.ang), 30);
int vc = ((a3 + 1024 - actor->spr.__int_angle) & 2047) - 1024;
int t1 = DMulScale(actor->vel.X, Cos(actor->spr.__int_angle), actor->vel.Y, Sin(actor->spr.__int_angle), 30);
int vsi = ((t1 * 15) >> 12) / 2;
int v8 = 341;
if (vc < 0)
v8 = -341;
if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.ang + vc, vsi))
actor->xspr.goalAng = actor->spr.ang + vc;
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.ang + vc / 2, vsi))
actor->xspr.goalAng = actor->spr.ang + vc / 2;
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.ang - vc / 2, vsi))
actor->xspr.goalAng = actor->spr.ang - vc / 2;
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.ang + v8, vsi))
actor->xspr.goalAng = actor->spr.ang + v8;
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.ang, vsi))
actor->xspr.goalAng = actor->spr.ang;
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.ang - v8, vsi))
actor->xspr.goalAng = actor->spr.ang - v8;
if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.__int_angle + vc, vsi))
actor->xspr.goalAng = actor->spr.__int_angle + vc;
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.__int_angle + vc / 2, vsi))
actor->xspr.goalAng = actor->spr.__int_angle + vc / 2;
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.__int_angle - vc / 2, vsi))
actor->xspr.goalAng = actor->spr.__int_angle - vc / 2;
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.__int_angle + v8, vsi))
actor->xspr.goalAng = actor->spr.__int_angle + v8;
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.__int_angle, vsi))
actor->xspr.goalAng = actor->spr.__int_angle;
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.__int_angle - v8, vsi))
actor->xspr.goalAng = actor->spr.__int_angle - v8;
else
actor->xspr.goalAng = actor->spr.ang + 341;
actor->xspr.goalAng = actor->spr.__int_angle + 341;
if (actor->xspr.dodgeDir)
{
if (!nnExtCanMove(actor, actor->GetTarget(), actor->spr.ang + actor->xspr.dodgeDir * 512, 512))
if (!nnExtCanMove(actor, actor->GetTarget(), actor->spr.__int_angle + actor->xspr.dodgeDir * 512, 512))
{
actor->xspr.dodgeDir = -actor->xspr.dodgeDir;
if (!nnExtCanMove(actor, actor->GetTarget(), actor->spr.ang + actor->xspr.dodgeDir * 512, 512))
if (!nnExtCanMove(actor, actor->GetTarget(), actor->spr.__int_angle + actor->xspr.dodgeDir * 512, 512))
actor->xspr.dodgeDir = 0;
}
}
@ -8098,7 +8098,7 @@ void aiPatrolStop(DBloodActor* actor, DBloodActor* targetactor, bool alarm)
if (mytarget && mytarget->spr.type == kMarkerPath)
{
if (targetactor == nullptr) actor->spr.ang = mytarget->spr.ang & 2047;
if (targetactor == nullptr) actor->spr.__int_angle = mytarget->spr.__int_angle & 2047;
actor->SetTarget(nullptr);
}
@ -8144,7 +8144,7 @@ void aiPatrolRandGoalAng(DBloodActor* actor)
if (Chance(0x8000))
goal = -goal;
actor->xspr.goalAng = (actor->spr.ang + goal) & 2047;
actor->xspr.goalAng = (actor->spr.__int_angle + goal) & 2047;
}
//---------------------------------------------------------------------------
@ -8156,8 +8156,8 @@ void aiPatrolRandGoalAng(DBloodActor* actor)
void aiPatrolTurn(DBloodActor* actor)
{
int nTurnRange = (getDudeInfo(actor->spr.type)->angSpeed << 1) >> 4;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
}
@ -8204,8 +8204,8 @@ void aiPatrolMove(DBloodActor* actor)
}
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.ang) & 2047) - 1024;
actor->spr.ang = (actor->spr.ang + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
int nAng = ((actor->xspr.goalAng + 1024 - actor->spr.__int_angle) & 2047) - 1024;
actor->spr.__int_angle = (actor->spr.__int_angle + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047;
if (abs(nAng) > goalAng || ((targetactor->xspr.waitTime > 0 || targetactor->xspr.data1 == targetactor->xspr.data2) && aiPatrolMarkerReached(actor)))
{
@ -8241,8 +8241,8 @@ void aiPatrolMove(DBloodActor* actor)
}
frontSpeed = aiPatrolGetVelocity(pDudeInfo->frontSpeed, targetactor->xspr.busyTime);
actor->vel.X += MulScale(frontSpeed, Cos(actor->spr.ang), 30);
actor->vel.Y += MulScale(frontSpeed, Sin(actor->spr.ang), 30);
actor->vel.X += MulScale(frontSpeed, Cos(actor->spr.__int_angle), 30);
actor->vel.Y += MulScale(frontSpeed, Sin(actor->spr.__int_angle), 30);
}
vel = MulScale(vel, approxDist(dx, dy) << 6, 16);
@ -8411,7 +8411,7 @@ bool readyForCrit(DBloodActor* hunter, DBloodActor* victim)
if (approxDist(dx, dy) >= (7000 / ClipLow(gGameOptions.nDifficulty >> 1, 1)))
return false;
return (abs(((getangle(dx, dy) + 1024 - victim->spr.ang) & 2047) - 1024) <= kAng45);
return (abs(((getangle(dx, dy) + 1024 - victim->spr.__int_angle) & 2047) - 1024) <= kAng45);
}
//---------------------------------------------------------------------------
@ -8600,7 +8600,7 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor)
if (seeDist)
{
int periphery = ClipLow(pDudeInfo->periphery, kAng60);
int nDeltaAngle = abs(((getangle(dx, dy) + 1024 - actor->spr.ang) & 2047) - 1024);
int nDeltaAngle = abs(((getangle(dx, dy) + 1024 - actor->spr.__int_angle) & 2047) - 1024);
if ((itCanSee = (!blind && nDist < seeDist && nDeltaAngle < periphery)) == true)
{
int base = 100 + ((20 * gGameOptions.nDifficulty) - (nDeltaAngle / 5));
@ -8886,7 +8886,7 @@ void aiPatrolThink(DBloodActor* actor)
else if (aiPatrolTurning(actor->xspr.aiState))
{
//viewSetSystemMessage("TURN");
if ((int)actor->spr.ang == (int)actor->xspr.goalAng)
if ((int)actor->spr.__int_angle == (int)actor->xspr.goalAng)
{
// save imer for waiting
stateTimer = actor->xspr.stateTimer;
@ -8917,8 +8917,8 @@ void aiPatrolThink(DBloodActor* actor)
// take marker's angle
if (!(markeractor->spr.flags & kModernTypeFlag4))
{
actor->xspr.goalAng = ((!(markeractor->spr.flags & kModernTypeFlag8) && actor->xspr.unused2) ? markeractor->spr.ang + kAng180 : markeractor->spr.ang) & 2047;
if ((int)actor->spr.ang != (int)actor->xspr.goalAng) // let the enemy play move animation while turning
actor->xspr.goalAng = ((!(markeractor->spr.flags & kModernTypeFlag8) && actor->xspr.unused2) ? markeractor->spr.__int_angle + kAng180 : markeractor->spr.__int_angle) & 2047;
if ((int)actor->spr.__int_angle != (int)actor->xspr.goalAng) // let the enemy play move animation while turning
return;
}
@ -9235,7 +9235,7 @@ void callbackUniMissileBurst(DBloodActor* actor, sectortype*) // 22
burstactor->spr.flags = actor->spr.flags;
burstactor->spr.xrepeat = actor->spr.xrepeat / 2;
burstactor->spr.yrepeat = actor->spr.yrepeat / 2;
burstactor->spr.ang = ((actor->spr.ang + missileInfo[actor->spr.type - kMissileBase].angleOfs) & 2047);
burstactor->spr.__int_angle = ((actor->spr.__int_angle + missileInfo[actor->spr.type - kMissileBase].angleOfs) & 2047);
burstactor->SetOwner(actor);
actBuildMissile(burstactor, actor);
@ -9334,7 +9334,7 @@ void triggerTouchWall(DBloodActor* actor, walltype* pHWall)
void changeSpriteAngle(DBloodActor* pSpr, int nAng)
{
if (!pSpr->IsDudeActor())
pSpr->spr.ang = nAng;
pSpr->spr.__int_angle = nAng;
else
{
PLAYER* pPlayer = getPlayerById(pSpr->spr.type);
@ -9342,9 +9342,9 @@ void changeSpriteAngle(DBloodActor* pSpr, int nAng)
pPlayer->angle.ang = buildang(nAng);
else
{
pSpr->spr.ang = nAng;
pSpr->spr.__int_angle = nAng;
if (pSpr->hasX())
pSpr->xspr.goalAng = pSpr->spr.ang;
pSpr->xspr.goalAng = pSpr->spr.__int_angle;
}
}
}

View file

@ -809,8 +809,8 @@ void playerStart(int nPlayer, int bNewLevel)
GetActorExtents(actor, &top, &bottom);
actor->add_int_z(-(bottom - actor->int_pos().Z));
actor->spr.pal = 11 + (pPlayer->teamId & 3);
actor->spr.ang = pStartZone->ang;
pPlayer->angle.ang = buildang(actor->spr.ang);
actor->spr.__int_angle = pStartZone->ang;
pPlayer->angle.ang = buildang(actor->spr.__int_angle);
actor->spr.type = kDudePlayer1 + nPlayer;
actor->spr.clipdist = pDudeInfo->clipdist;
actor->spr.flags = 15;
@ -1421,8 +1421,8 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out)
{
auto plActor = pPlayer->actor;
*out = {};
int x = bcos(plActor->spr.ang);
int y = bsin(plActor->spr.ang);
int x = bcos(plActor->spr.__int_angle);
int y = bsin(plActor->spr.__int_angle);
int z = pPlayer->slope;
int hit = HitScan(pPlayer->actor, pPlayer->zView, x, y, z, 0x10000040, 128);
int hitDist = approxDist(plActor->int_pos().X - gHitInfo.hitpos.X, plActor->int_pos().Y - gHitInfo.hitpos.Y) >> 4;
@ -1504,7 +1504,7 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out)
void UpdatePlayerSpriteAngle(PLAYER* pPlayer)
{
pPlayer->actor->spr.ang = pPlayer->angle.ang.asbuild();
pPlayer->actor->spr.__int_angle = pPlayer->angle.ang.asbuild();
}
//---------------------------------------------------------------------------
@ -1518,7 +1518,7 @@ void doslopetilting(PLAYER* pPlayer, double const scaleAdjust = 1)
auto plActor = pPlayer->actor;
int const florhit = pPlayer->actor->hit.florhit.type;
bool const va = plActor->xspr.height < 16 && (florhit == kHitSector || florhit == 0) ? 1 : 0;
pPlayer->horizon.calcviewpitch(plActor->int_pos().vec2, buildang(plActor->spr.ang), va, plActor->sector()->floorstat & CSTAT_SECTOR_SLOPE, plActor->sector(), scaleAdjust);
pPlayer->horizon.calcviewpitch(plActor->int_pos().vec2, buildang(plActor->spr.__int_angle), va, plActor->sector()->floorstat & CSTAT_SECTOR_SLOPE, plActor->sector(), scaleAdjust);
}
//---------------------------------------------------------------------------
@ -1593,8 +1593,8 @@ void ProcessInput(PLAYER* pPlayer)
}
if (pPlayer->posture == 1)
{
int x = Cos(actor->spr.ang);
int y = Sin(actor->spr.ang);
int x = Cos(actor->spr.__int_angle);
int y = Sin(actor->spr.__int_angle);
if (pInput->fvel)
{
int forward = pInput->fvel;
@ -1618,8 +1618,8 @@ void ProcessInput(PLAYER* pPlayer)
int speed = 0x10000;
if (actor->xspr.height > 0)
speed -= DivScale(actor->xspr.height, 256, 16);
int x = Cos(actor->spr.ang);
int y = Sin(actor->spr.ang);
int x = Cos(actor->spr.__int_angle);
int y = Sin(actor->spr.__int_angle);
if (pInput->fvel)
{
int forward = pInput->fvel;
@ -1763,9 +1763,9 @@ void ProcessInput(PLAYER* pPlayer)
auto spawned = actSpawnDude(pactor, kDudeHand, pPlayer->actor->spr.clipdist << 1, 0);
if (spawned)
{
spawned->spr.ang = (pPlayer->actor->spr.ang + 1024) & 2047;
int x = bcos(pPlayer->actor->spr.ang);
int y = bsin(pPlayer->actor->spr.ang);
spawned->spr.__int_angle = (pPlayer->actor->spr.__int_angle + 1024) & 2047;
int x = bcos(pPlayer->actor->spr.__int_angle);
int y = bsin(pPlayer->actor->spr.__int_angle);
spawned->vel.X = pPlayer->actor->vel.X + MulScale(0x155555, x, 14);
spawned->vel.Y = pPlayer->actor->vel.Y + MulScale(0x155555, y, 14);
spawned->vel.Z = pPlayer->actor->vel.Z;

View file

@ -118,7 +118,7 @@ void GameInterface::UpdateSounds()
if (gMe->actor)
{
listener.angle = -gMe->actor->spr.ang * float(BAngRadian); // Build uses a period of 2048.
listener.angle = -gMe->actor->spr.__int_angle * float(BAngRadian); // Build uses a period of 2048.
listener.velocity.Zero();
listener.position = GetSoundPos(gMe->actor->int_pos());
listener.valid = true;

View file

@ -276,10 +276,10 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event)
int t = DivScale(nDist, 0x1aaaaa, 12);
x += (target->vel.X * t) >> 12;
y += (target->vel.Y * t) >> 12;
int angBak = actor->spr.ang;
actor->spr.ang = getangle(x - actor->int_pos().X, y - actor->int_pos().Y);
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int angBak = actor->spr.__int_angle;
actor->spr.__int_angle = getangle(x - actor->int_pos().X, y - actor->int_pos().Y);
int dx = bcos(actor->spr.__int_angle);
int dy = bsin(actor->spr.__int_angle);
int tz = target->int_pos().Z - (target->spr.yrepeat * pDudeInfo->aimHeight) * 4;
int dz = DivScale(tz - top - 256, nDist, 10);
int nMissileType = kMissileLifeLeechAltNormal + (actor->xspr.data3 ? 1 : 0);
@ -298,7 +298,7 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event)
if (!VanillaMode()) // disable collisions so lifeleech doesn't do that weird bobbing
missile->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
}
actor->spr.ang = angBak;
actor->spr.__int_angle = angBak;
}
}
}
@ -936,7 +936,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
if (ang)
RotatePoint(&x, &y, ang, a4, a5);
viewBackupSpriteLoc(actor);
actor->spr.ang = (actor->spr.ang + v14) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + v14) & 2047;
actor->set_int_xy(x + vc - a4, y + v8 - a5);
}
else if (actor->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE)
@ -944,7 +944,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
if (ang)
RotatePoint((int*)&x, (int*)&y, -ang, a4, sprDy);
viewBackupSpriteLoc(actor);
actor->spr.ang = (actor->spr.ang - v14) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle - v14) & 2047;
actor->set_int_xy(x - vc + a4, y - v8 + a5);
}
else if (pXSector->Drag)
@ -961,7 +961,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
RotatePoint(&pos.X, &pos.Y, v14, v20, v24);
actor->set_int_pos(pos);
}
actor->spr.ang = (actor->spr.ang + v14) & 2047;
actor->spr.__int_angle = (actor->spr.__int_angle + v14) & 2047;
actor->add_int_pos({ v28, v2c, 0 });
}
}
@ -988,7 +988,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
if (ang)
RotatePoint(&x, &y, ang, a4, a5);
viewBackupSpriteLoc(ac);
ac->spr.ang = (ac->spr.ang + v14) & 2047;
ac->spr.__int_angle = (ac->spr.__int_angle + v14) & 2047;
ac->set_int_xy(x + vc - a4, y + v8 - a5);
}
else if (ac->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE)
@ -996,7 +996,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
if (ang)
RotatePoint(&x, &y, -ang, a4, sprDy);
viewBackupSpriteLoc(ac);
ac->spr.ang = (ac->spr.ang - v14) & 2047;
ac->spr.__int_angle = (ac->spr.__int_angle - v14) & 2047;
ac->set_int_xy(x + vc - a4, y + v8 - a5);
}
}
@ -1388,7 +1388,7 @@ int HDoorBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator)
if (!pXSector->marker0 || !pXSector->marker1) return 0;
auto marker0 = pXSector->marker0;
auto marker1 = pXSector->marker1;
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.ang, marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.ang, pSector->type == kSectorSlide);
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.__int_angle, marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.__int_angle, pSector->type == kSectorSlide);
ZTranslateSector(pSector, pXSector, a2, nWave);
pXSector->busy = a2;
if (pXSector->command == kCmdLink && pXSector->txID)
@ -1419,7 +1419,7 @@ int RDoorBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator)
nWave = pXSector->busyWaveB;
if (!pXSector->marker0) return 0;
auto marker0 = pXSector->marker0;
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, 0, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.ang, pSector->type == kSectorRotate);
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, 0, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.__int_angle, pSector->type == kSectorRotate);
ZTranslateSector(pSector, pXSector, a2, nWave);
pXSector->busy = a2;
if (pXSector->command == kCmdLink && pXSector->txID)
@ -1448,13 +1448,13 @@ int StepRotateBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator)
int vbp;
if (pXSector->busy < a2)
{
vbp = pXSector->data + marker0->spr.ang;
vbp = pXSector->data + marker0->spr.__int_angle;
int nWave = pXSector->busyWaveA;
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, pXSector->data, marker0->int_pos().X, marker0->int_pos().Y, vbp, 1);
}
else
{
vbp = pXSector->data - marker0->spr.ang;
vbp = pXSector->data - marker0->spr.__int_angle;
int nWave = pXSector->busyWaveB;
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, vbp, marker0->int_pos().X, marker0->int_pos().Y, pXSector->data, 1);
}
@ -1510,7 +1510,7 @@ int PathBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator)
if (!basepath || !marker0 || !marker1) return 0;
int nWave = marker0->xspr.wave;
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), basepath->int_pos().X, basepath->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.ang, marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.ang, 1);
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), basepath->int_pos().X, basepath->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.__int_angle, marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.__int_angle, 1);
ZTranslateSector(pSector, pXSector, a2, nWave);
pXSector->busy = a2;
if ((a2 & 0xffff) == 0)
@ -1636,7 +1636,7 @@ void OperateTeleport(sectortype* pSector)
}
actor->set_int_xy(destactor->int_pos().X, destactor->int_pos().Y);
actor->add_int_z(destactor->sector()->int_floorz() - pSector->int_floorz());
actor->spr.ang = destactor->spr.ang;
actor->spr.__int_angle = destactor->spr.__int_angle;
ChangeActorSect(actor, destactor->sector());
sfxPlay3DSound(destactor, 201, -1, 0);
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
@ -1646,7 +1646,7 @@ void OperateTeleport(sectortype* pSector)
{
playerResetInertia(pPlayer);
pPlayer->zViewVel = pPlayer->zWeaponVel = 0;
pPlayer->angle.settarget(buildang(actor->spr.ang), true);
pPlayer->angle.settarget(buildang(actor->spr.__int_angle), true);
}
}
}
@ -2352,9 +2352,9 @@ void trInit(TArray<DBloodActor*>& actors)
{
auto marker0 = pXSector->marker0;
auto marker1 = pXSector->marker1;
TranslateSector(pSector, 0, -65536, marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.ang, marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.ang, pSector->type == kSectorSlide);
TranslateSector(pSector, 0, -65536, marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.__int_angle, marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.__int_angle, pSector->type == kSectorSlide);
UpdateBasePoints(pSector);
TranslateSector(pSector, 0, pXSector->busy, marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.ang, marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.ang, pSector->type == kSectorSlide);
TranslateSector(pSector, 0, pXSector->busy, marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.__int_angle, marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.__int_angle, pSector->type == kSectorSlide);
ZTranslateSector(pSector, pXSector, pXSector->busy, 1);
break;
}
@ -2362,9 +2362,9 @@ void trInit(TArray<DBloodActor*>& actors)
case kSectorRotate:
{
auto marker0 = pXSector->marker0;
TranslateSector(pSector, 0, -65536, marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, 0, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.ang, pSector->type == kSectorRotate);
TranslateSector(pSector, 0, -65536, marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, 0, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.__int_angle, pSector->type == kSectorRotate);
UpdateBasePoints(pSector);
TranslateSector(pSector, 0, pXSector->busy, marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, 0, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.ang, pSector->type == kSectorRotate);
TranslateSector(pSector, 0, pXSector->busy, marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, 0, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.__int_angle, pSector->type == kSectorRotate);
ZTranslateSector(pSector, pXSector, pXSector->busy, 1);
break;
}
@ -2543,7 +2543,7 @@ void FireballTrapSeqCallback(int, DBloodActor* actor)
if (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)
actFireMissile(actor, 0, 0, 0, 0, (actor->spr.cstat & CSTAT_SPRITE_YFLIP) ? 0x4000 : -0x4000, kMissileFireball);
else
actFireMissile(actor, 0, 0, bcos(actor->spr.ang), bsin(actor->spr.ang), 0, kMissileFireball);
actFireMissile(actor, 0, 0, bcos(actor->spr.__int_angle), bsin(actor->spr.__int_angle), 0, kMissileFireball);
}
@ -2563,8 +2563,8 @@ void MGunFireSeqCallback(int, DBloodActor* actor)
if (actor->xspr.data2 == 0)
evPostActor(actor, 1, kCmdOff, actor);
}
int dx = bcos(actor->spr.ang) + Random2(1000);
int dy = bsin(actor->spr.ang) + Random2(1000);
int dx = bcos(actor->spr.__int_angle) + Random2(1000);
int dy = bsin(actor->spr.__int_angle) + Random2(1000);
int dz = Random2(1000);
actFireVector(actor, 0, 0, dx, dy, dz, kVectorBullet);
sfxPlay3DSound(actor, 359, -1, 0);

View file

@ -601,7 +601,7 @@ void renderCrystalBall()
int vd4 = pOther->actor->spr.y;
int vd0 = pOther->zView;
int vcc = pOther->actor->spr.sectnum;
int v50 = pOther->actor->spr.ang;
int v50 = pOther->actor->spr.__int_angle;
int v54 = 0;
if (pOther->flickerEffect)
{
@ -854,7 +854,7 @@ FString GameInterface::GetCoordString()
FString out;
out.Format("pos= %d, %d, %d - angle = %2.3f",
gMe->actor->int_pos().X, gMe->actor->int_pos().Y, gMe->actor->int_pos().Z, gMe->actor->spr.ang * BAngToDegree);
gMe->actor->int_pos().X, gMe->actor->int_pos().Y, gMe->actor->int_pos().Z, gMe->actor->spr.__int_angle * BAngToDegree);
return out;
}

View file

@ -87,7 +87,7 @@ void warpInit(TArray<DBloodActor*>& actors)
pZone->y = actor->int_pos().Y;
pZone->z = actor->int_pos().Z;
pZone->sector = actor->sector();
pZone->ang = actor->spr.ang;
pZone->ang = actor->spr.__int_angle;
}
DeleteSprite(actor);
break;
@ -100,7 +100,7 @@ void warpInit(TArray<DBloodActor*>& actors)
pZone->y = actor->int_pos().Y;
pZone->z = actor->int_pos().Z;
pZone->sector = actor->sector();
pZone->ang = actor->spr.ang;
pZone->ang = actor->spr.__int_angle;
#ifdef NOONE_EXTENSIONS
// fill player spawn position according team of player in TEAMS mode.
@ -111,7 +111,7 @@ void warpInit(TArray<DBloodActor*>& actors)
pZone->y = actor->int_pos().Y;
pZone->z = actor->int_pos().Z;
pZone->sector = actor->sector();
pZone->ang = actor->spr.ang;
pZone->ang = actor->spr.__int_angle;
team1++;
}
@ -121,7 +121,7 @@ void warpInit(TArray<DBloodActor*>& actors)
pZone->y = actor->int_pos().Y;
pZone->z = actor->int_pos().Z;
pZone->sector = actor->sector();
pZone->ang = actor->spr.ang;
pZone->ang = actor->spr.__int_angle;
team2++;
}
}

View file

@ -427,8 +427,8 @@ void UpdateAimVector(PLAYER* pPlayer)
int y = plActor->int_pos().Y;
int z = pPlayer->zWeapon;
Aim aim;
aim.dx = bcos(plActor->spr.ang);
aim.dy = bsin(plActor->spr.ang);
aim.dx = bcos(plActor->spr.__int_angle);
aim.dy = bsin(plActor->spr.__int_angle);
aim.dz = pPlayer->slope;
WEAPONTRACK* pWeaponTrack = &gWeaponTrack[pPlayer->curWeapon];
DBloodActor* targetactor = nullptr;
@ -461,8 +461,8 @@ void UpdateAimVector(PLAYER* pPlayer)
y2 += (actor->vel.Y * t) >> 12;
z2 += (actor->vel.Z * t) >> 8;
}
int lx = x + MulScale(Cos(plActor->spr.ang), nDist, 30);
int ly = y + MulScale(Sin(plActor->spr.ang), nDist, 30);
int lx = x + MulScale(Cos(plActor->spr.__int_angle), nDist, 30);
int ly = y + MulScale(Sin(plActor->spr.__int_angle), nDist, 30);
int lz = z + MulScale(pPlayer->slope, nDist, 10);
int zRange = MulScale(9460, nDist, 10);
int top, bottom;
@ -470,7 +470,7 @@ void UpdateAimVector(PLAYER* pPlayer)
if (lz - zRange > bottom || lz + zRange < top)
continue;
int angle = getangle(x2 - x, y2 - y);
if (abs(((angle - plActor->spr.ang + 1024) & 2047) - 1024) > pWeaponTrack->angleRange)
if (abs(((angle - plActor->spr.__int_angle + 1024) & 2047) - 1024) > pWeaponTrack->angleRange)
continue;
if (pPlayer->aimTargetsCount < 16 && cansee(x, y, z, plActor->sector(), x2, y2, z2, actor->sector()))
pPlayer->aimTargets[pPlayer->aimTargetsCount++] = actor;
@ -511,8 +511,8 @@ void UpdateAimVector(PLAYER* pPlayer)
int nDist = approxDist(dx, dy);
if (nDist == 0 || nDist > 51200)
continue;
int lx = x + MulScale(Cos(plActor->spr.ang), nDist, 30);
int ly = y + MulScale(Sin(plActor->spr.ang), nDist, 30);
int lx = x + MulScale(Cos(plActor->spr.__int_angle), nDist, 30);
int ly = y + MulScale(Sin(plActor->spr.__int_angle), nDist, 30);
int lz = z + MulScale(pPlayer->slope, nDist, 10);
int zRange = MulScale(9460, nDist, 10);
int top, bottom;
@ -520,7 +520,7 @@ void UpdateAimVector(PLAYER* pPlayer)
if (lz - zRange > bottom || lz + zRange < top)
continue;
int angle = getangle(dx, dy);
if (abs(((angle - plActor->spr.ang + 1024) & 2047) - 1024) > pWeaponTrack->thingAngle)
if (abs(((angle - plActor->spr.__int_angle + 1024) & 2047) - 1024) > pWeaponTrack->thingAngle)
continue;
if (pPlayer->aimTargetsCount < 16 && cansee(x, y, z, plActor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector()))
pPlayer->aimTargets[pPlayer->aimTargetsCount++] = actor;
@ -544,13 +544,13 @@ void UpdateAimVector(PLAYER* pPlayer)
}
Aim aim2;
aim2 = aim;
RotateVector((int*)&aim2.dx, (int*)&aim2.dy, -plActor->spr.ang);
RotateVector((int*)&aim2.dx, (int*)&aim2.dy, -plActor->spr.__int_angle);
aim2.dz -= pPlayer->slope;
pPlayer->relAim.dx = interpolatedvalue(pPlayer->relAim.dx, aim2.dx, pWeaponTrack->aimSpeedHorz);
pPlayer->relAim.dy = interpolatedvalue(pPlayer->relAim.dy, aim2.dy, pWeaponTrack->aimSpeedHorz);
pPlayer->relAim.dz = interpolatedvalue(pPlayer->relAim.dz, aim2.dz, pWeaponTrack->aimSpeedVert);
pPlayer->aim = pPlayer->relAim;
RotateVector((int*)&pPlayer->aim.dx, (int*)&pPlayer->aim.dy, plActor->spr.ang);
RotateVector((int*)&pPlayer->aim.dx, (int*)&pPlayer->aim.dy, plActor->spr.__int_angle);
pPlayer->aim.dz += pPlayer->slope;
pPlayer->aimTarget = targetactor;
}
@ -1970,7 +1970,7 @@ void FireLifeLeech(int nTrigger, PLAYER* pPlayer)
if (missileActor)
{
missileActor->SetTarget(pPlayer->aimTarget);
missileActor->spr.ang = (nTrigger == 2) ? 1024 : 0;
missileActor->spr.__int_angle = (nTrigger == 2) ? 1024 : 0;
}
if (checkAmmo2(pPlayer, 8, 1))
UseAmmo(pPlayer, 8, 1);

View file

@ -225,8 +225,8 @@ int ssp(DDukeActor* const actor, unsigned int cliptype) //The set sprite functio
Collision c;
return movesprite_ex(actor,
MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14),
MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14), actor->spr.zvel,
MulScale(actor->spr.xvel, bcos(actor->spr.__int_angle), 14),
MulScale(actor->spr.xvel, bsin(actor->spr.__int_angle), 14), actor->spr.zvel,
cliptype, c) == kHitNone;
}
@ -278,8 +278,8 @@ void lotsofstuff(DDukeActor* actor, int n, int spawntype)
void ms(DDukeActor* const actor)
{
//T1,T2 and T3 are used for all the sector moving stuff!!!
actor->spr.pos.X += actor->spr.xvel * buildang(actor->spr.ang).fcos() * inttoworld;
actor->spr.pos.Y += actor->spr.xvel * buildang(actor->spr.ang).fsin() * inttoworld;
actor->spr.pos.X += actor->spr.xvel * buildang(actor->spr.__int_angle).fcos() * inttoworld;
actor->spr.pos.Y += actor->spr.xvel * buildang(actor->spr.__int_angle).fsin() * inttoworld;
int j = actor->temp_data[1];
int k = actor->temp_data[2];
@ -360,7 +360,7 @@ void movedummyplayers(void)
{
act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
act->set_int_z(act->sector()->int_ceilingz() + (27 << 8));
act->spr.ang = ps[p].angle.ang.asbuild();
act->spr.__int_angle = ps[p].angle.ang.asbuild();
if (act->temp_data[0] == 8)
act->temp_data[0] = 0;
else act->temp_data[0]++;
@ -400,7 +400,7 @@ void moveplayers(void)
{
act->spr.pos = p->opos.plusZ(gs.playerheight);
act->backupz();
act->spr.ang = p->angle.oang.asbuild();
act->spr.__int_angle = p->angle.oang.asbuild();
SetActor(act, act->spr.pos);
}
else
@ -464,7 +464,7 @@ void moveplayers(void)
p->angle.addadjustment(getincanglebam(p->angle.ang, bvectangbam(p->wackedbyactor->spr.pos.X - p->pos.X, p->wackedbyactor->spr.pos.Y - p->pos.Y)) >> 1);
}
}
act->spr.ang = p->angle.ang.asbuild();
act->spr.__int_angle = p->angle.ang.asbuild();
}
}
else
@ -497,13 +497,13 @@ void moveplayers(void)
if (act->spr.extra < 8)
{
act->spr.xvel = 128;
act->spr.ang = p->angle.ang.asbuild();
act->spr.__int_angle = p->angle.ang.asbuild();
act->spr.extra++;
ssp(act, CLIPMASK0);
}
else
{
act->spr.ang = 2047 - (p->angle.ang.asbuild());
act->spr.__int_angle = 2047 - (p->angle.ang.asbuild());
SetActor(act, act->spr.pos);
}
}
@ -641,7 +641,7 @@ void movecrane(DDukeActor *actor, int crane)
case STAT_ZOMBIEACTOR:
case STAT_STANDABLE:
case STAT_PLAYER:
actor->spr.ang = getangle(cpt.pole - actor->spr.pos.XY());
actor->spr.__int_angle = getangle(cpt.pole - actor->spr.pos.XY());
SetActor(a2, DVector3( cpt.pole.X, cpt.pole.Y, a2->spr.pos.Z ));
actor->temp_data[0]++;
return;
@ -704,7 +704,7 @@ void movecrane(DDukeActor *actor, int crane)
actor->SetActiveCrane(true);
ps[p].on_crane = actor;
S_PlayActorSound(isRR() ? 390 : DUKE_GRUNT, ps[p].GetActor());
ps[p].angle.settarget(buildang(actor->spr.ang + 1024));
ps[p].angle.settarget(buildang(actor->spr.__int_angle + 1024));
}
else
{
@ -750,7 +750,7 @@ void movecrane(DDukeActor *actor, int crane)
{
if (actor->spr.xvel < 192)
actor->spr.xvel += 8;
actor->spr.ang = getangle(cpt.pos.XY() - actor->spr.pos.XY());
actor->spr.__int_angle = getangle(cpt.pos.XY() - actor->spr.pos.XY());
ssp(actor, CLIPMASK0);
if (((actor->spr.pos.X - cpt.pos.X) * (actor->spr.pos.X - cpt.pos.X) + (actor->spr.pos.Y - cpt.pos.Y) * (actor->spr.pos.Y - cpt.pos.Y)) < (8 * 8))
actor->temp_data[0]++;
@ -1120,7 +1120,7 @@ void movetouchplate(DDukeActor* actor, int plate)
if (actor->temp_data[5] == 1) return;
p = checkcursectnums(actor->sector());
if (p >= 0 && (ps[p].on_ground || actor->spr.ang == 512))
if (p >= 0 && (ps[p].on_ground || actor->spr.__int_angle == 512))
{
if (actor->temp_data[0] == 0 && !check_activator_motion(actor->spr.lotag))
{
@ -1258,8 +1258,8 @@ void movecanwithsomething(DDukeActor* actor)
void bounce(DDukeActor* actor)
{
int xvect = MulScale(actor->spr.xvel, bcos(actor->spr.ang), 10);
int yvect = MulScale(actor->spr.xvel, bsin(actor->spr.ang), 10);
int xvect = MulScale(actor->spr.xvel, bcos(actor->spr.__int_angle), 10);
int yvect = MulScale(actor->spr.xvel, bsin(actor->spr.__int_angle), 10);
int zvect = actor->spr.zvel;
auto sectp = actor->sector();
@ -1288,7 +1288,7 @@ void bounce(DDukeActor* actor)
actor->spr.zvel = zvect;
actor->spr.xvel = ksqrt(DMulScale(xvect, xvect, yvect, yvect, 8));
actor->spr.ang = getangle(xvect, yvect);
actor->spr.__int_angle = getangle(xvect, yvect);
}
//---------------------------------------------------------------------------
@ -1317,14 +1317,14 @@ void movetongue(DDukeActor *actor, int tongue, int jaw)
return;
}
actor->spr.ang = Owner->spr.ang;
actor->spr.__int_angle = Owner->spr.__int_angle;
actor->spr.pos = Owner->spr.pos.plusZ(Owner->isPlayer() ? -34 : 0);
for (int k = 0; k < actor->temp_data[0]; k++)
{
auto q = EGS(actor->sector(),
actor->int_pos().X + MulScale(k, bcos(actor->spr.ang), 9),
actor->int_pos().Y + MulScale(k, bsin(actor->spr.ang), 9),
actor->int_pos().X + MulScale(k, bcos(actor->spr.__int_angle), 9),
actor->int_pos().Y + MulScale(k, bsin(actor->spr.__int_angle), 9),
actor->int_pos().Z + ((k * Sgn(actor->spr.zvel)) * abs(actor->spr.zvel / 12)), tongue, -40 + (k << 1),
8, 8, 0, 0, 0, actor, 5);
if (q)
@ -1335,8 +1335,8 @@ void movetongue(DDukeActor *actor, int tongue, int jaw)
}
int k = actor->temp_data[0]; // do not depend on the above loop counter.
auto spawned = EGS(actor->sector(),
actor->int_pos().X + MulScale(k, bcos(actor->spr.ang), 9),
actor->int_pos().Y + MulScale(k, bsin(actor->spr.ang), 9),
actor->int_pos().X + MulScale(k, bcos(actor->spr.__int_angle), 9),
actor->int_pos().Y + MulScale(k, bsin(actor->spr.__int_angle), 9),
actor->int_pos().Z + ((k * Sgn(actor->spr.zvel)) * abs(actor->spr.zvel / 12)), jaw, -40,
32, 32, 0, 0, 0, actor, 5);
if (spawned)
@ -1423,7 +1423,7 @@ bool rat(DDukeActor* actor, bool makesound)
if (ssp(actor, CLIPMASK0))
{
if (makesound && (krand() & 255) == 0) S_PlayActorSound(RATTY, actor);
actor->spr.ang += (krand() & 31) - 15 + bsin(actor->temp_data[0] << 8, -11);
actor->spr.__int_angle += (krand() & 31) - 15 + bsin(actor->temp_data[0] << 8, -11);
}
else
{
@ -1433,11 +1433,11 @@ bool rat(DDukeActor* actor, bool makesound)
deletesprite(actor);
return false;
}
else actor->spr.ang = (krand() & 2047);
else actor->spr.__int_angle = (krand() & 2047);
}
if (actor->spr.xvel < 128)
actor->spr.xvel += 2;
actor->spr.ang += (krand() & 3) - 6;
actor->spr.__int_angle += (krand() & 3) - 6;
return true;
}
@ -1465,8 +1465,8 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
auto sect = actor->sector();
auto pos = actor->int_pos();
int j = clipmove(pos, &sect,
(MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14) * TICSPERFRAME) << 11,
(MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14) * TICSPERFRAME) << 11,
(MulScale(actor->spr.xvel, bcos(actor->spr.__int_angle), 14) * TICSPERFRAME) << 11,
(MulScale(actor->spr.xvel, bsin(actor->spr.__int_angle), 14) * TICSPERFRAME) << 11,
24L, (4 << 8), (4 << 8), CLIPMASK1, coll);
actor->set_int_pos(pos);
actor->setsector(sect);
@ -1474,7 +1474,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
if (j == kHitWall)
{
int k = getangle(coll.hitWall->delta());
actor->spr.ang = ((k << 1) - actor->spr.ang) & 2047;
actor->spr.__int_angle = ((k << 1) - actor->spr.__int_angle) & 2047;
}
else if (j == kHitSprite)
{
@ -1522,7 +1522,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
if (actor->spr.pal == 12)
actor->spr.xvel = 164;
else actor->spr.xvel = 140;
actor->spr.ang = ps[p].angle.ang.asbuild();
actor->spr.__int_angle = ps[p].angle.ang.asbuild();
ps[p].toggle_key_flag = 2;
}
}
@ -1530,7 +1530,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
}
if (x < 512 && actor->sector() == ps[p].cursector)
{
actor->spr.ang = getangle(actor->spr.pos.XY() - ps[p].pos.XY());
actor->spr.__int_angle = getangle(actor->spr.pos.XY() - ps[p].pos.XY());
actor->spr.xvel = 48;
}
}
@ -1558,7 +1558,7 @@ void forcesphere(DDukeActor* actor, int forcesphere)
{
k->spr.cstat = CSTAT_SPRITE_BLOCK_ALL | CSTAT_SPRITE_YCENTER;
k->spr.clipdist = 64;
k->spr.ang = j;
k->spr.__int_angle = j;
k->spr.zvel = bsin(l, -5);
k->spr.xvel = bcos(l, -9);
k->SetOwner(actor);
@ -1638,7 +1638,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
actor->temp_data[2]++;
if ((actor->temp_data[2] & 3) == 0) spawn(actor, explosion);
getglobalz(actor);
actor->spr.ang += 96;
actor->spr.__int_angle += 96;
actor->spr.xvel = 128;
int j = ssp(actor, CLIPMASK0);
if (j != 1 || actor->spr.pos.Z > actor->floorz)
@ -1670,11 +1670,11 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
actor->temp_data[2]++;
if ((actor->temp_data[2] & 15) == 0)
{
a = actor->spr.ang;
actor->spr.ang = actor->tempang;
a = actor->spr.__int_angle;
actor->spr.__int_angle = actor->tempang;
if (attacksnd >= 0) S_PlayActorSound(attacksnd, actor);
fi.shoot(actor, firelaser);
actor->spr.ang = a;
actor->spr.__int_angle = a;
}
if (actor->temp_data[2] > (26 * 3) || !cansee(actor->spr.pos.plusZ(-16), actor->sector(), ps[p].pos, ps[p].cursector))
{
@ -1710,7 +1710,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
fi.shoot(actor, firelaser);
}
}
actor->spr.ang += getincangle(actor->spr.ang, getangle(ps[p].pos.XY() - actor->spr.pos.XY())) >> 2;
actor->spr.__int_angle += getincangle(actor->spr.__int_angle, getangle(ps[p].pos.XY() - actor->spr.pos.XY())) >> 2;
}
if (actor->temp_data[0] != 2 && actor->temp_data[0] != 3 && Owner)
@ -1718,7 +1718,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
int l = ldist(Owner, actor);
if (l <= 1524)
{
a = actor->spr.ang;
a = actor->spr.__int_angle;
actor->spr.xvel >>= 1;
}
else a = getangle(Owner->spr.pos.XY() - actor->spr.pos.XY());
@ -1745,7 +1745,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
{
actor->temp_data[0] = 2 + (krand() & 2);
actor->temp_data[2] = 0;
actor->tempang = actor->spr.ang;
actor->tempang = actor->spr.__int_angle;
}
}
@ -1769,8 +1769,8 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
actor->SetOwner(NewOwner);
}
actor->temp_data[3] = getincangle(actor->spr.ang, a);
actor->spr.ang += actor->temp_data[3] >> 3;
actor->temp_data[3] = getincangle(actor->spr.__int_angle, a);
actor->spr.__int_angle += actor->temp_data[3] >> 3;
if (actor->spr.pos.Z < Owner->spr.pos.Z - 2)
actor->spr.pos.Z += 2;
@ -1975,28 +1975,28 @@ void camera(DDukeActor *actor)
if (setupflag != 1)
{
increment = 8;
minimum = actor->spr.ang - actor->spr.hitag - increment;
maximum = actor->spr.ang + actor->spr.hitag - increment;
minimum = actor->spr.__int_angle - actor->spr.hitag - increment;
maximum = actor->spr.__int_angle + actor->spr.hitag - increment;
setupflag = 1;
}
// update angle accordingly.
if (actor->spr.ang == minimum || actor->spr.ang == maximum)
if (actor->spr.__int_angle == minimum || actor->spr.__int_angle == maximum)
{
increment = -increment;
actor->spr.ang += increment;
actor->spr.__int_angle += increment;
}
else if (actor->spr.ang + increment < minimum)
else if (actor->spr.__int_angle + increment < minimum)
{
actor->spr.ang = minimum;
actor->spr.__int_angle = minimum;
}
else if (actor->spr.ang + increment > maximum)
else if (actor->spr.__int_angle + increment > maximum)
{
actor->spr.ang = maximum;
actor->spr.__int_angle = maximum;
}
else
{
actor->spr.ang += increment;
actor->spr.__int_angle += increment;
}
}
}
@ -2038,7 +2038,7 @@ void forcesphereexplode(DDukeActor *actor)
}
actor->spr.pos = Owner->spr.pos;;
actor->spr.ang += Owner->temp_data[0];
actor->spr.__int_angle += Owner->temp_data[0];
if (l > 64) l = 64;
else if (l < 1) l = 1;
@ -2239,7 +2239,7 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f
else actor->spr.zvel += gs.gravity - 50;
}
actor->add_int_pos({ MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14), MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14), 0 });
actor->add_int_pos({ MulScale(actor->spr.xvel, bcos(actor->spr.__int_angle), 14), MulScale(actor->spr.xvel, bsin(actor->spr.__int_angle), 14), 0 });
actor->add_int_z(actor->spr.zvel);
if (floorcheck && actor->spr.pos.Z >= actor->sector()->floorz)
@ -2514,7 +2514,7 @@ void scrap(DDukeActor* actor, int SCRAP1, int SCRAP6)
}
}
if (actor->spr.zvel < 4096) actor->spr.zvel += gs.gravity - 50;
actor->add_int_pos({ MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14), MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14), actor->spr.zvel });
actor->add_int_pos({ MulScale(actor->spr.xvel, bcos(actor->spr.__int_angle), 14), MulScale(actor->spr.xvel, bsin(actor->spr.__int_angle), 14), actor->spr.zvel });
}
else
{
@ -2649,7 +2649,7 @@ void handle_se00(DDukeActor* actor)
}
}
actor->spr.ang += (l * q);
actor->spr.__int_angle += (l * q);
actor->temp_data[2] += (l * q);
}
else
@ -2661,14 +2661,14 @@ void handle_se00(DDukeActor* actor)
return;
}
if (Owner->spr.ang > 1024)
if (Owner->spr.__int_angle > 1024)
l = -1;
else l = 1;
if (actor->temp_data[3] == 0)
actor->temp_data[3] = ldist(actor, Owner);
actor->spr.xvel = actor->temp_data[3];
actor->copyXY(Owner);
actor->spr.ang += (l * q);
actor->spr.__int_angle += (l * q);
actor->temp_data[2] += (l * q);
}
@ -2708,8 +2708,8 @@ void handle_se00(DDukeActor* actor)
continue;
}
act2->spr.ang += (l * q);
act2->spr.ang &= 2047;
act2->spr.__int_angle += (l * q);
act2->spr.__int_angle &= 2047;
act2->add_int_z(zchange);
@ -2792,10 +2792,10 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
if (actor->spr.xvel)
{
int x = getangle(Owner->spr.pos.XY() - actor->spr.pos.XY());
int q = getincangle(actor->spr.ang, x) >> 3;
int q = getincangle(actor->spr.__int_angle, x) >> 3;
actor->temp_data[2] += q;
actor->spr.ang += q;
actor->spr.__int_angle += q;
bool statstate = (!checkstat || ((sc->floorstat & CSTAT_SECTOR_SKY) == 0 && (sc->ceilingstat & CSTAT_SECTOR_SKY) == 0));
if (actor->spr.xvel == sc->extra)
@ -2810,10 +2810,10 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
int p = findplayer(actor, &x);
if (x < 20480)
{
j = actor->spr.ang;
actor->spr.ang = getangle(actor->spr.pos.XY() - ps[p].pos.XY());
j = actor->spr.__int_angle;
actor->spr.__int_angle = getangle(actor->spr.pos.XY() - ps[p].pos.XY());
fi.shoot(actor, RPG);
actor->spr.ang = j;
actor->spr.__int_angle = j;
}
}
}
@ -2843,8 +2843,8 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
}
}
int m = MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14);
x = MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14);
int m = MulScale(actor->spr.xvel, bcos(actor->spr.__int_angle), 14);
x = MulScale(actor->spr.xvel, bsin(actor->spr.__int_angle), 14);
double mm = m * inttoworld;
double xx = x * inttoworld;
@ -2897,7 +2897,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
pos.Y += x;
a2->set_int_pos(pos);
a2->spr.ang += q;
a2->spr.__int_angle += q;
if (numplayers > 1)
{
@ -2999,7 +2999,7 @@ void handle_se30(DDukeActor *actor, int JIBS6)
actor->spr.xvel = 0;
operateactivators(actor->spr.hitag + (short)actor->temp_data[3], -1);
actor->SetOwner(nullptr);
actor->spr.ang += 1024;
actor->spr.__int_angle += 1024;
actor->temp_data[4] = 0;
fi.operateforcefields(actor, actor->spr.hitag);
}
@ -3008,8 +3008,8 @@ void handle_se30(DDukeActor *actor, int JIBS6)
if (actor->spr.xvel)
{
int l = MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14);
int x = MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14);
int l = MulScale(actor->spr.xvel, bcos(actor->spr.__int_angle), 14);
int x = MulScale(actor->spr.xvel, bsin(actor->spr.__int_angle), 14);
if ((sc->int_floorz() - sc->int_ceilingz()) < (108 << 8))
if (ud.clipping == 0)
@ -3159,8 +3159,8 @@ void handle_se02(DDukeActor* actor)
else sc->setfloorslope(sc->getfloorslope() + (Sgn(actor->temp_data[5] - sc->getfloorslope()) << 4));
}
int m = MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14);
int x = MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14);
int m = MulScale(actor->spr.xvel, bcos(actor->spr.__int_angle), 14);
int x = MulScale(actor->spr.xvel, bsin(actor->spr.__int_angle), 14);
for (int p = connecthead; p >= 0; p = connectpoint2[p])
@ -3316,10 +3316,10 @@ void handle_se05(DDukeActor* actor, int FIRELASER)
int x, p = findplayer(actor, &x);
if (x < 8192)
{
j = actor->spr.ang;
actor->spr.ang = getangle(actor->spr.pos.XY() - ps[p].pos);
j = actor->spr.__int_angle;
actor->spr.__int_angle = getangle(actor->spr.pos.XY() - ps[p].pos);
fi.shoot(actor, FIRELASER);
actor->spr.ang = j;
actor->spr.__int_angle = j;
}
auto Owner = actor->GetOwner();
@ -3350,9 +3350,9 @@ void handle_se05(DDukeActor* actor, int FIRELASER)
if (ldist(Owner, actor) < 1024)
{
auto ta = actor->spr.ang;
actor->spr.ang = getangle(ps[p].pos.XY() - actor->spr.pos.XY());
actor->spr.ang = ta;
auto ta = actor->spr.__int_angle;
actor->spr.__int_angle = getangle(ps[p].pos.XY() - actor->spr.pos.XY());
actor->spr.__int_angle = ta;
actor->SetOwner(nullptr);
return;
@ -3360,8 +3360,8 @@ void handle_se05(DDukeActor* actor, int FIRELASER)
else actor->spr.xvel = 256;
x = getangle(Owner->spr.pos.XY() - actor->spr.pos.XY());
int q = getincangle(actor->spr.ang, x) >> 3;
actor->spr.ang += q;
int q = getincangle(actor->spr.__int_angle, x) >> 3;
actor->spr.__int_angle += q;
if (rnd(32))
{
@ -3667,7 +3667,7 @@ void handle_se13(DDukeActor* actor)
{
int j = (actor->spr.yvel << 5) | 1;
if (actor->spr.ang == 512)
if (actor->spr.__int_angle == 512)
{
if (actor->spriteextra)
{
@ -3699,7 +3699,7 @@ void handle_se13(DDukeActor* actor)
actor->temp_data[3]++;
sc->ceilingstat ^= CSTAT_SECTOR_SKY;
if (actor->spr.ang == 512)
if (actor->spr.__int_angle == 512)
{
for (auto& wal : wallsofsector(sc))
wal.shade = actor->spr.shade;
@ -3722,7 +3722,7 @@ void handle_se13(DDukeActor* actor)
}
if (actor->temp_data[2] == 4 && actor->spr.ang != 512)
if (actor->temp_data[2] == 4 && actor->spr.__int_angle != 512)
for (int x = 0; x < 7; x++) RANDOMSCRAP(actor);
}
@ -3931,7 +3931,7 @@ void handle_se18(DDukeActor *actor, bool morecheck)
double extra = sc->extra * zmaptoworld;
if (actor->spr.pal)
{
if (actor->spr.ang == 512)
if (actor->spr.__int_angle == 512)
{
sc->add_int_ceilingz(-sc->extra);
if (sc->int_ceilingz() <= actor->temp_data[1])
@ -3968,7 +3968,7 @@ void handle_se18(DDukeActor *actor, bool morecheck)
}
else
{
if (actor->spr.ang == 512)
if (actor->spr.__int_angle == 512)
{
sc->add_int_ceilingz(sc->extra);
if (sc->int_ceilingz() >= actor->int_pos().Z)
@ -4141,8 +4141,8 @@ void handle_se20(DDukeActor* actor)
if (actor->spr.xvel) //Moving
{
int x = MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14);
int l = MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14);
int x = MulScale(actor->spr.xvel, bcos(actor->spr.__int_angle), 14);
int l = MulScale(actor->spr.xvel, bsin(actor->spr.__int_angle), 14);
actor->temp_data[3] += actor->spr.xvel;
@ -4202,7 +4202,7 @@ void handle_se21(DDukeActor* actor)
if (actor->temp_data[0] == 0) return;
if (actor->spr.ang == 1536)
if (actor->spr.__int_angle == 1536)
lp = sc->int_ceilingz();
else
lp = sc->int_floorz();
@ -4223,7 +4223,7 @@ void handle_se21(DDukeActor* actor)
deletesprite(actor);
}
if (actor->spr.ang == 1536)
if (actor->spr.__int_angle == 1536)
sc->set_int_ceilingz(lp);
else
sc->set_int_floorz(lp);
@ -4261,8 +4261,8 @@ void handle_se26(DDukeActor* actor)
int x, l;
actor->spr.xvel = 32;
l = MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14);
x = MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14);
l = MulScale(actor->spr.xvel, bcos(actor->spr.__int_angle), 14);
x = MulScale(actor->spr.xvel, bsin(actor->spr.__int_angle), 14);
actor->spr.shade++;
if (actor->spr.shade > 7)
@ -4309,7 +4309,7 @@ void handle_se27(DDukeActor* actor)
if (ud.recstat == 0) return;
actor->tempang = actor->spr.ang;
actor->tempang = actor->spr.__int_angle;
p = findplayer(actor, &x);
if (ps[p].GetActor()->spr.extra > 0 && myconnectindex == screenpeek)
@ -4327,7 +4327,7 @@ void handle_se27(DDukeActor* actor)
{
ud.cameraactor = actor;
actor->temp_data[0] = 999;
actor->spr.ang += getincangle(actor->spr.ang, getangle(ps[p].pos.XY() - actor->spr.pos.XY())) >> 3;
actor->spr.__int_angle += getincangle(actor->spr.__int_angle, getangle(ps[p].pos.XY() - actor->spr.pos.XY())) >> 3;
actor->spr.yvel = 100 + int((actor->spr.pos.Z - ps[p].pos.Z) * (256. / 257.));
}
@ -4342,7 +4342,7 @@ void handle_se27(DDukeActor* actor)
}
else
{
actor->spr.ang = getangle(ps[p].pos.XY() - actor->spr.pos.XY());
actor->spr.__int_angle = getangle(ps[p].pos.XY() - actor->spr.pos.XY());
if (actor->temp_data[0] == 999)
{
@ -4366,8 +4366,8 @@ void handle_se24(DDukeActor *actor, bool scroll, int shift)
{
if (actor->temp_data[4]) return;
int x = MulScale(actor->spr.yvel, bcos(actor->spr.ang), 18);
int y = MulScale(actor->spr.yvel, bsin(actor->spr.ang), 18);
int x = MulScale(actor->spr.yvel, bcos(actor->spr.__int_angle), 18);
int y = MulScale(actor->spr.yvel, bsin(actor->spr.__int_angle), 18);
DukeSectIterator it(actor->sector());
while (auto a2 = it.Next())
@ -4472,7 +4472,7 @@ void handle_se32(DDukeActor *actor)
if (actor->temp_data[2] == 1) // Retract
{
if (actor->spr.ang != 1536)
if (actor->spr.__int_angle != 1536)
{
if (abs(sc->int_ceilingz() - actor->int_pos().Z) < (actor->spr.yvel << 1))
{
@ -4497,7 +4497,7 @@ void handle_se32(DDukeActor *actor)
return;
}
if ((actor->spr.ang & 2047) == 1536)
if ((actor->spr.__int_angle & 2047) == 1536)
{
if (abs(sc->int_ceilingz() - actor->int_pos().Z) < (actor->spr.yvel << 1))
{
@ -4535,7 +4535,7 @@ void handle_se35(DDukeActor *actor, int SMALLSMOKE, int EXPLOSION2)
if (sc->int_ceilingz() > actor->int_pos().Z)
for (int j = 0; j < 8; j++)
{
actor->spr.ang += krand() & 511;
actor->spr.__int_angle += krand() & 511;
auto spawned = spawn(actor, SMALLSMOKE);
if (spawned)
{
@ -4631,7 +4631,7 @@ void handle_se130(DDukeActor *actor, int countmax, int EXPLOSION2)
{
k->spr.xrepeat = k->spr.yrepeat = 2 + (krand() & 7);
k->set_int_z(sc->int_floorz() - (krand() % x));
k->spr.ang += 256 - (krand() % 511);
k->spr.__int_angle += 256 - (krand() % 511);
k->spr.xvel = krand() & 127;
ssp(k, CLIPMASK0);
}
@ -4660,7 +4660,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
if (actor->temp_data[2] == 1) // Retract
{
if (actor->spr.ang != 1536)
if (actor->spr.__int_angle != 1536)
{
if (abs(sec->int_floorz() - actor->int_pos().Z) < actor->spr.yvel)
{
@ -4721,7 +4721,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
return;
}
if ((actor->spr.ang & 2047) == 1536)
if ((actor->spr.__int_angle & 2047) == 1536)
{
if (abs(actor->int_pos().Z - sec->int_floorz()) < actor->spr.yvel)
{
@ -4906,16 +4906,16 @@ int dodge(DDukeActor* actor)
bx = ac->int_pos().X - mx;
by = ac->int_pos().Y - my;
bxvect = bcos(ac->spr.ang);
byvect = bsin(ac->spr.ang);
bxvect = bcos(ac->spr.__int_angle);
byvect = bsin(ac->spr.__int_angle);
if (bcos(actor->spr.ang) * bx + bsin(actor->spr.ang) * by >= 0)
if (bcos(actor->spr.__int_angle) * bx + bsin(actor->spr.__int_angle) * by >= 0)
if (bxvect * bx + byvect * by < 0)
{
d = bxvect * by - byvect * bx;
if (abs(d) < 65536 * 64)
{
actor->spr.ang -= 512 + (krand() & 1024);
actor->spr.__int_angle -= 512 + (krand() & 1024);
return 1;
}
}
@ -4939,9 +4939,9 @@ int furthestangle(DDukeActor *actor, int angs)
angincs = 2048 / angs;
if (!actor->isPlayer())
if ((actor->temp_data[0] & 63) > 2) return(actor->spr.ang + 1024);
if ((actor->temp_data[0] & 63) > 2) return(actor->spr.__int_angle + 1024);
for (j = actor->spr.ang; j < (2048 + actor->spr.ang); j += angincs)
for (j = actor->spr.__int_angle; j < (2048 + actor->spr.__int_angle); j += angincs)
{
hitscan({ actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (8 << 8) }, actor->sector(), { bcos(j), bsin(j), 0 }, hit, CLIPMASK1);
@ -4974,7 +4974,7 @@ int furthestcanseepoint(DDukeActor *actor, DDukeActor* tosee, int* dax, int* day
angincs = 2048 / 2;
else angincs = 2048 / (1 + (krand() & 1));
for (j = tosee->spr.ang; j < (2048 + tosee->spr.ang); j += (angincs - (krand() & 511)))
for (j = tosee->spr.__int_angle; j < (2048 + tosee->spr.__int_angle); j += (angincs - (krand() & 511)))
{
hitscan({ tosee->int_pos().X, tosee->int_pos().Y, tosee->int_pos().Z - (16 << 8) }, tosee->sector(), { bcos(j), bsin(j), 16384 - (krand() & 32767) }, hit, CLIPMASK1);
@ -5007,13 +5007,13 @@ void alterang(int ang, DDukeActor* actor, int playernum)
ticselapsed = (actor->temp_data[0]) & 31;
aang = actor->spr.ang;
aang = actor->spr.__int_angle;
actor->spr.xvel += (*moveptr - actor->spr.xvel) / 5;
if (actor->spr.zvel < 648) actor->spr.zvel += ((*(moveptr + 1) << 4) - actor->spr.zvel) / 5;
if (isRRRA() && (ang & windang))
actor->spr.ang = WindDir;
actor->spr.__int_angle = WindDir;
else if (ang & seekplayer)
{
DDukeActor* holoduke = !isRR()? ps[playernum].holoduke_on.Get() : nullptr;
@ -5039,18 +5039,18 @@ void alterang(int ang, DDukeActor* actor, int playernum)
if (abs(angdif) < 256)
{
j = 128 - (krand() & 256);
actor->spr.ang += j;
actor->spr.__int_angle += j;
if (hits(actor) < 844)
actor->spr.ang -= j;
actor->spr.__int_angle -= j;
}
}
else if (ticselapsed > 18 && ticselapsed < 26) // choose
{
if (abs(angdif >> 2) < 128) actor->spr.ang = goalang;
else actor->spr.ang += angdif >> 2;
if (abs(angdif >> 2) < 128) actor->spr.__int_angle = goalang;
else actor->spr.__int_angle += angdif >> 2;
}
}
else actor->spr.ang = goalang;
else actor->spr.__int_angle = goalang;
}
if (ticselapsed < 1)
@ -5059,14 +5059,14 @@ void alterang(int ang, DDukeActor* actor, int playernum)
if (ang & furthestdir)
{
goalang = furthestangle(actor, j);
actor->spr.ang = goalang;
actor->spr.__int_angle = goalang;
actor->SetOwner(ps[playernum].GetActor());
}
if (ang & fleeenemy)
{
goalang = furthestangle(actor, j);
actor->spr.ang = goalang; // += angdif; // = getincangle(aang,goalang)>>1;
actor->spr.__int_angle = goalang; // += angdif; // = getincangle(aang,goalang)>>1;
}
}
}
@ -5244,7 +5244,7 @@ void movefta(void)
// SFLAG_MOVEFTA_CHECKSEE is set for all actors in Duke.
if (act->spr.pal == 33 || actorflag(act, SFLAG_MOVEFTA_CHECKSEE) ||
(actorflag(act, SFLAG_MOVEFTA_CHECKSEEWITHPAL8) && act->spr.pal == 8) ||
(bcos(act->spr.ang) * (px - sx) + bsin(act->spr.ang) * (py - sy) >= 0))
(bcos(act->spr.__int_angle) * (px - sx) + bsin(act->spr.__int_angle) * (py - sy) >= 0))
{
double r1 = zrand(32);
double r2 = zrand(52);

View file

@ -478,14 +478,14 @@ int movesprite_ex_d(DDukeActor* actor, int xchange, int ychange, int zchange, un
)
{
if (dasectp && dasectp->lotag == ST_1_ABOVE_WATER && actor->spr.picnum == LIZMAN)
actor->spr.ang = (krand()&2047);
actor->spr.__int_angle = (krand()&2047);
else if ((actor->temp_data[0]&3) == 1 && actor->spr.picnum != COMMANDER)
actor->spr.ang = (krand()&2047);
actor->spr.__int_angle = (krand()&2047);
SetActor(actor,actor->int_pos());
if (dasectp == nullptr) dasectp = &sector[0];
return result.setSector(dasectp);
}
if ((result.type == kHitWall || result.type == kHitSprite) && (actor->cgg == 0)) actor->spr.ang += 768;
if ((result.type == kHitWall || result.type == kHitSprite) && (actor->cgg == 0)) actor->spr.__int_angle += 768;
}
else
{
@ -710,7 +710,7 @@ void movefallers_d(void)
if (act->temp_data[0] == 0)
{
act->spr.pos.Z -= 16;
act->temp_data[1] = act->spr.ang;
act->temp_data[1] = act->spr.__int_angle;
x = act->spr.extra;
j = fi.ifhitbyweapon(act);
if (j >= 0)
@ -739,7 +739,7 @@ void movefallers_d(void)
act->spr.extra = x;
}
}
act->spr.ang = act->temp_data[1];
act->spr.__int_angle = act->temp_data[1];
act->add_int_z(+(16 << 8));
}
else if (act->temp_data[0] == 1)
@ -831,7 +831,7 @@ static void movetripbomb(DDukeActor *actor)
auto spawned = spawn(actor, EXPLOSION2);
if (spawned)
{
spawned->spr.ang = actor->spr.ang;
spawned->spr.__int_angle = actor->spr.__int_angle;
spawned->spr.xvel = 348;
ssp(spawned, CLIPMASK0);
}
@ -850,14 +850,14 @@ static void movetripbomb(DDukeActor *actor)
{
x = actor->spr.extra;
actor->spr.extra = 1;
int16_t l = actor->spr.ang;
int16_t l = actor->spr.__int_angle;
j = fi.ifhitbyweapon(actor);
if (j >= 0)
{
actor->temp_data[2] = 16;
}
actor->spr.extra = x;
actor->spr.ang = l;
actor->spr.__int_angle = l;
}
if (actor->temp_data[0] < 32)
@ -868,8 +868,8 @@ static void movetripbomb(DDukeActor *actor)
}
if (actor->temp_data[0] == 32)
{
int16_t l = actor->spr.ang;
actor->spr.ang = actor->temp_data[5];
int16_t l = actor->spr.__int_angle;
actor->spr.__int_angle = actor->temp_data[5];
actor->temp_data[3] = actor->int_pos().X; actor->temp_data[4] = actor->int_pos().Y;
actor->add_int_pos({ bcos(actor->temp_data[5], -9), bsin(actor->temp_data[5], -9), -(3 << 8) });
@ -886,7 +886,7 @@ static void movetripbomb(DDukeActor *actor)
actor->ovel.X = x;
actor->spr.ang = l;
actor->spr.__int_angle = l;
if (lTripBombControl & TRIPBOMB_TRIPWIRE)
{
@ -968,7 +968,7 @@ static void movecrack(DDukeActor* actor)
if (actor->spr.hitag > 0)
{
actor->temp_data[0] = actor->spr.cstat;
actor->temp_data[1] = actor->spr.ang;
actor->temp_data[1] = actor->spr.__int_angle;
int j = fi.ifhitbyweapon(actor);
if (gs.actorinfo[j].flags2 & SFLAG2_EXPLOSIVE)
{
@ -984,7 +984,7 @@ static void movecrack(DDukeActor* actor)
else
{
actor->spr.cstat = ESpriteFlags::FromInt(actor->temp_data[0]);
actor->spr.ang = actor->temp_data[1];
actor->spr.__int_angle = actor->temp_data[1];
actor->spr.extra = 0;
}
}
@ -1417,7 +1417,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const vec3_t &oldpos)
(wal->overpicnum == MIRROR || wal->picnum == MIRROR))
{
int k = getangle(wal->delta());
proj->spr.ang = ((k << 1) - proj->spr.ang) & 2047;
proj->spr.__int_angle = ((k << 1) - proj->spr.__int_angle) & 2047;
proj->SetOwner(proj);
spawn(proj, TRANSPORTERSTAR);
return true;
@ -1436,7 +1436,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const vec3_t &oldpos)
}
int k = getangle(wal->delta());
proj->spr.ang = ((k << 1) - proj->spr.ang) & 2047;
proj->spr.__int_angle = ((k << 1) - proj->spr.__int_angle) & 2047;
return true;
}
}
@ -1537,8 +1537,8 @@ static void weaponcommon_d(DDukeActor* proj)
Collision coll;
movesprite_ex(proj,
MulScale(k, bcos(proj->spr.ang), 14),
MulScale(k, bsin(proj->spr.ang), 14), ll, CLIPMASK1, coll);
MulScale(k, bcos(proj->spr.__int_angle), 14),
MulScale(k, bsin(proj->spr.__int_angle), 14), ll, CLIPMASK1, coll);
if (proj->spr.picnum == RPG && proj->temp_actor != nullptr)
if (FindDistance2D(proj->int_pos().vec2 - proj->temp_actor->int_pos().vec2) < 256)
@ -1572,8 +1572,8 @@ static void weaponcommon_d(DDukeActor* proj)
for (k = -3; k < 2; k++)
{
vec3_t offset = {
MulScale(k, bcos(proj->spr.ang), 9),
MulScale(k, bsin(proj->spr.ang), 9),
MulScale(k, bcos(proj->spr.__int_angle), 9),
MulScale(k, bsin(proj->spr.__int_angle), 9),
(k * Sgn(proj->spr.zvel)) * abs(proj->spr.zvel / 24)
};
@ -1797,7 +1797,7 @@ void movetransports_d(void)
ps[k].GetActor()->spr.extra = 0;
}
ps[p].angle.ang = buildang(Owner->spr.ang);
ps[p].angle.ang = buildang(Owner->spr.__int_angle);
if (Owner->GetOwner() != Owner)
{
@ -1979,7 +1979,7 @@ void movetransports_d(void)
if (k && sectlotag == 1 && act2->spr.statnum == 4)
{
k->spr.xvel = act2->spr.xvel >> 1;
k->spr.ang = act2->spr.ang;
k->spr.__int_angle = act2->spr.__int_angle;
ssp(k, CLIPMASK0);
}
}
@ -1992,7 +1992,7 @@ void movetransports_d(void)
if (act2->spr.statnum == STAT_PROJECTILE || (checkcursectnums(act->sector()) == -1 && checkcursectnums(Owner->sector()) == -1))
{
act2->add_int_pos({ (Owner->int_pos().X - act->int_pos().X),(Owner->int_pos().Y - act->int_pos().Y), -(act->int_pos().Z - Owner->sector()->int_floorz()) });
act2->spr.ang = Owner->spr.ang;
act2->spr.__int_angle = Owner->spr.__int_angle;
act2->backupang();
@ -2148,7 +2148,7 @@ static void greenslime(DDukeActor *actor)
SetActor(actor, actor->spr.pos);
actor->spr.ang = ps[p].angle.ang.asbuild();
actor->spr.__int_angle = ps[p].angle.ang.asbuild();
if ((PlayerInput(p, SB_FIRE) || (ps[p].quick_kick > 0)) && ps[p].GetActor()->spr.extra > 0)
if (ps[p].quick_kick > 0 || (ps[p].curr_weapon != HANDREMOTE_WEAPON && ps[p].curr_weapon != HANDBOMB_WEAPON && ps[p].curr_weapon != TRIPBOMB_WEAPON && ps[p].ammo_amount[ps[p].curr_weapon] >= 0))
@ -2301,7 +2301,7 @@ static void greenslime(DDukeActor *actor)
{
s5->spr.xvel = 0;
int l = s5->spr.ang;
int l = s5->spr.__int_angle;
actor->set_int_pos({ s5->int_pos().X + bcos(l, -11), s5->int_pos().Y + bsin(l, -11), s5->int_pos().Z });
@ -2382,7 +2382,7 @@ static void greenslime(DDukeActor *actor)
if (actor->spr.xvel < 32) actor->spr.xvel += 4;
actor->spr.xvel = 64 - bcos(actor->temp_data[1], -9);
actor->spr.ang += getincangle(actor->spr.ang,
actor->spr.__int_angle += getincangle(actor->spr.__int_angle,
getangle(ps[p].pos.XY() - actor->spr.pos.XY())) >> 3;
// TJR
}
@ -2482,8 +2482,8 @@ static void flamethrowerflame(DDukeActor *actor)
}
Collision coll;
movesprite_ex(actor, MulScale(xvel, bcos(actor->spr.ang), 14),
MulScale(xvel, bsin(actor->spr.ang), 14), actor->spr.zvel, CLIPMASK1, coll);
movesprite_ex(actor, MulScale(xvel, bcos(actor->spr.__int_angle), 14),
MulScale(xvel, bsin(actor->spr.__int_angle), 14), actor->spr.zvel, CLIPMASK1, coll);
if (!actor->insector())
{
@ -2604,8 +2604,8 @@ static void heavyhbomb(DDukeActor *actor)
Collision coll;
movesprite_ex(actor,
MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14),
MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14),
MulScale(actor->spr.xvel, bcos(actor->spr.__int_angle), 14),
MulScale(actor->spr.xvel, bsin(actor->spr.__int_angle), 14),
actor->spr.zvel, CLIPMASK0, coll);
if (actor->sector()->lotag == 1 && actor->spr.zvel == 0)
@ -2650,7 +2650,7 @@ static void heavyhbomb(DDukeActor *actor)
int k = getangle(wal->delta());
actor->spr.ang = ((k << 1) - actor->spr.ang) & 2047;
actor->spr.__int_angle = ((k << 1) - actor->spr.__int_angle) & 2047;
actor->spr.xvel >>= 1;
}
@ -3511,26 +3511,26 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
if (ps[playernum].newOwner != nullptr)
goalang = getangle(ps[playernum].opos.XY() - actor->spr.pos.XY());
else goalang = getangle(ps[playernum].pos.XY() - actor->spr.pos.XY());
angdif = getincangle(actor->spr.ang, goalang) >> 2;
angdif = getincangle(actor->spr.__int_angle, goalang) >> 2;
if (angdif > -8 && angdif < 0) angdif = 0;
actor->spr.ang += angdif;
actor->spr.__int_angle += angdif;
}
if (a & spin)
actor->spr.ang += bsin(actor->temp_data[0] << 3, -6);
actor->spr.__int_angle += bsin(actor->temp_data[0] << 3, -6);
if (a & face_player_slow)
{
if (ps[playernum].newOwner != nullptr)
goalang = getangle(ps[playernum].opos.XY() - actor->spr.pos.XY());
else goalang = getangle(ps[playernum].pos.XY() - actor->spr.pos.XY());
angdif = Sgn(getincangle(actor->spr.ang, goalang)) << 5;
angdif = Sgn(getincangle(actor->spr.__int_angle, goalang)) << 5;
if (angdif > -32 && angdif < 0)
{
angdif = 0;
actor->spr.ang = goalang;
actor->spr.__int_angle = goalang;
}
actor->spr.ang += angdif;
actor->spr.__int_angle += angdif;
}
@ -3545,9 +3545,9 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
double newx = ps[playernum].pos.X + (ps[playernum].vel.X / 768) * inttoworld;
double newy = ps[playernum].pos.Y + (ps[playernum].vel.Y / 768) * inttoworld;
goalang = getangle(newx - actor->spr.pos.X, newy - actor->spr.pos.Y);
angdif = getincangle(actor->spr.ang, goalang) >> 2;
angdif = getincangle(actor->spr.__int_angle, goalang) >> 2;
if (angdif > -8 && angdif < 0) angdif = 0;
actor->spr.ang += angdif;
actor->spr.__int_angle += angdif;
}
if (actor->temp_data[1] == 0 || a == 0)
@ -3641,7 +3641,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
actor->spr.pos.Z = actor->ceilingz + 32;
daxvel = actor->spr.xvel;
angdif = actor->spr.ang;
angdif = actor->spr.__int_angle;
if (a && actor->spr.picnum != ROTATEGUN)
{

View file

@ -394,14 +394,14 @@ int movesprite_ex_r(DDukeActor* actor, int xchange, int ychange, int zchange, un
if (dasectp == nullptr || (dasectp != nullptr && actor->actorstayput != nullptr && actor->actorstayput != dasectp))
{
if (dasectp && dasectp->lotag == ST_1_ABOVE_WATER)
actor->spr.ang = (krand() & 2047);
actor->spr.__int_angle = (krand() & 2047);
else if ((actor->temp_data[0] & 3) == 1)
actor->spr.ang = (krand() & 2047);
actor->spr.__int_angle = (krand() & 2047);
SetActor(actor, actor->spr.pos);
if (dasectp == nullptr) dasectp = &sector[0];
return result.setSector(dasectp);
}
if ((result.type == kHitWall || result.type == kHitSprite) && (actor->cgg == 0)) actor->spr.ang += 768;
if ((result.type == kHitWall || result.type == kHitSprite) && (actor->cgg == 0)) actor->spr.__int_angle += 768;
}
else
{
@ -631,7 +631,7 @@ void movefallers_r(void)
if (act->temp_data[0] == 0)
{
act->spr.pos.Z -= 16;
act->temp_data[1] = act->spr.ang;
act->temp_data[1] = act->spr.__int_angle;
int x = act->spr.extra;
int j = fi.ifhitbyweapon(act);
if (j >= 0)
@ -660,7 +660,7 @@ void movefallers_r(void)
act->spr.extra = x;
}
}
act->spr.ang = act->temp_data[1];
act->spr.__int_angle = act->temp_data[1];
act->spr.pos.Z += 16;
}
else if (act->temp_data[0] == 1)
@ -724,7 +724,7 @@ static void movecrack(DDukeActor* actor)
if (actor->spr.hitag > 0)
{
actor->temp_data[0] = actor->spr.cstat;
actor->temp_data[1] = actor->spr.ang;
actor->temp_data[1] = actor->spr.__int_angle;
int j = fi.ifhitbyweapon(actor);
if (gs.actorinfo[j].flags2 & SFLAG2_EXPLOSIVE)
{
@ -740,7 +740,7 @@ static void movecrack(DDukeActor* actor)
else
{
actor->spr.cstat = ESpriteFlags::FromInt(actor->temp_data[0]);
actor->spr.ang = actor->temp_data[1];
actor->spr.__int_angle = actor->temp_data[1];
actor->spr.extra = 0;
}
}
@ -936,24 +936,24 @@ static void chickenarrow(DDukeActor* actor)
{
int ang, ang2, ang3;
ang = getangle(ts->int_pos().X - actor->int_pos().X, ts->int_pos().Y - actor->int_pos().Y);
ang2 = ang - actor->spr.ang;
ang2 = ang - actor->spr.__int_angle;
ang3 = abs(ang2);
if (ang2 < 100)
{
if (ang3 > 1023)
actor->spr.ang += 51;
actor->spr.__int_angle += 51;
else
actor->spr.ang -= 51;
actor->spr.__int_angle -= 51;
}
else if (ang2 > 100)
{
if (ang3 > 1023)
actor->spr.ang -= 51;
actor->spr.__int_angle -= 51;
else
actor->spr.ang += 51;
actor->spr.__int_angle += 51;
}
else
actor->spr.ang = ang;
actor->spr.__int_angle = ang;
if (actor->spr.hitag > 180)
if (actor->spr.zvel <= 0)
@ -1053,7 +1053,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const vec3_t& oldpos)
if (proj->spr.picnum != RPG && (!isRRRA() || proj->spr.picnum != RPG2) && proj->spr.picnum != FREEZEBLAST && proj->spr.picnum != SPIT && proj->spr.picnum != SHRINKSPARK && (wal->overpicnum == MIRROR || wal->picnum == MIRROR))
{
int k = getangle(wal->delta());
proj->spr.ang = ((k << 1) - proj->spr.ang) & 2047;
proj->spr.__int_angle = ((k << 1) - proj->spr.__int_angle) & 2047;
proj->SetOwner(proj);
spawn(proj, TRANSPORTERSTAR);
return true;
@ -1076,7 +1076,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const vec3_t& oldpos)
}
int k = getangle(wal->delta());
proj->spr.ang = ((k << 1) - proj->spr.ang) & 2047;
proj->spr.__int_angle = ((k << 1) - proj->spr.__int_angle) & 2047;
return true;
}
if (proj->spr.picnum == SHRINKSPARK)
@ -1087,7 +1087,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const vec3_t& oldpos)
}
if (proj->spr.extra <= 0)
{
proj->add_int_pos({ bcos(proj->spr.ang, -7), bsin(proj->spr.ang, -7), 0 });
proj->add_int_pos({ bcos(proj->spr.__int_angle, -7), bsin(proj->spr.__int_angle, -7), 0 });
auto Owner = proj->GetOwner();
if (!isRRRA() || !Owner || (Owner->spr.picnum != CHEER && Owner->spr.picnum != CHEERSTAYPUT))
{
@ -1097,7 +1097,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const vec3_t& oldpos)
j->spr.xrepeat = 8;
j->spr.yrepeat = 8;
j->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL;
j->spr.ang = (j->spr.ang + 512) & 2047;
j->spr.__int_angle = (j->spr.__int_angle + 512) & 2047;
j->spr.clipdist = MulScale(proj->spr.xrepeat, tileWidth(proj->spr.picnum), 7);
}
}
@ -1111,7 +1111,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const vec3_t& oldpos)
}
int k = getangle(wal->delta());
proj->spr.ang = ((k << 1) - proj->spr.ang) & 2047;
proj->spr.__int_angle = ((k << 1) - proj->spr.__int_angle) & 2047;
return true;
}
}
@ -1229,8 +1229,8 @@ static void weaponcommon_r(DDukeActor *proj)
Collision coll;
movesprite_ex(proj,
MulScale(k, bcos(proj->spr.ang), 14),
MulScale(k, bsin(proj->spr.ang), 14), ll, CLIPMASK1, coll);
MulScale(k, bcos(proj->spr.__int_angle), 14),
MulScale(k, bsin(proj->spr.__int_angle), 14), ll, CLIPMASK1, coll);
if ((proj->spr.picnum == RPG || (isRRRA() && isIn(proj->spr.picnum, RPG2, RRTILE1790))) && proj->temp_actor != nullptr)
if (FindDistance2D(proj->int_pos().vec2 - proj->temp_actor->int_pos().vec2) < 256)
@ -1263,8 +1263,8 @@ static void weaponcommon_r(DDukeActor *proj)
for (k = -3; k < 2; k++)
{
auto x = EGS(proj->sector(),
proj->int_pos().X + MulScale(k, bcos(proj->spr.ang), 9),
proj->int_pos().Y + MulScale(k, bsin(proj->spr.ang), 9),
proj->int_pos().X + MulScale(k, bcos(proj->spr.__int_angle), 9),
proj->int_pos().Y + MulScale(k, bsin(proj->spr.__int_angle), 9),
proj->int_pos().Z + ((k * Sgn(proj->spr.zvel)) * abs(proj->spr.zvel / 24)), FIRELASER, -40 + (k << 2),
proj->spr.xrepeat, proj->spr.yrepeat, 0, 0, 0, proj->GetOwner(), 5);
@ -1447,7 +1447,7 @@ void movetransports_r(void)
ps[k].GetActor()->spr.extra = 0;
}
ps[p].angle.ang = buildang(Owner->spr.ang);
ps[p].angle.ang = buildang(Owner->spr.__int_angle);
if (Owner->GetOwner() != Owner)
{
@ -1658,7 +1658,7 @@ void movetransports_r(void)
if (spawned && sectlotag == 1 && act2->spr.statnum == 4)
{
spawned->spr.xvel = act2->spr.xvel >> 1;
spawned->spr.ang = act2->spr.ang;
spawned->spr.__int_angle = act2->spr.__int_angle;
ssp(spawned, CLIPMASK0);
}
}
@ -1671,7 +1671,7 @@ void movetransports_r(void)
if (checkcursectnums(act->sector()) == -1 && checkcursectnums(Owner->sector()) == -1)
{
act2->add_int_pos({ (Owner->int_pos().X - act->int_pos().X), (Owner->int_pos().Y - act->int_pos().Y), -(act->int_pos().Z - Owner->sector()->int_floorz()) });
act2->spr.ang = Owner->spr.ang;
act2->spr.__int_angle = Owner->spr.__int_angle;
act2->backupang();
@ -1728,8 +1728,8 @@ void movetransports_r(void)
ChangeActorSect(act2, Owner->sector());
movesprite_ex(act2, MulScale(act2->spr.xvel, bcos(act2->spr.ang), 14),
MulScale(act2->spr.xvel, bsin(act2->spr.ang), 14), 0, CLIPMASK1, coll);
movesprite_ex(act2, MulScale(act2->spr.xvel, bcos(act2->spr.__int_angle), 14),
MulScale(act2->spr.xvel, bsin(act2->spr.__int_angle), 14), 0, CLIPMASK1, coll);
break;
case 161:
@ -1740,8 +1740,8 @@ void movetransports_r(void)
ChangeActorSect(act2, Owner->sector());
movesprite_ex(act2, MulScale(act2->spr.xvel, bcos(act2->spr.ang), 14),
MulScale(act2->spr.xvel, bsin(act2->spr.ang), 14), 0, CLIPMASK1, coll);
movesprite_ex(act2, MulScale(act2->spr.xvel, bcos(act2->spr.__int_angle), 14),
MulScale(act2->spr.xvel, bsin(act2->spr.__int_angle), 14), 0, CLIPMASK1, coll);
break;
}
@ -1947,8 +1947,8 @@ static void rrra_specialstats()
S_PlaySound(183);
act->spr.extra--;
int j = movesprite_ex(act,
MulScale(act->spr.hitag, bcos(act->spr.ang), 14),
MulScale(act->spr.hitag, bsin(act->spr.ang), 14),
MulScale(act->spr.hitag, bcos(act->spr.__int_angle), 14),
MulScale(act->spr.hitag, bsin(act->spr.__int_angle), 14),
act->spr.hitag << 1, CLIPMASK0, coll);
if (j > 0)
{
@ -2175,7 +2175,7 @@ void rr_specialstats()
act->spr.lotag--;
if (act->spr.lotag < 0)
{
spawn(act, RRTILE3190)->spr.ang = act->spr.ang;
spawn(act, RRTILE3190)->spr.__int_angle = act->spr.__int_angle;
act->spr.lotag = 128;
}
break;
@ -2183,7 +2183,7 @@ void rr_specialstats()
act->spr.lotag--;
if (act->spr.lotag < 0)
{
spawn(act, RRTILE3192)->spr.ang = act->spr.ang;
spawn(act, RRTILE3192)->spr.__int_angle = act->spr.__int_angle;
act->spr.lotag = 256;
}
break;
@ -2208,7 +2208,7 @@ void rr_specialstats()
act->spr.lotag--;
if (act->spr.lotag < 0)
{
spawn(act, RRTILE3120)->spr.ang = act->spr.ang;
spawn(act, RRTILE3120)->spr.__int_angle = act->spr.__int_angle;
act->spr.lotag = 448;
}
break;
@ -2216,7 +2216,7 @@ void rr_specialstats()
act->spr.lotag--;
if (act->spr.lotag < 0)
{
spawn(act, RRTILE3122)->spr.ang = act->spr.ang;
spawn(act, RRTILE3122)->spr.__int_angle = act->spr.__int_angle;
act->spr.lotag = 64;
}
break;
@ -2224,7 +2224,7 @@ void rr_specialstats()
act->spr.lotag--;
if (act->spr.lotag < 0)
{
spawn(act, RRTILE3123)->spr.ang = act->spr.ang;
spawn(act, RRTILE3123)->spr.__int_angle = act->spr.__int_angle;
act->spr.lotag = 512;
}
break;
@ -2232,7 +2232,7 @@ void rr_specialstats()
act->spr.lotag--;
if (act->spr.lotag < 0)
{
spawn(act, RRTILE3124)->spr.ang = act->spr.ang;
spawn(act, RRTILE3124)->spr.__int_angle = act->spr.__int_angle;
act->spr.lotag = 224;
}
break;
@ -2292,7 +2292,7 @@ void rr_specialstats()
{
if (act2->spr.picnum == RRTILE297)
{
ps[p].angle.ang = buildang(act2->spr.ang);
ps[p].angle.ang = buildang(act2->spr.__int_angle);
ps[p].getposfromactor(act2, -36);
ps[p].backupxyz();
ps[p].setbobpos();
@ -2379,8 +2379,8 @@ static void heavyhbomb(DDukeActor *actor)
Collision coll;
movesprite_ex(actor,
MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14),
MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14),
MulScale(actor->spr.xvel, bcos(actor->spr.__int_angle), 14),
MulScale(actor->spr.xvel, bsin(actor->spr.__int_angle), 14),
actor->spr.zvel, CLIPMASK0, coll);
if (actor->sector()->lotag == 1 && actor->spr.zvel == 0)
@ -2444,7 +2444,7 @@ static void heavyhbomb(DDukeActor *actor)
actor->spr.xvel = 0;
goto DETONATEB;
}
actor->spr.ang = ((k << 1) - actor->spr.ang) & 2047;
actor->spr.__int_angle = ((k << 1) - actor->spr.__int_angle) & 2047;
actor->spr.xvel >>= 1;
}
@ -2567,15 +2567,15 @@ static int henstand(DDukeActor *actor)
makeitfall(actor);
Collision coll;
movesprite_ex(actor,
MulScale(bcos(actor->spr.ang), actor->spr.xvel, 14),
MulScale(bsin(actor->spr.ang), actor->spr.xvel, 14),
MulScale(bcos(actor->spr.__int_angle), actor->spr.xvel, 14),
MulScale(bsin(actor->spr.__int_angle), actor->spr.xvel, 14),
actor->spr.zvel, CLIPMASK0, coll);
if (coll.type)
{
if (coll.type == kHitWall)
{
int k = getangle(coll.hitWall->delta());
actor->spr.ang = ((k << 1) - actor->spr.ang) & 2047;
actor->spr.__int_angle = ((k << 1) - actor->spr.__int_angle) & 2047;
}
else if (coll.type == kHitSprite)
{
@ -2589,7 +2589,7 @@ static int henstand(DDukeActor *actor)
{
ns->spr.xvel = 32;
ns->spr.lotag = 40;
ns->spr.ang = actor->spr.ang;
ns->spr.__int_angle = actor->spr.__int_angle;
}
}
}
@ -2683,8 +2683,8 @@ void moveactors_r(void)
if (sectp->lotag == 903)
makeitfall(act);
movesprite_ex(act,
MulScale(act->spr.xvel, bcos(act->spr.ang), 14),
MulScale(act->spr.xvel, bsin(act->spr.ang), 14),
MulScale(act->spr.xvel, bcos(act->spr.__int_angle), 14),
MulScale(act->spr.xvel, bsin(act->spr.__int_angle), 14),
act->spr.zvel,CLIPMASK0, coll);
switch (sectp->lotag)
{
@ -2724,8 +2724,8 @@ void moveactors_r(void)
}
makeitfall(act);
movesprite_ex(act,
MulScale(act->spr.xvel, bcos(act->spr.ang), 14),
MulScale(act->spr.xvel, bsin(act->spr.ang), 14),
MulScale(act->spr.xvel, bcos(act->spr.__int_angle), 14),
MulScale(act->spr.xvel, bsin(act->spr.__int_angle), 14),
act->spr.zvel,CLIPMASK0, coll);
if (coll.type > kHitSector)
{
@ -2755,8 +2755,8 @@ void moveactors_r(void)
}
makeitfall(act);
movesprite_ex(act,
MulScale(act->spr.xvel, bcos(act->spr.ang), 14),
MulScale(act->spr.xvel, bsin(act->spr.ang), 14),
MulScale(act->spr.xvel, bcos(act->spr.__int_angle), 14),
MulScale(act->spr.xvel, bsin(act->spr.__int_angle), 14),
act->spr.zvel,CLIPMASK0, coll);
if (act->int_pos().Z >= sectp->int_floorz() - (8<<8))
{
@ -2854,8 +2854,8 @@ void moveactors_r(void)
if (act->spr.xvel)
{
movesprite_ex(act,
MulScale(act->spr.xvel, bcos(act->spr.ang), 14),
MulScale(act->spr.xvel, bsin(act->spr.ang), 14),
MulScale(act->spr.xvel, bcos(act->spr.__int_angle), 14),
MulScale(act->spr.xvel, bsin(act->spr.__int_angle), 14),
act->spr.zvel,CLIPMASK0, coll);
act->spr.xvel--;
}
@ -3494,26 +3494,26 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
if (ps[pnum].newOwner != nullptr)
goalang = getangle(ps[pnum].opos.XY() - actor->spr.pos.XY());
else goalang = getangle(ps[pnum].pos.XY() - actor->spr.pos.XY());
angdif = getincangle(actor->spr.ang, goalang) >> 2;
angdif = getincangle(actor->spr.__int_angle, goalang) >> 2;
if (angdif > -8 && angdif < 0) angdif = 0;
actor->spr.ang += angdif;
actor->spr.__int_angle += angdif;
}
if (a & spin)
actor->spr.ang += bsin(actor->temp_data[0] << 3, -6);
actor->spr.__int_angle += bsin(actor->temp_data[0] << 3, -6);
if (a & face_player_slow)
{
if (ps[pnum].newOwner != nullptr)
goalang = getangle(ps[pnum].opos.XY() - actor->spr.pos.XY());
else goalang = getangle(ps[pnum].pos.XY() - actor->spr.pos.XY());
angdif = Sgn(getincangle(actor->spr.ang, goalang)) << 5;
angdif = Sgn(getincangle(actor->spr.__int_angle, goalang)) << 5;
if (angdif > -32 && angdif < 0)
{
angdif = 0;
actor->spr.ang = goalang;
actor->spr.__int_angle = goalang;
}
actor->spr.ang += angdif;
actor->spr.__int_angle += angdif;
}
if (isRRRA())
@ -3523,13 +3523,13 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
if (ps[pnum].newOwner != nullptr)
goalang = (getangle(ps[pnum].opos.XY() - actor->spr.pos.XY()) + 1024) & 2047;
else goalang = (getangle(ps[pnum].pos.XY() - actor->spr.pos.XY()) + 1024) & 2047;
angdif = Sgn(getincangle(actor->spr.ang, goalang)) << 5;
angdif = Sgn(getincangle(actor->spr.__int_angle, goalang)) << 5;
if (angdif > -32 && angdif < 0)
{
angdif = 0;
actor->spr.ang = goalang;
actor->spr.__int_angle = goalang;
}
actor->spr.ang += angdif;
actor->spr.__int_angle += angdif;
}
if ((a & jumptoplayer) == jumptoplayer)
@ -3589,9 +3589,9 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
double newx = ps[pnum].pos.X + (ps[pnum].vel.X / 768) * inttoworld;
double newy = ps[pnum].pos.Y + (ps[pnum].vel.Y / 768) * inttoworld;
goalang = getangle(newx - actor->spr.pos.X, newy - actor->spr.pos.Y);
angdif = getincangle(actor->spr.ang, goalang) >> 2;
angdif = getincangle(actor->spr.__int_angle, goalang) >> 2;
if (angdif > -8 && angdif < 0) angdif = 0;
actor->spr.ang += angdif;
actor->spr.__int_angle += angdif;
}
if (actor->temp_data[1] == 0 || a == 0)
@ -3679,7 +3679,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
actor->spr.pos.Z = actor->ceilingz + 32;
daxvel = actor->spr.xvel;
angdif = actor->spr.ang;
angdif = actor->spr.__int_angle;
if (a)
{

View file

@ -84,7 +84,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
break;
}
k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
k = (((t->__int_angle + 3072 + 128 - a) & 2047) >> 8) & 7;
if (k > 4)
{
k = 8 - k;
@ -219,9 +219,9 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
t->xrepeat = 0;
else
{
t->ang = getangle(x - t->int_pos().X, y - t->int_pos().Y);
t->pos.X = OwnerAc->spr.pos.X + buildang(t->ang).fcos();
t->pos.Y = OwnerAc->spr.pos.Y + buildang(t->ang).fsin();
t->__int_angle = getangle(x - t->int_pos().X, y - t->int_pos().Y);
t->pos.X = OwnerAc->spr.pos.X + buildang(t->__int_angle).fcos();
t->pos.Y = OwnerAc->spr.pos.Y + buildang(t->__int_angle).fsin();
}
}
break;
@ -261,7 +261,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
}
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
k = (((h->spr.ang + 3072 + 128 - k) & 2047) / 170);
k = (((h->spr.__int_angle + 3072 + 128 - k) & 2047) / 170);
if (k > 6)
{
k = 12 - k;
@ -280,8 +280,8 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
if (h->temp_data[0] < 4)
k = (((h->spr.ang + 3072 + 128 - k) & 2047) / 170);
else k = (((h->spr.ang + 3072 + 128 - k) & 2047) / 170);
k = (((h->spr.__int_angle + 3072 + 128 - k) & 2047) / 170);
else k = (((h->spr.__int_angle + 3072 + 128 - k) & 2047) / 170);
if (k > 6)
{
@ -372,7 +372,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
}
else
{
k = (((h->spr.ang + 3072 + 128 - a) & 2047) >> 8) & 7;
k = (((h->spr.__int_angle + 3072 + 128 - a) & 2047) >> 8) & 7;
if (k > 4)
{
k = 8 - k;
@ -495,12 +495,12 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
else switch (l)
{
case 2:
k = (((h->spr.ang + 3072 + 128 - a) & 2047) >> 8) & 1;
k = (((h->spr.__int_angle + 3072 + 128 - a) & 2047) >> 8) & 1;
break;
case 3:
case 4:
k = (((h->spr.ang + 3072 + 128 - a) & 2047) >> 7) & 7;
k = (((h->spr.__int_angle + 3072 + 128 - a) & 2047) >> 7) & 7;
if (k > 3)
{
t->cstat |= CSTAT_SPRITE_XFLIP;
@ -511,7 +511,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
case 5:
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
k = (((h->spr.ang + 3072 + 128 - k) & 2047) >> 8) & 7;
k = (((h->spr.__int_angle + 3072 + 128 - k) & 2047) >> 8) & 7;
if (k > 4)
{
k = 8 - k;
@ -521,7 +521,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
break;
case 7:
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
k = (((h->spr.ang + 3072 + 128 - k) & 2047) / 170);
k = (((h->spr.__int_angle + 3072 + 128 - k) & 2047) / 170);
if (k > 6)
{
k = 12 - k;
@ -530,7 +530,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
break;
case 8:
k = (((h->spr.ang + 3072 + 128 - a) & 2047) >> 8) & 7;
k = (((h->spr.__int_angle + 3072 + 128 - a) & 2047) >> 8) & 7;
t->cstat &= ~CSTAT_SPRITE_XFLIP;
break;
default:
@ -662,7 +662,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
}
else
{
k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
k = (((t->__int_angle + 3072 + 128 - a) & 2047) >> 8) & 7;
if (k > 4)
{
k = 8 - k;
@ -705,7 +705,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
t->picnum = OwnerAc->dispicnum;
t->pal = OwnerAc->spr.pal;
t->shade = OwnerAc->spr.shade;
t->ang = OwnerAc->spr.ang;
t->__int_angle = OwnerAc->spr.__int_angle;
t->cstat = CSTAT_SPRITE_TRANSLUCENT | OwnerAc->spr.cstat;
}
}
@ -719,7 +719,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
break;
}
k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
k = (((t->__int_angle + 3072 + 128 - a) & 2047) >> 8) & 7;
if (k > 4)
{
k = 8 - k;

View file

@ -62,7 +62,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
break;
case CHAIR3:
k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
k = (((t->__int_angle + 3072 + 128 - a) & 2047) >> 8) & 7;
if (k > 4)
{
k = 8 - k;
@ -213,9 +213,9 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
t->xrepeat = 0;
else
{
t->ang = getangle(x - t->int_pos().X, y - t->int_pos().Y);
t->pos.X = OwnerAc->spr.pos.X + buildang(t->ang).fcos();
t->pos.Y = OwnerAc->spr.pos.Y + buildang(t->ang).fsin();
t->__int_angle = getangle(x - t->int_pos().X, y - t->int_pos().Y);
t->pos.X = OwnerAc->spr.pos.X + buildang(t->__int_angle).fcos();
t->pos.Y = OwnerAc->spr.pos.Y + buildang(t->__int_angle).fsin();
}
}
break;
@ -255,7 +255,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
else if (OwnerAc->spr.picnum == MAMA)
{
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
k = (((h->spr.ang + 3072 + 128 - k) & 2047) >> 8) & 7;
k = (((h->spr.__int_angle + 3072 + 128 - k) & 2047) >> 8) & 7;
if (k > 4)
{
k = 8 - k;
@ -273,7 +273,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
case EMPTYBIKE:
if (!isRRRA()) goto default_case;
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
k = (((h->spr.ang + 3072 + 128 - k) & 2047) / 170);
k = (((h->spr.__int_angle + 3072 + 128 - k) & 2047) / 170);
if (k > 6)
{
k = 12 - k;
@ -285,7 +285,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
case EMPTYBOAT:
if (!isRRRA()) goto default_case;
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
k = (((h->spr.ang + 3072 + 128 - k) & 2047) / 170);
k = (((h->spr.__int_angle + 3072 + 128 - k) & 2047) / 170);
if (k > 6)
{
k = 12 - k;
@ -296,7 +296,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
break;
case RPG:
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
k = (((h->spr.ang + 3072 + 128 - k) & 2047) / 170);
k = (((h->spr.__int_angle + 3072 + 128 - k) & 2047) / 170);
if (k > 6)
{
k = 12 - k;
@ -308,7 +308,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
case RPG2:
if (!isRRRA()) goto default_case;
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
k = (((h->spr.ang + 3072 + 128 - k) & 2047) / 170);
k = (((h->spr.__int_angle + 3072 + 128 - k) & 2047) / 170);
if (k > 6)
{
k = 12 - k;
@ -322,8 +322,8 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
if (h->temp_data[0] < 4)
k = (((h->spr.ang + 3072 + 128 - k) & 2047) / 170);
else k = (((h->spr.ang + 3072 + 128 - k) & 2047) / 170);
k = (((h->spr.__int_angle + 3072 + 128 - k) & 2047) / 170);
else k = (((h->spr.__int_angle + 3072 + 128 - k) & 2047) / 170);
if (k > 6)
{
@ -416,7 +416,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
t->cstat &= ~CSTAT_SPRITE_XFLIP;
} else
{
k = (((h->spr.ang + 3072 + 128 - a) & 2047) >> 8) & 7;
k = (((h->spr.__int_angle + 3072 + 128 - a) & 2047) >> 8) & 7;
if (k > 4)
{
k = 8 - k;
@ -479,7 +479,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
}
else if (ps[p].OnMotorcycle)
{
k = (((h->spr.ang + 3072 + 128 - a) & 2047) / 170);
k = (((h->spr.__int_angle + 3072 + 128 - a) & 2047) / 170);
if (k > 6)
{
k = 12 - k;
@ -505,7 +505,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
}
else if (ps[p].OnBoat)
{
k = (((h->spr.ang + 3072 + 128 - a) & 2047) / 170);
k = (((h->spr.__int_angle + 3072 + 128 - a) & 2047) / 170);
if (k > 6)
{
k = 12 - k;
@ -627,12 +627,12 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
else switch (l)
{
case 2:
k = (((h->spr.ang + 3072 + 128 - a) & 2047) >> 8) & 1;
k = (((h->spr.__int_angle + 3072 + 128 - a) & 2047) >> 8) & 1;
break;
case 3:
case 4:
k = (((h->spr.ang + 3072 + 128 - a) & 2047) >> 7) & 7;
k = (((h->spr.__int_angle + 3072 + 128 - a) & 2047) >> 7) & 7;
if (k > 3)
{
t->cstat |= CSTAT_SPRITE_XFLIP;
@ -643,7 +643,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
case 5:
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
k = (((h->spr.ang + 3072 + 128 - k) & 2047) >> 8) & 7;
k = (((h->spr.__int_angle + 3072 + 128 - k) & 2047) >> 8) & 7;
if (k > 4)
{
k = 8 - k;
@ -653,7 +653,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
break;
case 7:
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
k = (((h->spr.ang + 3072 + 128 - k) & 2047) / 170);
k = (((h->spr.__int_angle + 3072 + 128 - k) & 2047) / 170);
if (k > 6)
{
k = 12 - k;
@ -662,7 +662,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
break;
case 8:
k = (((h->spr.ang + 3072 + 128 - a) & 2047) >> 8) & 7;
k = (((h->spr.__int_angle + 3072 + 128 - a) & 2047) >> 8) & 7;
t->cstat &= ~CSTAT_SPRITE_XFLIP;
break;
default:
@ -670,7 +670,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
if (bg && h->spr.statnum == 2 && h->spr.extra > 0)
{
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
k = (((h->spr.ang + 3072 + 128 - k) & 2047) >> 8) & 7;
k = (((h->spr.__int_angle + 3072 + 128 - k) & 2047) >> 8) & 7;
if (k > 4)
{
k = 8 - k;
@ -892,7 +892,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
break;
case PLAYERONWATER:
k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
k = (((t->__int_angle + 3072 + 128 - a) & 2047) >> 8) & 7;
if (k > 4)
{
k = 8 - k;
@ -938,7 +938,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
t->picnum = OwnerAc->dispicnum;
t->pal = OwnerAc->spr.pal;
t->shade = OwnerAc->spr.shade;
t->ang = OwnerAc->spr.ang;
t->__int_angle = OwnerAc->spr.__int_angle;
t->cstat = CSTAT_SPRITE_TRANSLUCENT | OwnerAc->spr.cstat;
}
}
@ -946,7 +946,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
case CAMERA1:
case RAT:
k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
k = (((t->__int_angle + 3072 + 128 - a) & 2047) >> 8) & 7;
if (k > 4)
{
k = 8 - k;

View file

@ -190,7 +190,7 @@ void resetpins(sectortype* sect)
{
spawned->spr.clipdist = (1 + (krand() % 1)) * 16 + 32;
}
spawned->spr.ang -= ((krand() & 32) - (krand() & 64)) & 2047;
spawned->spr.__int_angle -= ((krand() & 32) - (krand() & 64)) & 2047;
}
}
if (a2->spr.picnum == 280)

View file

@ -98,7 +98,7 @@ static int ccmd_spawn(CCmdFuncPtr parm)
{
if (set & 1) spawned->spr.pal = (uint8_t)pal;
if (set & 2) spawned->spr.cstat = ESpriteFlags::FromInt(cstat);
if (set & 4) spawned->spr.ang = ang;
if (set & 4) spawned->spr.__int_angle = ang;
if (set & 8) SetActor(spawned, DVector3( x, y, z ));
if (spawned->sector() == nullptr)

View file

@ -433,8 +433,8 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int
x1 = DMulScale(ox, xvect, -oy, yvect, 16);
y1 = DMulScale(oy, xvect, ox, yvect, 16);
ox = bcos(act->spr.ang, -7);
oy = bsin(act->spr.ang, -7);
ox = bcos(act->spr.__int_angle, -7);
oy = bsin(act->spr.__int_angle, -7);
x2 = DMulScale(ox, xvect, -oy, yvect, 16);
y2 = DMulScale(oy, xvect, ox, yvect, 16);
@ -454,7 +454,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int
tilenum = act->spr.picnum;
xoff = tileLeftOffset(tilenum) + act->spr.xoffset;
if ((act->spr.cstat & CSTAT_SPRITE_XFLIP) > 0) xoff = -xoff;
k = act->spr.ang;
k = act->spr.__int_angle;
l = act->spr.xrepeat;
dax = bsin(k) * l;
day = -bcos(k) * l;
@ -495,7 +495,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int
if ((act->spr.cstat & CSTAT_SPRITE_XFLIP) > 0) xoff = -xoff;
if ((act->spr.cstat & CSTAT_SPRITE_YFLIP) > 0) yoff = -yoff;
k = act->spr.ang;
k = act->spr.__int_angle;
cosang = bcos(k);
sinang = bsin(k);
xspan = tileWidth(tilenum);
@ -567,7 +567,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int
int xx = twod->GetWidth() / 2. + x1 / 4096.;
int yy = twod->GetHeight() / 2. + y1 / 4096.;
daang = ((!SyncInput() ? act->spr.ang : act->interpolatedang(smoothratio)) - cang) & 2047;
daang = ((!SyncInput() ? act->spr.__int_angle : act->interpolatedang(smoothratio)) - cang) & 2047;
if (p == screenpeek || ud.coop == 1)
{

View file

@ -1232,8 +1232,8 @@ void DoActor(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
else*/ SetGameVarID(lVar2, act->spr.statnum, sActor, sPlayer);
break;
case ACTOR_ANG:
if (bSet) act->spr.ang = lValue;
else SetGameVarID(lVar2, act->spr.ang, sActor, sPlayer);
if (bSet) act->spr.__int_angle = lValue;
else SetGameVarID(lVar2, act->spr.__int_angle, sActor, sPlayer);
break;
case ACTOR_OWNER:
// there is no way to handle this well because we do not know whether this is an actor or not. Pity.
@ -1416,14 +1416,14 @@ static int ifcanshoottarget(DDukeActor *actor, int g_p, int g_x)
j = 0;
else
{
actor->spr.ang += angdif; j = hitasprite(actor, &hit); actor->spr.ang -= angdif;
actor->spr.__int_angle += angdif; j = hitasprite(actor, &hit); actor->spr.__int_angle -= angdif;
if (j > sclip)
{
if (hit != nullptr && hit->spr.picnum == actor->spr.picnum)
j = 0;
else
{
actor->spr.ang -= angdif; j = hitasprite(actor, &hit); actor->spr.ang += angdif;
actor->spr.__int_angle -= angdif; j = hitasprite(actor, &hit); actor->spr.__int_angle += angdif;
if (j > 768)
{
if (hit != nullptr && hit->spr.picnum == actor->spr.picnum)
@ -1561,7 +1561,7 @@ int ParseState::parse(void)
g_ac->spr.hitag = ScriptCode[g_t[5] + 2]; // Ai
g_t[0] = g_t[2] = g_t[3] = 0;
if (g_ac->spr.hitag & random_angle)
g_ac->spr.ang = krand() & 2047;
g_ac->spr.__int_angle = krand() & 2047;
insptr++;
break;
case concmd_action:
@ -1601,10 +1601,10 @@ int ParseState::parse(void)
switch (krand() & 1)
{
case 0:
g_ac->spr.ang = (+512 + g_ac->spr.ang + (krand() & 511)) & 2047;
g_ac->spr.__int_angle = (+512 + g_ac->spr.__int_angle + (krand() & 511)) & 2047;
break;
case 1:
g_ac->spr.ang = (-512 + g_ac->spr.ang - (krand() & 511)) & 2047;
g_ac->spr.__int_angle = (-512 + g_ac->spr.__int_angle - (krand() & 511)) & 2047;
break;
}
insptr++;
@ -1615,7 +1615,7 @@ int ParseState::parse(void)
break;
case concmd_rndmove:
g_ac->spr.ang = krand() & 2047;
g_ac->spr.__int_angle = krand() & 2047;
g_ac->spr.xvel = 25;
insptr++;
break;
@ -1761,23 +1761,23 @@ int ParseState::parse(void)
break;
case concmd_ifsoundid:
insptr++;
parseifelse((short)*insptr == ambientlotag[g_ac->spr.ang]);
parseifelse((short)*insptr == ambientlotag[g_ac->spr.__int_angle]);
break;
case concmd_ifsounddist:
insptr++;
if (*insptr == 0)
parseifelse(ambienthitag[g_ac->spr.ang] > g_x);
parseifelse(ambienthitag[g_ac->spr.__int_angle] > g_x);
else if (*insptr == 1)
parseifelse(ambienthitag[g_ac->spr.ang] < g_x);
parseifelse(ambienthitag[g_ac->spr.__int_angle] < g_x);
break;
case concmd_soundtag:
insptr++;
S_PlayActorSound(ambientlotag[g_ac->spr.ang], g_ac);
S_PlayActorSound(ambientlotag[g_ac->spr.__int_angle], g_ac);
break;
case concmd_soundtagonce:
insptr++;
if (!S_CheckActorSoundPlaying(g_ac, ambientlotag[g_ac->spr.ang]))
S_PlayActorSound(ambientlotag[g_ac->spr.ang], g_ac);
if (!S_CheckActorSoundPlaying(g_ac, ambientlotag[g_ac->spr.__int_angle]))
S_PlayActorSound(ambientlotag[g_ac->spr.__int_angle], g_ac);
break;
case concmd_soundonce:
insptr++;
@ -1973,11 +1973,11 @@ int ParseState::parse(void)
break;
case concmd_strafeleft:
insptr++;
movesprite_ex(g_ac, -bsin(g_ac->spr.ang, -10), bcos(g_ac->spr.ang, -10), g_ac->spr.zvel, CLIPMASK0, coll);
movesprite_ex(g_ac, -bsin(g_ac->spr.__int_angle, -10), bcos(g_ac->spr.__int_angle, -10), g_ac->spr.zvel, CLIPMASK0, coll);
break;
case concmd_straferight:
insptr++;
movesprite_ex(g_ac, bsin(g_ac->spr.ang, -10), -bcos(g_ac->spr.ang, -10), g_ac->spr.zvel, CLIPMASK0, coll);
movesprite_ex(g_ac, bsin(g_ac->spr.__int_angle, -10), -bcos(g_ac->spr.__int_angle, -10), g_ac->spr.zvel, CLIPMASK0, coll);
break;
case concmd_larrybird:
insptr++;
@ -2122,7 +2122,7 @@ int ParseState::parse(void)
g_ac->spr.hitag = *insptr;
insptr++;
if(g_ac->spr.hitag&random_angle)
g_ac->spr.ang = krand()&2047;
g_ac->spr.__int_angle = krand()&2047;
break;
case concmd_spawn:
insptr++;
@ -2484,7 +2484,7 @@ int ParseState::parse(void)
if( g_ac->sector()->lotag == 0 )
{
HitInfo hit{};
neartag({ g_ac->int_pos().X, g_ac->int_pos().Y, g_ac->int_pos().Z - (32 << 8) }, g_ac->sector(), g_ac->spr.ang, hit, 768, 1);
neartag({ g_ac->int_pos().X, g_ac->int_pos().Y, g_ac->int_pos().Z - (32 << 8) }, g_ac->sector(), g_ac->spr.__int_angle, hit, 768, 1);
auto sectp = hit.hitSector;
if (sectp)
{
@ -2846,7 +2846,7 @@ int ParseState::parse(void)
case concmd_ifangdiffl:
insptr++;
j = abs(getincangle(ps[g_p].angle.ang.asbuild(),g_ac->spr.ang));
j = abs(getincangle(ps[g_p].angle.ang.asbuild(),g_ac->spr.__int_angle));
parseifelse( j <= *insptr);
break;
@ -3162,7 +3162,7 @@ int ParseState::parse(void)
int i;
insptr++;
i = *(insptr++); // ID of def
SetGameVarID(i, g_ac->spr.ang, g_ac, g_p);
SetGameVarID(i, g_ac->spr.__int_angle, g_ac, g_p);
break;
}
case concmd_setactorangle:
@ -3170,8 +3170,8 @@ int ParseState::parse(void)
int i;
insptr++;
i = *(insptr++); // ID of def
g_ac->spr.ang = GetGameVarID(i, g_ac, g_p).safeValue();
g_ac->spr.ang &= 2047;
g_ac->spr.__int_angle = GetGameVarID(i, g_ac, g_p).safeValue();
g_ac->spr.__int_angle &= 2047;
break;
}
case concmd_randvar:

View file

@ -846,7 +846,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
p->angle.processhelpers(scaleAdjust);
p->horizon.processhelpers(scaleAdjust);
p->GetActor()->spr.ang = p->angle.ang.asbuild();
p->GetActor()->spr.__int_angle = p->angle.ang.asbuild();
}
if (packet)

View file

@ -175,7 +175,7 @@ int hits(DDukeActor* actor)
else zoff = 0;
auto pos = actor->int_pos();
hitscan(pos.withZOffset(-zoff), actor->sector(), { bcos(actor->spr.ang), bsin(actor->spr.ang), 0 }, hit, CLIPMASK1);
hitscan(pos.withZOffset(-zoff), actor->sector(), { bcos(actor->spr.__int_angle), bsin(actor->spr.__int_angle), 0 }, hit, CLIPMASK1);
return (FindDistance2D(hit.hitpos.vec2 - actor->int_pos().vec2));
}
@ -196,7 +196,7 @@ int hitasprite(DDukeActor* actor, DDukeActor** hitsp)
else zoff = 0;
auto pos = actor->int_pos();
hitscan(pos.withZOffset(-zoff), actor->sector(), { bcos(actor->spr.ang), bsin(actor->spr.ang), 0 }, hit, CLIPMASK1);
hitscan(pos.withZOffset(-zoff), actor->sector(), { bcos(actor->spr.__int_angle), bsin(actor->spr.__int_angle), 0 }, hit, CLIPMASK1);
if (hitsp) *hitsp = hit.actor();
if (hit.hitWall != nullptr && (hit.hitWall->cstat & CSTAT_WALL_MASKED) && badguy(actor))
@ -236,7 +236,7 @@ DDukeActor* aim(DDukeActor* actor, int aang)
int dx1, dy1, dx2, dy2, dx3, dy3, smax, sdist;
int xv, yv;
a = actor->spr.ang;
a = actor->spr.__int_angle;
// Autoaim from DukeGDX.
if (actor->isPlayer())
@ -252,7 +252,7 @@ DDukeActor* aim(DDukeActor* actor, int aang)
int zvel = -plr->horizon.sum().asq16() >> 5;
HitInfo hit{};
hitscan(plr->player_int_pos().withZOffset(1024), actor->sector(), { bcos(actor->spr.ang), bsin(actor->spr.ang), zvel }, hit, CLIPMASK1);
hitscan(plr->player_int_pos().withZOffset(1024), actor->sector(), { bcos(actor->spr.__int_angle), bsin(actor->spr.__int_angle), zvel }, hit, CLIPMASK1);
if (hit.actor() != nullptr)
{
@ -1058,7 +1058,7 @@ void shootbloodsplat(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i
{
spawned->spr.xvel = -12;
auto delta = hit.hitWall->delta();
spawned->spr.ang = getangle(-delta.X, -delta.Y) + 512; // note the '-' sign here!
spawned->spr.__int_angle = getangle(-delta.X, -delta.Y) + 512; // note the '-' sign here!
spawned->set_int_pos(hit.hitpos);
spawned->spr.cstat |= randomXFlip();
ssp(spawned, CLIPMASK0);

View file

@ -174,7 +174,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, int sx, int sy, int
zvel = ((ps[j].player_int_opos().Z - sz) * vel) / l;
if (badguy(actor) && (actor->spr.hitag & face_player_smart) != 0)
sa = (short)(actor->spr.ang + (krand() & 31) - 16);
sa = (short)(actor->spr.__int_angle + (krand() & 31) - 16);
if (actor->sector()->lotag == 2 && (krand() % 5) == 0)
spawned = spawn(actor, WATERBUBBLE);
@ -201,7 +201,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, int sx, int sy, int
spawned->set_int_pos({ sx + bsin(sa + 630) / 448, sy + bsin(sa + 112) / 448, sz - 256 });
spawned->setsector(actor->sector());
spawned->spr.cstat = CSTAT_SPRITE_YCENTER;
spawned->spr.ang = sa;
spawned->spr.__int_angle = sa;
spawned->spr.xrepeat = 2;
spawned->spr.yrepeat = 2;
spawned->spr.clipdist = 40;
@ -294,7 +294,7 @@ static void shootknee(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
if (splash)
{
splash->set_int_xy(hit.hitpos.X, hit.hitpos.Y);
splash->spr.ang = ps[p].angle.ang.asbuild(); // Total tweek
splash->spr.__int_angle = ps[p].angle.ang.asbuild(); // Total tweek
splash->spr.xvel = 32;
ssp(actor, CLIPMASK0);
splash->spr.xvel = 0;
@ -442,7 +442,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
jib->spr.pos.Z += 4;
jib->spr.xvel = 16;
jib->spr.xrepeat = jib->spr.yrepeat = 24;
jib->spr.ang += 64 - (krand() & 127);
jib->spr.__int_angle += 64 - (krand() & 127);
}
}
else spawn(spark, SMALLSMOKE);
@ -512,7 +512,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
{
hole->spr.xvel = -1;
auto delta = hit.hitWall->delta();
hole->spr.ang = getangle(-delta.X, -delta.Y) + 512;
hole->spr.__int_angle = getangle(-delta.X, -delta.Y) + 512;
ssp(hole, CLIPMASK0);
hole->spr.cstat2 |= CSTAT2_SPRITE_DECAL;
}
@ -651,14 +651,14 @@ static void shootstuff(DDukeActor* actor, int p, int sx, int sy, int sz, int sa,
spawned->spr.xvel = 1024;
ssp(spawned, CLIPMASK0);
spawned->spr.xvel = l;
spawned->spr.ang += 128 - (krand() & 255);
spawned->spr.__int_angle += 128 - (krand() & 255);
}
}
spawned->spr.cstat = CSTAT_SPRITE_YCENTER;
spawned->spr.clipdist = 4;
sa = actor->spr.ang + 32 - (krand() & 63);
sa = actor->spr.__int_angle + 32 - (krand() & 63);
zvel = oldzvel + 512 - (krand() & 1023);
scount--;
@ -724,7 +724,7 @@ static void shootrpg(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, i
zvel = ((ps[j].player_int_opos().Z - sz) * vel) / l;
if (badguy(actor) && (actor->spr.hitag & face_player_smart))
sa = actor->spr.ang + (krand() & 31) - 16;
sa = actor->spr.__int_angle + (krand() & 31) - 16;
}
if (p < 0) aimed = nullptr;
@ -770,7 +770,7 @@ static void shootrpg(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, i
}
spawned->add_int_pos({ xoffs, yoffs, 0 });
spawned->spr.ang += aoffs;
spawned->spr.__int_angle += aoffs;
spawned->spr.xrepeat = 42;
spawned->spr.yrepeat = 42;
@ -789,7 +789,7 @@ static void shootrpg(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, i
}
spawned->add_int_pos({ -xoffs, -yoffs, 0 });
spawned->spr.ang -= aoffs;
spawned->spr.__int_angle -= aoffs;
spawned->spr.xrepeat = 24;
spawned->spr.yrepeat = 24;
@ -804,7 +804,7 @@ static void shootrpg(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, i
else if ((isWW2GI() && aplWeaponWorksLike(ps[p].curr_weapon, p) == DEVISTATOR_WEAPON) || (!isWW2GI() && ps[p].curr_weapon == DEVISTATOR_WEAPON))
{
spawned->spr.extra >>= 2;
spawned->spr.ang += 16 - (krand() & 31);
spawned->spr.__int_angle += 16 - (krand() & 31);
spawned->spr.zvel += 256 - (krand() & 511);
if (ps[p].hbomb_hold_delay)
@ -889,7 +889,7 @@ static void shootlaser(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
ssp(bomb, CLIPMASK0);
bomb->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL;
auto delta = hit.hitWall->delta();
bomb->temp_data[5] = bomb->spr.ang = getangle(-delta.X, -delta.Y) - 512;
bomb->temp_data[5] = bomb->spr.__int_angle = getangle(-delta.X, -delta.Y) - 512;
if (p >= 0)
ps[p].ammo_amount[TRIPBOMB_WEAPON]--;
@ -1026,7 +1026,7 @@ void shoot_d(DDukeActor* actor, int atwith)
}
else
{
sa = actor->spr.ang;
sa = actor->spr.__int_angle;
sx = actor->int_pos().X;
sy = actor->int_pos().Y;
sz = actor->int_pos().Z - (actor->spr.yrepeat * tileHeight(actor->spr.picnum) << 1) + (4 << 8);
@ -1060,7 +1060,7 @@ void shoot_d(DDukeActor* actor, int atwith)
{
k->setsector(sect);
k->set_int_pos({ sx, sy, sz });
k->spr.ang = sa;
k->spr.__int_angle = sa;
k->spr.xvel = 500;
k->spr.zvel = 0;
}
@ -2218,7 +2218,7 @@ static void operateweapon(int snum, ESyncBits actions)
k = hits(pact);
if (k < 512)
{
spawned->spr.ang += 1024;
spawned->spr.__int_angle += 1024;
spawned->spr.zvel /= 3;
spawned->spr.xvel /= 3;
}
@ -2346,9 +2346,9 @@ static void operateweapon(int snum, ESyncBits actions)
auto j = spawn(pact, SHOTGUNSHELL);
if (j)
{
j->spr.ang += 1024;
j->spr.__int_angle += 1024;
ssp(j, CLIPMASK0);
j->spr.ang += 1024;
j->spr.__int_angle += 1024;
}
p->kickback_pic++;
break;
@ -2374,8 +2374,8 @@ static void operateweapon(int snum, ESyncBits actions)
auto j = spawn(pact, SHELL);
if (j)
{
j->spr.ang += 1024;
j->spr.ang &= 2047;
j->spr.__int_angle += 1024;
j->spr.__int_angle &= 2047;
j->spr.xvel += 32;
j->spr.pos.Z += 3;
ssp(j, CLIPMASK0);

View file

@ -186,7 +186,7 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa,
if (splash)
{
splash->set_int_xy(hit.hitpos.X, hit.hitpos.Y);
splash->spr.ang = ps[p].angle.ang.asbuild(); // Total tweek
splash->spr.__int_angle = ps[p].angle.ang.asbuild(); // Total tweek
splash->spr.xvel = 32;
ssp(actor, 0);
splash->spr.xvel = 0;
@ -337,7 +337,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
l->spr.pos.Z += 4;
l->spr.xvel = 16;
l->spr.xrepeat = l->spr.yrepeat = 24;
l->spr.ang += 64 - (krand() & 127);
l->spr.__int_angle += 64 - (krand() & 127);
}
}
else spawn(spark, SMALLSMOKE);
@ -411,7 +411,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
{
hole->spr.xvel = -1;
auto delta = hit.hitWall->delta();
hole->spr.ang = getangle(-delta.X, -delta.Y) + 512;
hole->spr.__int_angle = getangle(-delta.X, -delta.Y) + 512;
ssp(hole, CLIPMASK0);
hole->spr.cstat2 |= CSTAT2_SPRITE_DECAL;
}
@ -489,8 +489,8 @@ static void shootstuff(DDukeActor* actor, int p, int sx, int sy, int sz, int sa,
sz -= (4 << 7);
if (actor->spr.picnum == 4649)
{
sx += bcos(actor->spr.ang + 256, -6);
sy += bsin(actor->spr.ang + 256, -6);
sx += bcos(actor->spr.__int_angle + 256, -6);
sy += bsin(actor->spr.__int_angle + 256, -6);
sz += (12 << 8);
}
if (actor->spr.picnum == VIXEN)
@ -503,8 +503,8 @@ static void shootstuff(DDukeActor* actor, int p, int sx, int sy, int sz, int sa,
{
auto aimed = aim(actor, AUTO_AIM_ANGLE);
sx += bcos(actor->spr.ang + 160, -7);
sy += bsin(actor->spr.ang + 160, -7);
sx += bcos(actor->spr.__int_angle + 160, -7);
sy += bsin(actor->spr.__int_angle + 160, -7);
if (aimed)
{
@ -578,7 +578,7 @@ static void shootstuff(DDukeActor* actor, int p, int sx, int sy, int sz, int sa,
j->spr.cstat = CSTAT_SPRITE_YCENTER;
j->spr.clipdist = 4;
sa = actor->spr.ang + 32 - (krand() & 63);
sa = actor->spr.__int_angle + 32 - (krand() & 63);
zvel = oldzvel + 512 - (krand() & 1023);
if (atwith == FIRELASER)
@ -657,7 +657,7 @@ static void shootrpg(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i
zvel = ((ps[j].player_int_opos().Z - sz) * vel) / l;
if (badguy(actor) && (actor->spr.hitag & face_player_smart))
sa = actor->spr.ang + (krand() & 31) - 16;
sa = actor->spr.__int_angle + (krand() & 31) - 16;
}
if (p < 0) aimed = nullptr;
@ -717,7 +717,7 @@ static void shootrpg(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i
else if (ps[p].curr_weapon == TIT_WEAPON)
{
spawned->spr.extra >>= 2;
spawned->spr.ang += 16 - (krand() & 31);
spawned->spr.__int_angle += 16 - (krand() & 31);
spawned->spr.zvel += 256 - (krand() & 511);
if (ps[p].hbomb_hold_delay)
@ -809,7 +809,7 @@ static void shootwhip(DDukeActor* actor, int p, int sx, int sy, int sz, int sa,
j->spr.cstat = CSTAT_SPRITE_YCENTER;
j->spr.clipdist = 4;
sa = actor->spr.ang + 32 - (krand() & 63);
sa = actor->spr.__int_angle + 32 - (krand() & 63);
zvel = oldzvel + 512 - (krand() & 1023);
scount--;
@ -845,7 +845,7 @@ void shoot_r(DDukeActor* actor, int atwith)
else
{
p = -1;
sa = actor->spr.ang;
sa = actor->spr.__int_angle;
sx = actor->int_pos().X;
sy = actor->int_pos().Y;
sz = actor->int_pos().Z - ((actor->spr.yrepeat * tileHeight(actor->spr.picnum)) << 1) + (4 << 8);
@ -894,7 +894,7 @@ void shoot_r(DDukeActor* actor, int atwith)
if (j)
{
j->spr.xvel = 32;
j->spr.ang = actor->spr.ang;
j->spr.__int_angle = actor->spr.__int_angle;
j->add_int_z(-(5 << 8));
}
break;
@ -905,7 +905,7 @@ void shoot_r(DDukeActor* actor, int atwith)
if (j)
{
j->spr.xvel = 250;
j->spr.ang = actor->spr.ang;
j->spr.__int_angle = actor->spr.__int_angle;
j->add_int_z(-(15 << 8));
}
break;
@ -1506,7 +1506,7 @@ void checkweapons_r(player_struct* p)
auto j = spawn(p->GetActor(), 7220);
if (j)
{
j->spr.ang = p->angle.ang.asbuild();
j->spr.__int_angle = p->angle.ang.asbuild();
j->saved_ammo = p->ammo_amount[MOTORCYCLE_WEAPON];
}
p->OnMotorcycle = 0;
@ -1525,7 +1525,7 @@ void checkweapons_r(player_struct* p)
auto j = spawn(p->GetActor(), 7233);
if (j)
{
j->spr.ang = p->angle.ang.asbuild();
j->spr.__int_angle = p->angle.ang.asbuild();
j->saved_ammo = p->ammo_amount[BOAT_WEAPON];
}
p->OnBoat = 0;
@ -2761,7 +2761,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
k = hits(p->GetActor());
if (k < 512)
{
spawned->spr.ang += 1024;
spawned->spr.__int_angle += 1024;
spawned->spr.zvel /= 3;
spawned->spr.xvel /= 3;
}
@ -2977,8 +2977,8 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
if (j)
{
j->spr.ang += 1024;
j->spr.ang &= 2047;
j->spr.__int_angle += 1024;
j->spr.__int_angle &= 2047;
j->spr.xvel += 32;
j->spr.pos.Z += 3;
ssp(j, CLIPMASK0);
@ -4048,7 +4048,7 @@ void OnMotorcycle(player_struct *p, DDukeActor* motosprite)
{
p->pos.X = motosprite->spr.pos.X;
p->pos.Y = motosprite->spr.pos.Y;
p->angle.ang = buildang(motosprite->spr.ang);
p->angle.ang = buildang(motosprite->spr.__int_angle);
p->ammo_amount[MOTORCYCLE_WEAPON] = motosprite->saved_ammo;
deletesprite(motosprite);
}
@ -4106,7 +4106,7 @@ void OffMotorcycle(player_struct *p)
auto spawned = spawn(p->GetActor(), EMPTYBIKE);
if (spawned)
{
spawned->spr.ang = p->angle.ang.asbuild();
spawned->spr.__int_angle = p->angle.ang.asbuild();
spawned->spr.xvel += p->angle.ang.bcos(7);
spawned->spr.yvel += p->angle.ang.bsin(7);
spawned->saved_ammo = p->ammo_amount[MOTORCYCLE_WEAPON];
@ -4128,7 +4128,7 @@ void OnBoat(player_struct *p, DDukeActor* boat)
{
p->pos.X = boat->spr.pos.X;
p->pos.Y = boat->spr.pos.Y;
p->angle.ang = buildang(boat->spr.ang);
p->angle.ang = buildang(boat->spr.__int_angle);
p->ammo_amount[BOAT_WEAPON] = boat->saved_ammo;
deletesprite(boat);
}
@ -4173,7 +4173,7 @@ void OffBoat(player_struct *p)
auto spawned = spawn(p->GetActor(), EMPTYBOAT);
if (spawned)
{
spawned->spr.ang = p->angle.ang.asbuild();
spawned->spr.__int_angle = p->angle.ang.asbuild();
spawned->spr.xvel += p->angle.ang.bcos(7);
spawned->spr.yvel += p->angle.ang.bsin(7);
spawned->saved_ammo = p->ammo_amount[BOAT_WEAPON];

View file

@ -117,16 +117,16 @@ void DoSpawn(player_struct *p, int snum)
if((aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_SPAWNTYPE2 ) )
{
// like shotgun shells
j->spr.ang += 1024;
j->spr.__int_angle += 1024;
ssp(j,CLIPMASK0);
j->spr.ang += 1024;
j->spr.__int_angle += 1024;
// p->kickback_pic++;
}
else if((aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_SPAWNTYPE3 ) )
{
// like chaingun shells
j->spr.ang += 1024;
j->spr.ang &= 2047;
j->spr.__int_angle += 1024;
j->spr.__int_angle &= 2047;
j->spr.xvel += 32;
j->add_int_z(3<<8);
ssp(j,CLIPMASK0);
@ -367,7 +367,7 @@ void operateweapon_ww(int snum, ESyncBits actions)
k = hits(p->GetActor());
if (k < 512)
{
j->spr.ang += 1024;
j->spr.__int_angle += 1024;
j->spr.zvel /= 3;
j->spr.xvel /= 3;
}

View file

@ -71,7 +71,7 @@ void premapcontroller(DDukeActor* ac)
cyclers[numcyclers].shade1 = ac->spr.shade;
cyclers[numcyclers].shade2 = ac->sector()->floorshade;
cyclers[numcyclers].hitag = ac->spr.hitag;
cyclers[numcyclers].state = (ac->spr.ang == 1536);
cyclers[numcyclers].state = (ac->spr.__int_angle == 1536);
numcyclers++;
deletesprite(ac);
break;
@ -616,7 +616,7 @@ void resetpspritevars(int g)
}
po[numplayersprites].opos = act->spr.pos;
po[numplayersprites].oa = act->spr.ang;
po[numplayersprites].oa = act->spr.__int_angle;
po[numplayersprites].os = act->sector();
numplayersprites++;
@ -661,7 +661,7 @@ void resetpspritevars(int g)
ps[j].backupxyz();
ps[j].setbobpos();
act->backuppos();
ps[j].angle.oang = ps[j].angle.ang = buildang(act->spr.ang);
ps[j].angle.oang = ps[j].angle.ang = buildang(act->spr.__int_angle);
updatesector(act->int_pos().X, act->int_pos().Y, &ps[j].cursector);

View file

@ -574,7 +574,7 @@ void prelevel_r(int g, TArray<DDukeActor*>& actors)
{
ambienthitag[ambientfx] = ac->spr.hitag;
ambientlotag[ambientfx] = ac->spr.lotag;
ac->spr.ang = ambientfx;
ac->spr.__int_angle = ambientfx;
ambientfx++;
ac->spr.lotag = 0;
ac->spr.hitag = 0;

View file

@ -259,7 +259,7 @@ void displayrooms(int snum, double smoothratio, bool sceneonly)
if (act->spr.yvel < 0) act->spr.yvel = -100;
else if (act->spr.yvel > 199) act->spr.yvel = 300;
cang = buildang(interpolatedangle(ud.cameraactor->tempang, act->spr.ang, smoothratio));
cang = buildang(interpolatedangle(ud.cameraactor->tempang, act->spr.__int_angle, smoothratio));
auto bh = buildhoriz(act->spr.yvel);
auto cstat = act->spr.cstat;

View file

@ -927,7 +927,7 @@ static void handle_st25(sectortype* sptr, DDukeActor* actor)
if (act3->spr.lotag == 15)
{
act3->sector()->lotag ^= 0x8000; // Toggle the open or close
act3->spr.ang += 1024;
act3->spr.__int_angle += 1024;
if (act3->temp_data[4]) callsound(act3->sector(), act3);
callsound(act3->sector(), act3);
if (act3->sector()->lotag & 0x8000) act3->temp_data[4] = 1;

View file

@ -682,7 +682,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
{
spawned->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER;
auto delta = wal->delta();
spawned->spr.ang = getangle(-delta.X, -delta.Y) - 512;
spawned->spr.__int_angle = getangle(-delta.X, -delta.Y) - 512;
S_PlayActorSound(SOMETHINGHITFORCE, spawned);
}
@ -1049,8 +1049,8 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
if (proj->spr.picnum == QUEBALL || proj->spr.picnum == STRIPEBALL)
{
proj->spr.xvel = (targ->spr.xvel >> 1) + (targ->spr.xvel >> 2);
proj->spr.ang -= (targ->spr.ang << 1) + 1024;
targ->spr.ang = getangle(targ->int_pos().X - proj->int_pos().X, targ->int_pos().Y - proj->int_pos().Y) - 512;
proj->spr.__int_angle -= (targ->spr.__int_angle << 1) + 1024;
targ->spr.__int_angle = getangle(targ->int_pos().X - proj->int_pos().X, targ->int_pos().Y - proj->int_pos().Y) - 512;
if (S_CheckSoundPlaying(POOLBALLHIT) < 2)
S_PlayActorSound(POOLBALLHIT, targ);
}
@ -1059,7 +1059,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
if (krand() & 3)
{
targ->spr.xvel = 164;
targ->spr.ang = proj->spr.ang;
targ->spr.__int_angle = proj->spr.__int_angle;
}
else
{
@ -1177,7 +1177,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
lotsofglass(targ, nullptr, 40);
S_PlayActorSound(GLASS_BREAKING, targ);
targ->spr.ang = krand() & 2047;
targ->spr.__int_angle = krand() & 2047;
lotsofglass(targ, nullptr, 8);
deletesprite(targ);
break;
@ -1190,7 +1190,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
for (j = 0; j < 48; j++)
{
fi.shoot(targ, BLOODSPLAT1);
targ->spr.ang += 333;
targ->spr.__int_angle += 333;
}
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
S_PlayActorSound(SQUISHED, targ);
@ -1303,21 +1303,21 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
{
targ->spr.extra -= proj->spr.extra;
if (targ->spr.extra > 0) break;
targ->spr.ang = krand() & 2047;
targ->spr.__int_angle = krand() & 2047;
fi.shoot(targ, BLOODSPLAT1);
targ->spr.ang = krand() & 2047;
targ->spr.__int_angle = krand() & 2047;
fi.shoot(targ, BLOODSPLAT2);
targ->spr.ang = krand() & 2047;
targ->spr.__int_angle = krand() & 2047;
fi.shoot(targ, BLOODSPLAT3);
targ->spr.ang = krand() & 2047;
targ->spr.__int_angle = krand() & 2047;
fi.shoot(targ, BLOODSPLAT4);
targ->spr.ang = krand() & 2047;
targ->spr.__int_angle = krand() & 2047;
fi.shoot(targ, BLOODSPLAT1);
targ->spr.ang = krand() & 2047;
targ->spr.__int_angle = krand() & 2047;
fi.shoot(targ, BLOODSPLAT2);
targ->spr.ang = krand() & 2047;
targ->spr.__int_angle = krand() & 2047;
fi.shoot(targ, BLOODSPLAT3);
targ->spr.ang = krand() & 2047;
targ->spr.__int_angle = krand() & 2047;
fi.shoot(targ, BLOODSPLAT4);
fi.guts(targ, JIBS1, 1, myconnectindex);
fi.guts(targ, JIBS2, 2, myconnectindex);
@ -1377,7 +1377,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
spawned->spr.pos.Z += 4;
spawned->spr.xvel = 16;
spawned->spr.xrepeat = spawned->spr.yrepeat = 24;
spawned->spr.ang += 32 - (krand() & 63);
spawned->spr.__int_angle += 32 - (krand() & 63);
}
}
@ -1395,7 +1395,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
if (targ->spr.picnum != TANK && !bossguy(targ) && targ->spr.picnum != RECON && targ->spr.picnum != ROTATEGUN)
{
if ((targ->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0)
targ->spr.ang = (proj->spr.ang + 1024) & 2047;
targ->spr.__int_angle = (proj->spr.__int_angle + 1024) & 2047;
targ->spr.xvel = -(proj->spr.extra << 2);
auto sp = targ->sector();
pushmove(targ, &sp, 128L, (4 << 8), (4 << 8), CLIPMASK0);
@ -1431,7 +1431,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
targ->attackertype = hitpic;
targ->hitextra += proj->spr.extra;
targ->hitang = proj->spr.ang;
targ->hitang = proj->spr.__int_angle;
targ->SetHitOwner(Owner);
}

View file

@ -938,7 +938,7 @@ static void lotsofpopcorn(DDukeActor *actor, walltype* wal, int n)
{
for (j = n - 1; j >= 0; j--)
{
a = actor->spr.ang - 256 + (krand() & 511) + 1024;
a = actor->spr.__int_angle - 256 + (krand() & 511) + 1024;
EGS(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, POPCORN, -32, 36, 36, a, 32 + (krand() & 63), 1024 - (krand() & 1023), actor, 5);
}
return;
@ -968,7 +968,7 @@ static void lotsofpopcorn(DDukeActor *actor, walltype* wal, int n)
z = sect->int_floorz() - (krand() & (abs(sect->int_ceilingz() - sect->int_floorz())));
if (z < -(32 << 8) || z >(32 << 8))
z = actor->int_pos().Z - (32 << 8) + (krand() & ((64 << 8) - 1));
a = actor->spr.ang - 1024;
a = actor->spr.__int_angle - 1024;
EGS(actor->sector(), x1, y1, z, POPCORN, -32, 36, 36, a, 32 + (krand() & 63), -(krand() & 1023), actor, 5);
}
}
@ -2063,7 +2063,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
break;
case BOWLINGBALL:
proj->spr.xvel = (targ->spr.xvel >> 1) + (targ->spr.xvel >> 2);
proj->spr.ang -= (krand() & 16);
proj->spr.__int_angle -= (krand() & 16);
S_PlayActorSound(355, targ);
break;
@ -2076,23 +2076,23 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
if (proj->spr.picnum == QUEBALL || proj->spr.picnum == STRIPEBALL)
{
proj->spr.xvel = (targ->spr.xvel >> 1) + (targ->spr.xvel >> 2);
proj->spr.ang -= (targ->spr.ang << 1) + 1024;
targ->spr.ang = getangle(targ->int_pos().X - proj->int_pos().X, targ->int_pos().Y - proj->int_pos().Y) - 512;
proj->spr.__int_angle -= (targ->spr.__int_angle << 1) + 1024;
targ->spr.__int_angle = getangle(targ->int_pos().X - proj->int_pos().X, targ->int_pos().Y - proj->int_pos().Y) - 512;
if (S_CheckSoundPlaying(POOLBALLHIT) < 2)
S_PlayActorSound(POOLBALLHIT, targ);
}
else if (proj->spr.picnum == BOWLINGPIN || proj->spr.picnum == BOWLINGPIN + 1)
{
proj->spr.xvel = (targ->spr.xvel >> 1) + (targ->spr.xvel >> 2);
proj->spr.ang -= ((targ->spr.ang << 1) + krand()) & 64;
targ->spr.ang = (targ->spr.ang + krand()) & 16;
proj->spr.__int_angle -= ((targ->spr.__int_angle << 1) + krand()) & 64;
targ->spr.__int_angle = (targ->spr.__int_angle + krand()) & 16;
S_PlayActorSound(355, targ);
}
else if (proj->spr.picnum == HENSTAND || proj->spr.picnum == HENSTAND + 1)
{
proj->spr.xvel = (targ->spr.xvel >> 1) + (targ->spr.xvel >> 2);
proj->spr.ang -= ((targ->spr.ang << 1) + krand()) & 16;
targ->spr.ang = (targ->spr.ang + krand()) & 16;
proj->spr.__int_angle -= ((targ->spr.__int_angle << 1) + krand()) & 16;
targ->spr.__int_angle = (targ->spr.__int_angle + krand()) & 16;
S_PlayActorSound(355, targ);
}
else
@ -2100,7 +2100,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
if (krand() & 3)
{
targ->spr.xvel = 164;
targ->spr.ang = proj->spr.ang;
targ->spr.__int_angle = proj->spr.__int_angle;
}
}
break;
@ -2205,7 +2205,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
lotsofglass(targ, nullptr, 40);
S_PlayActorSound(GLASS_BREAKING, targ);
targ->spr.ang = krand() & 2047;
targ->spr.__int_angle = krand() & 2047;
lotsofglass(targ, nullptr, 8);
deletesprite(targ);
break;
@ -2333,7 +2333,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
spawned->spr.pos.Z += 4;
spawned->spr.xvel = 16;
spawned->spr.xrepeat = spawned->spr.yrepeat = 24;
spawned->spr.ang += 32 - (krand() & 63);
spawned->spr.__int_angle += 32 - (krand() & 63);
}
}
@ -2363,7 +2363,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
targ->attackertype = proj->spr.picnum;
targ->hitextra += proj->spr.extra;
if (targ->spr.picnum != COW)
targ->hitang = proj->spr.ang;
targ->hitang = proj->spr.__int_angle;
targ->SetHitOwner(proj->GetOwner());
}

View file

@ -325,7 +325,7 @@ void S_GetCamera(vec3_t* c, int32_t* ca, sectortype** cs)
{
if (c) *c = ud.cameraactor->int_pos();
if (cs) *cs = ud.cameraactor->sector();
if (ca) *ca = ud.cameraactor->spr.ang;
if (ca) *ca = ud.cameraactor->spr.__int_angle;
}
}

View file

@ -70,7 +70,7 @@ DDukeActor* CreateActor(sectortype* whatsectp, const DVector3& pos, int s_pn, in
act->spr.yrepeat = s_yr;
act->spr.pal = 0;
act->spr.ang = s_a;
act->spr.__int_angle = s_a;
act->spr.xvel = s_ve;
act->spr.zvel = s_zv;
act->spr.xoffset = 0;
@ -287,7 +287,7 @@ void spawninitdefault(DDukeActor* actj, DDukeActor *act)
act->timetosleep = 0;
if (actj)
act->spr.ang = actj->spr.ang;
act->spr.__int_angle = actj->spr.__int_angle;
}
}
@ -324,7 +324,7 @@ void spawntransporter(DDukeActor *actj, DDukeActor* act, bool beam)
act->spr.shade = -127;
act->spr.cstat = CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT;
act->spr.ang = actj->spr.ang;
act->spr.__int_angle = actj->spr.__int_angle;
act->spr.xvel = 128;
ChangeActorStat(act, STAT_MISC);
@ -407,7 +407,7 @@ void initfootprint(DDukeActor* actj, DDukeActor* act)
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR;
if ((ps[actj->spr.yvel].footprintcount & 1)) act->spr.cstat |= CSTAT_SPRITE_XFLIP;
act->spr.ang = actj->spr.ang;
act->spr.__int_angle = actj->spr.__int_angle;
}
act->set_int_z(sect->int_floorz());
@ -441,7 +441,7 @@ void initshell(DDukeActor* actj, DDukeActor* act, bool isshell)
}
else
{
a = act->spr.ang;
a = act->spr.__int_angle;
act->spr.pos.Z = actj->spr.pos.Z - gs.playerheight + 3;
}
@ -452,12 +452,12 @@ void initshell(DDukeActor* actj, DDukeActor* act, bool isshell)
if (isNamWW2GI())
{
// to the right, with feeling
act->spr.ang = a + 512;
act->spr.__int_angle = a + 512;
act->spr.xvel = 30;
}
else
{
act->spr.ang = a - 512;
act->spr.__int_angle = a - 512;
act->spr.xvel = 20;
}
@ -530,7 +530,7 @@ void initwaterdrip(DDukeActor* actj, DDukeActor* actor)
actor->add_int_z(-(18 << 8));
}
else actor->add_int_z(-(13 << 8));
actor->spr.ang = getangle(ps[connecthead].player_int_pos().X - actor->int_pos().X, ps[connecthead].player_int_pos().Y - actor->int_pos().Y);
actor->spr.__int_angle = getangle(ps[connecthead].player_int_pos().X - actor->int_pos().X, ps[connecthead].player_int_pos().Y - actor->int_pos().Y);
actor->spr.xvel = 48 - (krand() & 31);
ssp(actor, CLIPMASK0);
}
@ -638,7 +638,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
break;
case SE_18_INCREMENTAL_SECTOR_RISE_FALL:
if (actor->spr.ang == 512)
if (actor->spr.__int_angle == 512)
{
actor->temp_data[1] = sectp->int_ceilingz();
if (actor->spr.pal)
@ -697,7 +697,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
bool ceiling = (abs(actor->temp_data[0] - actor->int_pos().Z) < abs(actor->temp_data[1] - actor->int_pos().Z));
actor->spriteextra = ceiling;
if (actor->spr.ang == 512)
if (actor->spr.__int_angle == 512)
{
if (ceiling)
sectp->setceilingz(actor->spr.pos.Z);
@ -715,7 +715,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
sectp->ceilingstat ^= CSTAT_SECTOR_SKY;
actor->temp_data[3] = 1;
if (!ceiling && actor->spr.ang == 512)
if (!ceiling && actor->spr.__int_angle == 512)
{
sectp->ceilingstat ^= CSTAT_SECTOR_SKY;
actor->temp_data[3] = 0;
@ -724,7 +724,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
sectp->ceilingshade =
sectp->floorshade;
if (actor->spr.ang == 512)
if (actor->spr.__int_angle == 512)
{
for (auto& wl : wallsofsector(sectp))
{
@ -833,7 +833,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
case SE_31_FLOOR_RISE_FALL:
actor->temp_data[1] = sectp->int_floorz();
// actor->temp_data[2] = actor->spr.hitag;
if (actor->spr.ang != 1536) sectp->setfloorz(actor->spr.pos.Z);
if (actor->spr.__int_angle != 1536) sectp->setfloorz(actor->spr.pos.Z);
for (auto& wal : wallsofsector(sectp))
if (wal.hitag == 0) wal.hitag = 9999;
@ -844,7 +844,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
case SE_32_CEILING_RISE_FALL:
actor->temp_data[1] = sectp->int_ceilingz();
actor->temp_data[2] = actor->spr.hitag;
if (actor->spr.ang != 1536) sectp->setceilingz(actor->spr.pos.Z);
if (actor->spr.__int_angle != 1536) sectp->setceilingz(actor->spr.pos.Z);
for (auto& wal : wallsofsector(sectp))
if (wal.hitag == 0) wal.hitag = 9999;
@ -899,7 +899,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
break;
case SE_11_SWINGING_DOOR://Pivitor rotater
if (actor->spr.ang > 1024) actor->temp_data[3] = 2;
if (actor->spr.__int_angle > 1024) actor->temp_data[3] = 2;
else actor->temp_data[3] = -2;
[[fallthrough]];
case SE_0_ROTATING_SECTOR:
@ -931,7 +931,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
act2->spr.lotag == SE_1_PIVOT &&
act2->spr.hitag == actor->spr.hitag)
{
if (actor->spr.ang == 512)
if (actor->spr.__int_angle == 512)
{
actor->copyXY(act2);
}
@ -1088,7 +1088,7 @@ void lotsofglass(DDukeActor *actor, walltype* wal, int n)
{
for (j = n - 1; j >= 0; j--)
{
a = actor->spr.ang - 256 + (krand() & 511) + 1024;
a = actor->spr.__int_angle - 256 + (krand() & 511) + 1024;
EGS(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, TILE_GLASSPIECES + (j % 3), -32, 36, 36, a, 32 + (krand() & 63), 1024 - (krand() & 1023), actor, 5);
}
return;
@ -1113,7 +1113,7 @@ void lotsofglass(DDukeActor *actor, walltype* wal, int n)
z = sect->int_floorz() - (krand() & (abs(sect->int_ceilingz() - sect->int_floorz())));
if (z < -(32 << 8) || z >(32 << 8))
z = actor->int_pos().Z - (32 << 8) + (krand() & ((64 << 8) - 1));
a = actor->spr.ang - 1024;
a = actor->spr.__int_angle - 1024;
EGS(actor->sector(), x1, y1, z, TILE_GLASSPIECES + (j % 3), -32, 36, 36, a, 32 + (krand() & 63), -(krand() & 1023), actor, 5);
}
}
@ -1202,7 +1202,7 @@ void lotsofcolourglass(DDukeActor* actor, walltype* wal, int n)
z = sect->int_floorz() - (krand() & (abs(sect->int_ceilingz() - sect->int_floorz())));
if (z < -(32 << 8) || z >(32 << 8))
z = actor->int_pos().Z - (32 << 8) + (krand() & ((64 << 8) - 1));
a = actor->spr.ang - 1024;
a = actor->spr.__int_angle - 1024;
auto k = EGS(actor->sector(), x1, y1, z, TILE_GLASSPIECES + (j % 3), -32, 36, 36, a, 32 + (krand() & 63), -(krand() & 2047), actor, 5);
if (k) k->spr.pal = krand() & 7;
}

View file

@ -201,7 +201,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
break;
case TONGUE:
if (actj)
act->spr.ang = actj->spr.ang;
act->spr.__int_angle = actj->spr.__int_angle;
act->spr.pos.Z -= gs.playerheight;
act->spr.zvel = 256 - (krand() & 511);
act->spr.xvel = 64 - (krand() & 127);
@ -243,7 +243,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.yrepeat = 0;
}
if (actj) act->spr.ang = actj->temp_data[5] + 512;
if (actj) act->spr.__int_angle = actj->temp_data[5] + 512;
ChangeActorStat(act, STAT_MISC);
break;
@ -340,7 +340,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
ssp(act, CLIPMASK0);
act->temp_data[0] = 17;
act->temp_data[2] = 0;
act->temp_data[5] = act->spr.ang;
act->temp_data[5] = act->spr.__int_angle;
[[fallthrough]];
case SPACEMARINE:
@ -560,7 +560,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->temp_data[0] = krand() & 2047;
act->spr.cstat = randomFlip();
act->spr.xrepeat = act->spr.yrepeat = 8;
act->spr.ang = krand() & 2047;
act->spr.__int_angle = krand() & 2047;
}
ChangeActorStat(act, STAT_MISC);
break;
@ -607,7 +607,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (actj)
{
act->spr.ang = actj->spr.ang;
act->spr.__int_angle = actj->spr.__int_angle;
act->spr.shade = -64;
act->spr.cstat = CSTAT_SPRITE_YCENTER | randomXFlip();
}
@ -683,7 +683,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (act->spr.picnum == WATERBUBBLE)
{
if (actj)
act->spr.ang = actj->spr.ang;
act->spr.__int_angle = actj->spr.__int_angle;
act->spr.xrepeat = act->spr.yrepeat = 4;
}
else act->spr.xrepeat = act->spr.yrepeat = 32;
@ -701,7 +701,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case TRASH:
if (act->spr.picnum != WATERDRIP)
act->spr.ang = krand() & 2047;
act->spr.__int_angle = krand() & 2047;
[[fallthrough]];
case WATERDRIPSPLASH:
@ -876,7 +876,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (act->spr.picnum == RAT)
{
act->spr.ang = krand() & 2047;
act->spr.__int_angle = krand() & 2047;
act->spr.xrepeat = act->spr.yrepeat = 48;
act->spr.cstat = 0;
}
@ -1105,7 +1105,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case STEAM:
if (actj)
{
act->spr.ang = actj->spr.ang;
act->spr.__int_angle = actj->spr.__int_angle;
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT;
act->spr.xrepeat = act->spr.yrepeat = 1;
act->spr.xvel = -8;

View file

@ -283,7 +283,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
break;
case TONGUE:
if (actj)
act->spr.ang = actj->spr.ang;
act->spr.__int_angle = actj->spr.__int_angle;
act->spr.pos.Z -= gs.playerheight;
act->spr.zvel = 256 - (krand() & 511);
act->spr.xvel = 64 - (krand() & 127);
@ -583,7 +583,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->temp_data[0] = krand() & 2047;
act->spr.cstat = randomFlip();
act->spr.xrepeat = act->spr.yrepeat = 8;
act->spr.ang = krand() & 2047;
act->spr.__int_angle = krand() & 2047;
}
ChangeActorStat(act, STAT_MISC);
break;
@ -617,7 +617,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case SMALLSMOKE:
if (actj)
{
act->spr.ang = actj->spr.ang;
act->spr.__int_angle = actj->spr.__int_angle;
act->spr.shade = -64;
act->spr.cstat = CSTAT_SPRITE_YCENTER | randomXFlip();
}
@ -688,7 +688,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (act->spr.picnum == WATERBUBBLE)
{
if (actj)
act->spr.ang = actj->spr.ang;
act->spr.__int_angle = actj->spr.__int_angle;
act->spr.xrepeat = act->spr.yrepeat = 1 + (krand() & 7);
}
else
@ -703,7 +703,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
break;
case TRASH:
if (act->spr.picnum != WATERDRIP) act->spr.ang = krand() & 2047;
if (act->spr.picnum != WATERDRIP) act->spr.__int_angle = krand() & 2047;
act->spr.xrepeat = 24;
act->spr.yrepeat = 24;
@ -1034,7 +1034,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (act->spr.picnum == RAT)
{
act->spr.ang = krand() & 2047;
act->spr.__int_angle = krand() & 2047;
act->spr.xrepeat = act->spr.yrepeat = 48;
act->spr.cstat = 0;
}
@ -1355,7 +1355,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case STEAM:
if (actj)
{
act->spr.ang = actj->spr.ang;
act->spr.__int_angle = actj->spr.__int_angle;
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT;
act->spr.xrepeat = act->spr.yrepeat = 1;
act->spr.xvel = -8;

View file

@ -83,7 +83,7 @@ DExhumedActor* BuildAnim(DExhumedActor* pActor, int val, int val2, int x, int y,
pActor->spr.xrepeat = nRepeat;
pActor->spr.yrepeat = nRepeat;
pActor->spr.picnum = 1;
pActor->spr.ang = 0;
pActor->spr.__int_angle = 0;
pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0;
pActor->spr.xvel = 0;

View file

@ -56,7 +56,7 @@ void BuildAnubis(DExhumedActor* ap, int x, int y, int z, sectortype* pSector, in
x = ap->int_pos().X;
y = ap->int_pos().Y;
z = ap->sector()->int_floorz();
nAngle = ap->spr.ang;
nAngle = ap->spr.__int_angle;
}
ap->set_int_pos({ x, y, z });
@ -67,7 +67,7 @@ void BuildAnubis(DExhumedActor* ap, int x, int y, int z, sectortype* pSector, in
ap->spr.picnum = 1;
ap->spr.pal = ap->sector()->ceilingpal;
ap->spr.clipdist = 60;
ap->spr.ang = nAngle;
ap->spr.__int_angle = nAngle;
ap->spr.xrepeat = 40;
ap->spr.yrepeat = 40;
ap->spr.xvel = 0;
@ -159,8 +159,8 @@ void AIAnubis::Tick(RunListEvent* ev)
ap->nFrame = 0;
ap->pTarget = pTarget;
ap->spr.xvel = bcos(ap->spr.ang, -2);
ap->spr.yvel = bsin(ap->spr.ang, -2);
ap->spr.xvel = bcos(ap->spr.__int_angle, -2);
ap->spr.yvel = bsin(ap->spr.__int_angle, -2);
}
}
return;
@ -171,7 +171,7 @@ void AIAnubis::Tick(RunListEvent* ev)
{
PlotCourseToSprite(ap, pTarget);
int nAngle = ap->spr.ang & 0xFFF8;
int nAngle = ap->spr.__int_angle & 0xFFF8;
ap->spr.xvel = bcos(nAngle, -2);
ap->spr.yvel = bsin(nAngle, -2);
}
@ -183,7 +183,7 @@ void AIAnubis::Tick(RunListEvent* ev)
if (move.actor() == pTarget)
{
int nAng = getangle(pTarget->int_pos().X - ap->int_pos().X, pTarget->int_pos().Y - ap->int_pos().Y);
int nAngDiff = AngleDiff(ap->spr.ang, nAng);
int nAngDiff = AngleDiff(ap->spr.__int_angle, nAng);
if (nAngDiff < 64)
{
@ -197,9 +197,9 @@ void AIAnubis::Tick(RunListEvent* ev)
}
case kHitWall:
{
ap->spr.ang = (ap->spr.ang + 256) & kAngleMask;
ap->spr.xvel = bcos(ap->spr.ang, -2);
ap->spr.yvel = bsin(ap->spr.ang, -2);
ap->spr.__int_angle = (ap->spr.__int_angle + 256) & kAngleMask;
ap->spr.xvel = bcos(ap->spr.__int_angle, -2);
ap->spr.yvel = bsin(ap->spr.__int_angle, -2);
break;
}
@ -220,7 +220,7 @@ void AIAnubis::Tick(RunListEvent* ev)
{
ap->spr.xvel = 0;
ap->spr.yvel = 0;
ap->spr.ang = GetMyAngle(pTarget->int_pos().X - ap->int_pos().X, pTarget->int_pos().Y - ap->int_pos().Y);
ap->spr.__int_angle = GetMyAngle(pTarget->int_pos().X - ap->int_pos().X, pTarget->int_pos().Y - ap->int_pos().Y);
ap->nAction = 3;
ap->nFrame = 0;
@ -262,8 +262,8 @@ void AIAnubis::Tick(RunListEvent* ev)
{
ap->nAction = 1;
ap->spr.xvel = bcos(ap->spr.ang, -2);
ap->spr.yvel = bsin(ap->spr.ang, -2);
ap->spr.xvel = bcos(ap->spr.__int_angle, -2);
ap->spr.yvel = bsin(ap->spr.__int_angle, -2);
ap->nFrame = 0;
}
else
@ -271,7 +271,7 @@ void AIAnubis::Tick(RunListEvent* ev)
// loc_25718:
if (nFlag & 0x80)
{
BuildBullet(ap, 8, -1, ap->spr.ang, pTarget, 1);
BuildBullet(ap, 8, -1, ap->spr.__int_angle, pTarget, 1);
}
}

View file

@ -52,7 +52,7 @@ DExhumedActor* BuildBubble(vec3_t pos, sectortype* pSector)
pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0;
pActor->spr.picnum = 1;
pActor->spr.ang = inita;
pActor->spr.__int_angle = inita;
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
pActor->spr.zvel = -1200;

View file

@ -229,7 +229,7 @@ void BulletHitsSprite(Bullet *pBullet, DExhumedActor* pBulletActor, DExhumedActo
if (nStat == kStatAnubisDrum)
{
int nAngle = (pActor->spr.ang + 256) - RandomSize(9);
int nAngle = (pActor->spr.__int_angle + 256) - RandomSize(9);
pHitActor->spr.xvel = bcos(nAngle, 1);
pHitActor->spr.yvel = bsin(nAngle, 1);
@ -240,8 +240,8 @@ void BulletHitsSprite(Bullet *pBullet, DExhumedActor* pBulletActor, DExhumedActo
int xVel = pHitActor->spr.xvel;
int yVel = pHitActor->spr.yvel;
pHitActor->spr.xvel = bcos(pActor->spr.ang, -2);
pHitActor->spr.yvel = bsin(pActor->spr.ang, -2);
pHitActor->spr.xvel = bcos(pActor->spr.__int_angle, -2);
pHitActor->spr.yvel = bsin(pActor->spr.__int_angle, -2);
MoveCreature(pHitActor);
@ -433,7 +433,7 @@ MOVEEND:
dz = -bsin(pBullet->nPitch, 3);
else
dz = -pBullet->nPitch * 512;
hitscan(startPos, pActor->sector(), { bcos(pActor->spr.ang), bsin(pActor->spr.ang), dz }, hit, CLIPMASK1);
hitscan(startPos, pActor->sector(), { bcos(pActor->spr.__int_angle), bsin(pActor->spr.__int_angle), dz }, hit, CLIPMASK1);
x2 = hit.hitpos.X;
y2 = hit.hitpos.Y;
z2 = hit.hitpos.Z;
@ -501,7 +501,7 @@ HITSPRITE:
{
if (pHitWall != nullptr)
{
BackUpBullet(&x2, &y2, pActor->spr.ang);
BackUpBullet(&x2, &y2, pActor->spr.__int_angle);
if (nType != 3 || RandomSize(2) == 0)
{
@ -563,7 +563,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
sBullet.nDoubleDamage = nDoubleDamage;
sBullet.pActor = insertActor(pActor->sector(), 200);
sBullet.pActor->spr.ang = nAngle;
sBullet.pActor->spr.__int_angle = nAngle;
int nHeight = GetActorHeight(pTarget);
@ -631,7 +631,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
pBulletActor->spr.yrepeat = (uint8_t)nRepeat;
pBulletActor->spr.xoffset = 0;
pBulletActor->spr.yoffset = 0;
pBulletActor->spr.ang = nAngle;
pBulletActor->spr.__int_angle = nAngle;
pBulletActor->spr.xvel = 0;
pBulletActor->spr.yvel = 0;
pBulletActor->spr.zvel = 0;
@ -744,7 +744,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
y -= pBulletActor->int_pos().Y;
nAngle = GetMyAngle(x, y);
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
}
else
{

View file

@ -149,7 +149,7 @@ void BuildFish(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
x = pActor->int_pos().X;
y = pActor->int_pos().Y;
z = pActor->int_pos().Z;
nAngle = pActor->spr.ang;
nAngle = pActor->spr.__int_angle;
ChangeActorStat(pActor, 103);
}
@ -166,7 +166,7 @@ void BuildFish(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
pActor->spr.zvel = 0;
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
pActor->spr.lotag = runlist_HeadRun() + 1;
pActor->spr.hitag = 0;
pActor->spr.extra = -1;
@ -187,11 +187,11 @@ void BuildFish(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
void IdleFish(DExhumedActor* pActor, int edx)
{
pActor->spr.ang += (256 - RandomSize(9)) + 1024;
pActor->spr.ang &= kAngleMask;
pActor->spr.__int_angle += (256 - RandomSize(9)) + 1024;
pActor->spr.__int_angle &= kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.ang, -8);
pActor->spr.yvel = bsin(pActor->spr.ang, -8);
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -8);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -8);
pActor->nAction = 0;
pActor->nFrame = 0;
@ -377,8 +377,8 @@ void AIFish::Tick(RunListEvent* ev)
if (z <= nHeight)
{
pActor->spr.xvel = bcos(pActor->spr.ang, -5) - bcos(pActor->spr.ang, -7);
pActor->spr.yvel = bsin(pActor->spr.ang, -5) - bsin(pActor->spr.ang, -7);
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -5) - bcos(pActor->spr.__int_angle, -7);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -5) - bsin(pActor->spr.__int_angle, -7);
}
else
{
@ -460,7 +460,7 @@ void AIFish::Tick(RunListEvent* ev)
if (pHitAct->spr.statnum == 100)
{
pActor->pTarget = coll.actor();
pActor->spr.ang = GetMyAngle(pHitAct->int_pos().X - pActor->int_pos().X, pHitAct->int_pos().Y - pActor->int_pos().Y);
pActor->spr.__int_angle = GetMyAngle(pHitAct->int_pos().X - pActor->int_pos().X, pHitAct->int_pos().Y - pActor->int_pos().Y);
if (nAction != 3)
{

View file

@ -55,18 +55,18 @@ void ThrowGrenade(int nPlayer, int, int, int ecx, int push1)
DExhumedActor* pActor = PlayerList[nPlayer].pPlayerGrenade;
auto pPlayerActor = PlayerList[nPlayer].pActor;
int nAngle = pPlayerActor->spr.ang;
int nAngle = pPlayerActor->spr.__int_angle;
ChangeActorSect(pActor, PlayerList[nPlayer].pPlayerViewSect);
pActor->set_int_pos(pPlayerActor->int_pos());
if (nAngle < 0) {
nAngle = pPlayerActor->spr.ang;
nAngle = pPlayerActor->spr.__int_angle;
}
pActor->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE;
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
if (push1 >= -3000)
{
@ -112,7 +112,7 @@ void BuildGrenade(int nPlayer)
pActor->spr.clipdist = 30;
pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0;
pActor->spr.ang = pPlayerActor->spr.ang;
pActor->spr.__int_angle = pPlayerActor->spr.__int_angle;
pActor->spr.intowner = nPlayer;
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
@ -171,7 +171,7 @@ void ExplodeGrenade(DExhumedActor* pActor)
if (pActor->nTurn < 0)
{
auto pPlayerActor = PlayerList[nPlayer].pActor;
int nAngle = pPlayerActor->spr.ang;
int nAngle = pPlayerActor->spr.__int_angle;
pActor->set_int_pos({ bcos(nAngle, -5) + pPlayerActor->int_pos().X, bsin(nAngle, -5) + pPlayerActor->int_pos().Y, pPlayerActor->int_pos().Z });
@ -322,7 +322,7 @@ void AIGrenade::Tick(RunListEvent* ev)
}
else if (nMov.type == kHitSprite)
{
BounceGrenade(pActor, nMov.actor()->spr.ang);
BounceGrenade(pActor, nMov.actor()->spr.__int_angle);
}
pActor->nHealth = 0;

View file

@ -245,7 +245,7 @@ Collision CheckCloseRange(int nPlayer, int *x, int *y, int *z, sectortype* *ppSe
{
auto pActor = PlayerList[nPlayer].pActor;
int ang = pActor->spr.ang;
int ang = pActor->spr.__int_angle;
int xVect = bcos(ang);
int yVect = bsin(ang);
@ -647,7 +647,7 @@ loc_flag:
}
int nAmmoType = WeaponInfo[nWeapon].nAmmoType;
int nAngle = pPlayerActor->spr.ang;
int nAngle = pPlayerActor->spr.__int_angle;
int theX = pPlayerActor->int_pos().X;
int theY = pPlayerActor->int_pos().Y;
int theZ = pPlayerActor->int_pos().Z;
@ -809,7 +809,7 @@ loc_flag:
// only autoaim if target is in front of the player.
assert(t->sector());
int angletotarget = bvectangbam(t->int_pos().X - pPlayerActor->int_pos().X, t->int_pos().Y - pPlayerActor->int_pos().Y).asbuild();
int anglediff = (pPlayerActor->spr.ang - angletotarget) & 2047;
int anglediff = (pPlayerActor->spr.__int_angle - angletotarget) & 2047;
if (anglediff < 512 || anglediff > 1536)
{
target = t;
@ -831,8 +831,8 @@ loc_flag:
BuildSnake(nPlayer, nHeight);
nQuake[nPlayer] = 512;
PlayerList[nPlayer].nDamage.X -= bcos(pPlayerActor->spr.ang, 9);
PlayerList[nPlayer].nDamage.Y -= bsin(pPlayerActor->spr.ang, 9);
PlayerList[nPlayer].nDamage.X -= bcos(pPlayerActor->spr.__int_angle, 9);
PlayerList[nPlayer].nDamage.Y -= bsin(pPlayerActor->spr.__int_angle, 9);
break;
}
case kWeaponRing:

View file

@ -628,14 +628,14 @@ void ProcessSpriteTag(DExhumedActor* pActor, int nLotag, int nHitag)
{
auto pSector = pActor->sector();
pSector->Speed = nSpeed;
pSector->Flag |= pActor->spr.ang;
pSector->Flag |= pActor->spr.__int_angle;
DeleteActor(pActor);
return;
}
case 88:
{
AddFlow(pActor->sector(), nSpeed, 0, pActor->spr.ang);
AddFlow(pActor->sector(), nSpeed, 0, pActor->spr.__int_angle);
DeleteActor(pActor);
return;
@ -650,7 +650,7 @@ void ProcessSpriteTag(DExhumedActor* pActor, int nLotag, int nHitag)
}
case 78:
{
AddFlow(pActor->sector(), nSpeed, 1, pActor->spr.ang);
AddFlow(pActor->sector(), nSpeed, 1, pActor->spr.__int_angle);
auto pSector = pActor->sector();
pSector->Flag |= 0x8000;

View file

@ -379,7 +379,7 @@ void StartRegenerate(DExhumedActor* pActor)
if (!(currentLevel->gameflags & LEVEL_EX_MULTI))
{
pActor->spr.ang /= 5;
pActor->spr.__int_angle /= 5;
}
pActor->spr.cstat = CSTAT_SPRITE_INVISIBLE;

View file

@ -106,7 +106,7 @@ void BuildLava(DExhumedActor* pActor, int x, int y, int, sectortype* pSector, in
else
{
pSector = pActor->sector();
nAngle = pActor->spr.ang;
nAngle = pActor->spr.__int_angle;
x = pActor->int_pos().X;
y = pActor->int_pos().Y;
@ -126,7 +126,7 @@ void BuildLava(DExhumedActor* pActor, int x, int y, int, sectortype* pSector, in
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
pActor->spr.zvel = 0;
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
pActor->spr.hitag = 0;
pActor->spr.lotag = runlist_HeadRun() + 1;
@ -265,8 +265,8 @@ void AILavaDude::Tick(RunListEvent* ev)
PlotCourseToSprite(pActor, pTarget);
pActor->spr.xvel = bcos(pActor->spr.ang);
pActor->spr.yvel = bsin(pActor->spr.ang);
pActor->spr.xvel = bcos(pActor->spr.__int_angle);
pActor->spr.yvel = bsin(pActor->spr.__int_angle);
if (pTarget && !RandomSize(1))
{
@ -290,9 +290,9 @@ void AILavaDude::Tick(RunListEvent* ev)
ChangeActorSect(pActor, pSector);
pActor->set_int_pos({ x, y, z });
pActor->spr.ang = (pActor->spr.ang + ((RandomWord() & 0x3FF) + 1024)) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.ang);
pActor->spr.yvel = bsin(pActor->spr.ang);
pActor->spr.__int_angle = (pActor->spr.__int_angle + ((RandomWord() & 0x3FF) + 1024)) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.__int_angle);
pActor->spr.yvel = bsin(pActor->spr.__int_angle);
break;
}
@ -302,9 +302,9 @@ void AILavaDude::Tick(RunListEvent* ev)
if (coll.type == kHitWall)
{
pActor->spr.ang = (pActor->spr.ang + ((RandomWord() & 0x3FF) + 1024)) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.ang);
pActor->spr.yvel = bsin(pActor->spr.ang);
pActor->spr.__int_angle = (pActor->spr.__int_angle + ((RandomWord() & 0x3FF) + 1024)) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.__int_angle);
pActor->spr.yvel = bsin(pActor->spr.__int_angle);
break;
}
else if (coll.type == kHitSprite)
@ -312,7 +312,7 @@ void AILavaDude::Tick(RunListEvent* ev)
if (coll.actor() == pTarget)
{
int nAng = getangle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
if (AngleDiff(pActor->spr.ang, nAng) < 64)
if (AngleDiff(pActor->spr.__int_angle, nAng) < 64)
{
pActor->nAction = 2;
pActor->nFrame = 0;
@ -353,7 +353,7 @@ void AILavaDude::Tick(RunListEvent* ev)
int nHeight = GetActorHeight(pActor);
GetUpAngle(pActor, -64000, pTarget, (-(nHeight >> 1)));
BuildBullet(pActor, 10, -1, pActor->spr.ang, pTarget, 1);
BuildBullet(pActor, 10, -1, pActor->spr.__int_angle, pTarget, 1);
}
else if (var_1C)
{

View file

@ -53,7 +53,7 @@ void BuildLion(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
x = pActor->int_pos().X;
y = pActor->int_pos().Y;
z = pActor->sector()->int_floorz();
nAngle = pActor->spr.ang;
nAngle = pActor->spr.__int_angle;
}
pActor->set_int_pos({ x, y, z });
@ -66,7 +66,7 @@ void BuildLion(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
pActor->spr.pal = pActor->sector()->ceilingpal;
pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0;
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
pActor->spr.zvel = 0;
@ -170,7 +170,7 @@ void AILion::Damage(RunListEvent* ev)
PlotCourseToSprite(pActor, pTarget);
pActor->nAction = 5;
pActor->nCount = RandomSize(3);
pActor->spr.ang = (pActor->spr.ang - (RandomSize(1) << 8)) + (RandomSize(1) << 8); // NOTE: no angle mask in original code
pActor->spr.__int_angle = (pActor->spr.__int_angle - (RandomSize(1) << 8)) + (RandomSize(1) << 8); // NOTE: no angle mask in original code
}
else
{
@ -238,8 +238,8 @@ void AILion::Tick(RunListEvent* ev)
pActor->nAction = 2;
pActor->nFrame = 0;
pActor->spr.xvel = bcos(pActor->spr.ang, -1);
pActor->spr.yvel = bsin(pActor->spr.ang, -1);
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -1);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -1);
pActor->pTarget = pTarget;
return;
}
@ -253,9 +253,9 @@ void AILion::Tick(RunListEvent* ev)
{
if (RandomBit())
{
pActor->spr.ang = RandomWord() & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.ang, -1);
pActor->spr.yvel = bsin(pActor->spr.ang, -1);
pActor->spr.__int_angle = RandomWord() & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -1);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -1);
}
else
{
@ -276,7 +276,7 @@ void AILion::Tick(RunListEvent* ev)
{
PlotCourseToSprite(pActor, pTarget);
int nAng = pActor->spr.ang & 0xFFF8;
int nAng = pActor->spr.__int_angle & 0xFFF8;
if (pActor->spr.cstat & CSTAT_SPRITE_INVISIBLE)
{
@ -293,9 +293,9 @@ void AILion::Tick(RunListEvent* ev)
if (nMov.type == kHitWall)
{
// loc_378FA:
pActor->spr.ang = (pActor->spr.ang + 256) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.ang, -1);
pActor->spr.yvel = bsin(pActor->spr.ang, -1);
pActor->spr.__int_angle = (pActor->spr.__int_angle + 256) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -1);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -1);
break;
}
else if (nMov.type == kHitSprite)
@ -313,7 +313,7 @@ void AILion::Tick(RunListEvent* ev)
{
int nAng = getangle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
if (AngleDiff(pActor->spr.ang, nAng) < 64)
if (AngleDiff(pActor->spr.__int_angle, nAng) < 64)
{
pActor->nAction = 3;
}
@ -325,9 +325,9 @@ void AILion::Tick(RunListEvent* ev)
else
{
// loc_378FA:
pActor->spr.ang = (pActor->spr.ang + 256) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.ang, -1);
pActor->spr.yvel = bsin(pActor->spr.ang, -1);
pActor->spr.__int_angle = (pActor->spr.__int_angle + 256) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -1);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -1);
break;
}
}
@ -388,8 +388,8 @@ void AILion::Tick(RunListEvent* ev)
int nCheckDist = 0x7FFFFFFF;
int nAngle = pActor->spr.ang;
int nScanAngle = (pActor->spr.ang - 512) & kAngleMask;
int nAngle = pActor->spr.__int_angle;
int nScanAngle = (pActor->spr.__int_angle - 512) & kAngleMask;
for (int i = 0; i < 5; i++)
{
@ -413,11 +413,11 @@ void AILion::Tick(RunListEvent* ev)
nScanAngle &= kAngleMask;
}
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
pActor->nAction = 6;
pActor->spr.xvel = bcos(pActor->spr.ang) - bcos(pActor->spr.ang, -3);
pActor->spr.yvel = bsin(pActor->spr.ang) - bsin(pActor->spr.ang, -3);
pActor->spr.xvel = bcos(pActor->spr.__int_angle) - bcos(pActor->spr.__int_angle, -3);
pActor->spr.yvel = bsin(pActor->spr.__int_angle) - bsin(pActor->spr.__int_angle, -3);
D3PlayFX(StaticSound[kSound24], pActor);
}
@ -436,7 +436,7 @@ void AILion::Tick(RunListEvent* ev)
if (nMov.type == kHitWall)
{
pActor->nAction = 7;
pActor->spr.ang = (GetWallNormal(nMov.hitWall) + 1024) & kAngleMask;
pActor->spr.__int_angle = (GetWallNormal(nMov.hitWall) + 1024) & kAngleMask;
pActor->nCount = RandomSize(4);
return;
}
@ -445,7 +445,7 @@ void AILion::Tick(RunListEvent* ev)
if (nMov.actor() == pTarget)
{
int nAng = getangle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
if (AngleDiff(pActor->spr.ang, nAng) < 64)
if (AngleDiff(pActor->spr.__int_angle, nAng) < 64)
{
pActor->nAction = 3;
pActor->nFrame = 0;
@ -454,9 +454,9 @@ void AILion::Tick(RunListEvent* ev)
else
{
// loc_378FA:
pActor->spr.ang = (pActor->spr.ang + 256) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.ang, -1);
pActor->spr.yvel = bsin(pActor->spr.ang, -1);
pActor->spr.__int_angle = (pActor->spr.__int_angle + 256) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -1);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -1);
break;
}
}
@ -477,14 +477,14 @@ void AILion::Tick(RunListEvent* ev)
}
else
{
pActor->spr.ang = (RandomSize(9) + (pActor->spr.ang + 768)) & kAngleMask;
pActor->spr.__int_angle = (RandomSize(9) + (pActor->spr.__int_angle + 768)) & kAngleMask;
}
pActor->spr.zvel = -1000;
pActor->nAction = 6;
pActor->spr.xvel = bcos(pActor->spr.ang) - bcos(pActor->spr.ang, -3);
pActor->spr.yvel = bsin(pActor->spr.ang) - bsin(pActor->spr.ang, -3);
pActor->spr.xvel = bcos(pActor->spr.__int_angle) - bcos(pActor->spr.__int_angle, -3);
pActor->spr.yvel = bsin(pActor->spr.__int_angle) - bsin(pActor->spr.__int_angle, -3);
D3PlayFX(StaticSound[kSound24], pActor);
}

View file

@ -644,9 +644,9 @@ Collision MoveCreatureWithCaution(DExhumedActor* pActor)
ChangeActorSect(pActor, pSectorPre);
pActor->spr.ang = (pActor->spr.ang + 256) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.ang, -2);
pActor->spr.yvel = bsin(pActor->spr.ang, -2);
pActor->spr.__int_angle = (pActor->spr.__int_angle + 256) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -2);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -2);
Collision c;
c.setNone();
return c;
@ -672,7 +672,7 @@ int PlotCourseToSprite(DExhumedActor* pActor1, DExhumedActor* pActor2)
int x = pActor2->int_pos().X - pActor1->int_pos().X;
int y = pActor2->int_pos().Y - pActor1->int_pos().Y;
pActor1->spr.ang = GetMyAngle(x, y);
pActor1->spr.__int_angle = GetMyAngle(x, y);
uint32_t x2 = abs(x);
uint32_t y2 = abs(y);
@ -1079,7 +1079,7 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel)
initx = pActor->int_pos().X;
inity = pActor->int_pos().Y;
initz = pActor->int_pos().Z;
inita = pActor->spr.ang;
inita = pActor->spr.__int_angle;
initsectp = pActor->sector();
}
@ -1149,7 +1149,7 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int ebx, int
if (pActor2 == nullptr)
{
pActor->spr.zvel = 0;
nAngle = pActor->spr.ang;
nAngle = pActor->spr.__int_angle;
}
else
{
@ -1172,7 +1172,7 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int ebx, int
int var_18 = GetMyAngle(nSqrt, ((pActor2->int_pos().Z - nHeight) - pActor->int_pos().Z) >> 8);
int nAngDelta = AngleDelta(pActor->spr.ang, nMyAngle, 1024);
int nAngDelta = AngleDelta(pActor->spr.__int_angle, nMyAngle, 1024);
int nAngDelta2 = abs(nAngDelta);
if (nAngDelta2 > 63)
@ -1196,13 +1196,13 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int ebx, int
nAngDelta = -push1;
}
nAngle = (nAngDelta + pActor->spr.ang) & kAngleMask;
nAngle = (nAngDelta + pActor->spr.__int_angle) & kAngleMask;
int nAngDeltaD = AngleDelta(pActor->spr.zvel, var_18, 24);
pActor->spr.zvel = (pActor->spr.zvel + nAngDeltaD) & kAngleMask;
}
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
int eax = abs(bcos(pActor->spr.zvel));
@ -1244,8 +1244,8 @@ void WheresMyMouth(int nPlayer, vec3_t* pos, sectortype **sectnum)
Collision scratch;
clipmove(*pos, sectnum,
bcos(pActor->spr.ang, 7),
bsin(pActor->spr.ang, 7),
bcos(pActor->spr.__int_angle, 7),
bsin(pActor->spr.__int_angle, 7),
5120, 1280, 1280, CLIPMASK1, scratch);
}
@ -1435,7 +1435,7 @@ void AICreatureChunk::Tick(RunListEvent* ev)
}
else if (nVal.type == kHitSprite)
{
nAngle = nVal.actor()->spr.ang;
nAngle = nVal.actor()->spr.__int_angle;
}
else if (nVal.type == kHitWall)
{

View file

@ -48,7 +48,7 @@ void BuildMummy(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
x = pActor->int_pos().X;
y = pActor->int_pos().Y;
z = pActor->int_pos().Z;
nAngle = pActor->spr.ang;
nAngle = pActor->spr.__int_angle;
ChangeActorStat(pActor, 102);
}
@ -65,7 +65,7 @@ void BuildMummy(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
pActor->spr.pal = pActor->sector()->ceilingpal;
pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0;
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
pActor->spr.picnum = 1;
pActor->spr.hitag = 0;
pActor->spr.lotag = runlist_HeadRun() + 1;
@ -181,8 +181,8 @@ void AIMummy::Tick(RunListEvent* ev)
pActor->nAction = 1;
pActor->nCount = 90;
pActor->spr.xvel = bcos(pActor->spr.ang, -2);
pActor->spr.yvel = bsin(pActor->spr.ang, -2);
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -2);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -2);
}
}
}
@ -223,8 +223,8 @@ void AIMummy::Tick(RunListEvent* ev)
// loc_2B5A8
if (!pActor->nFrame)
{
pActor->spr.xvel = bcos(pActor->spr.ang, -1);
pActor->spr.yvel = bsin(pActor->spr.ang, -1);
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -1);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -1);
}
if (pActor->spr.xvel || pActor->spr.yvel)
@ -264,9 +264,9 @@ void AIMummy::Tick(RunListEvent* ev)
{
case kHitWall:
{
pActor->spr.ang = (pActor->spr.ang + ((RandomWord() & 0x3FF) + 1024)) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.ang, -2);
pActor->spr.yvel = bsin(pActor->spr.ang, -2);
pActor->spr.__int_angle = (pActor->spr.__int_angle + ((RandomWord() & 0x3FF) + 1024)) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -2);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -2);
return;
}
@ -275,7 +275,7 @@ void AIMummy::Tick(RunListEvent* ev)
if (nMov.actor() == pTarget)
{
int nAngle = getangle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
if (AngleDiff(pActor->spr.ang, nAngle) < 64)
if (AngleDiff(pActor->spr.__int_angle, nAngle) < 64)
{
pActor->nAction = 2;
pActor->nFrame = 0;
@ -328,7 +328,7 @@ void AIMummy::Tick(RunListEvent* ev)
SetQuake(pActor, 100);
// low 16 bits of returned var contains the sprite index, the high 16 the bullet number
auto pBullet = BuildBullet(pActor, 9, -15360, pActor->spr.ang, pTarget, 1);
auto pBullet = BuildBullet(pActor, 9, -15360, pActor->spr.__int_angle, pTarget, 1);
CheckMummyRevive(pActor);
if (pBullet)

View file

@ -1310,12 +1310,12 @@ void AITrap::Tick(RunListEvent* ev)
return;
}
auto pBullet = BuildBullet(pActor, nType, 0, pActor->spr.ang, nullptr, 1);
auto pBullet = BuildBullet(pActor, nType, 0, pActor->spr.__int_angle, nullptr, 1);
if (pBullet)
{
if (nType == 15)
{
pBullet->spr.ang = (pBullet->spr.ang - 512) & kAngleMask;
pBullet->spr.__int_angle = (pBullet->spr.__int_angle - 512) & kAngleMask;
D3PlayFX(StaticSound[kSound32], pBullet);
}
else
@ -1382,7 +1382,7 @@ DExhumedActor* BuildSpark(DExhumedActor* pActor, int nVal)
}
else
{
int nAngle = (pActor->spr.ang + 256) - RandomSize(9);
int nAngle = (pActor->spr.__int_angle + 256) - RandomSize(9);
if (nVal)
{
@ -1502,7 +1502,7 @@ void DoFinale()
if (!(dword_96788 & 2))
{
int nAng = RandomSize(11);
pFinaleSpr->spr.ang = nAng;
pFinaleSpr->spr.__int_angle = nAng;
BuildSpark(pFinaleSpr, 1);
}
@ -1675,7 +1675,7 @@ void ExplodeEnergyBlock(DExhumedActor* pActor)
for (int i = 0; i < 20; i++)
{
pActor->spr.ang = RandomSize(11);
pActor->spr.__int_angle = RandomSize(11);
BuildSpark(pActor, 1); // shoot out blue orbs
}
@ -1741,7 +1741,7 @@ void AIEnergyBlock::Damage(RunListEvent* ev)
auto pActor2 = insertActor(lasthitsect, 0);
pActor2->spr.ang = ev->nParam;
pActor2->spr.__int_angle = ev->nParam;
pActor2->set_int_pos({ lasthitx, lasthity, lasthitz });
BuildSpark(pActor2, 0); // shoot out blue orb when damaged

View file

@ -265,8 +265,8 @@ void RestartPlayer(int nPlayer)
pActor->set_int_pos(nNStartSprite->int_pos());
ChangeActorSect(pActor, nNStartSprite->sector());
plr->angle.ang = buildang(nNStartSprite->spr.ang&kAngleMask);
pActor->spr.ang = plr->angle.ang.asbuild();
plr->angle.ang = buildang(nNStartSprite->spr.__int_angle&kAngleMask);
pActor->spr.__int_angle = plr->angle.ang.asbuild();
floorsprt = insertActor(pActor->sector(), 0);
@ -280,7 +280,7 @@ void RestartPlayer(int nPlayer)
{
pActor->set_int_pos({ plr->sPlayerSave.x, plr->sPlayerSave.y, plr->sPlayerSave.pSector->int_floorz() });
plr->angle.ang = buildang(plr->sPlayerSave.nAngle&kAngleMask);
pActor->spr.ang = plr->angle.ang.asbuild();
pActor->spr.__int_angle = plr->angle.ang.asbuild();
floorsprt = nullptr;
}
@ -317,7 +317,7 @@ void RestartPlayer(int nPlayer)
pDActor->spr.xoffset = 0;
pDActor->spr.yoffset = 0;
pDActor->spr.shade = pActor->spr.shade;
pDActor->spr.ang = pActor->spr.ang;
pDActor->spr.__int_angle = pActor->spr.__int_angle;
pDActor->spr.cstat = pActor->spr.cstat;
pDActor->spr.lotag = runlist_HeadRun() + 1;
@ -593,7 +593,7 @@ static void pickupMessage(int no)
void UpdatePlayerSpriteAngle(Player* pPlayer)
{
inita = pPlayer->angle.ang.asbuild();
if (pPlayer->pActor) pPlayer->pActor->spr.ang = inita;
if (pPlayer->pActor) pPlayer->pActor->spr.__int_angle = inita;
}
void AIPlayer::Draw(RunListEvent* ev)
@ -924,7 +924,7 @@ void AIPlayer::Tick(RunListEvent* ev)
{
auto ang = GetAngleToSprite(pPlayerActor, pSpiritSprite) & kAngleMask;
PlayerList[nPlayer].angle.settarget(buildang(ang), true);
pPlayerActor->spr.ang = ang;
pPlayerActor->spr.__int_angle = ang;
PlayerList[nPlayer].horizon.settarget(buildhoriz(0), true);
@ -1017,7 +1017,7 @@ void AIPlayer::Tick(RunListEvent* ev)
{
if ((sect->hitag == 45) && bTouchFloor)
{
int nDiff = AngleDiff(nNormal, (pPlayerActor->spr.ang + 1024) & kAngleMask);
int nDiff = AngleDiff(nNormal, (pPlayerActor->spr.__int_angle + 1024) & kAngleMask);
if (nDiff < 0) {
nDiff = -nDiff;
@ -1284,7 +1284,7 @@ sectdone:
HitInfo near;
// neartag finds the nearest sector, wall, and sprite which has its hitag and/or lotag set to a value.
neartag(pPlayerActor->int_pos(), pPlayerActor->sector(), pPlayerActor->spr.ang, near, 1024, 2);
neartag(pPlayerActor->int_pos(), pPlayerActor->sector(), pPlayerActor->spr.__int_angle, near, 1024, 2);
DExhumedActor* pActorB;
feebtag(pPlayerActor->int_pos().X, pPlayerActor->int_pos().Y, pPlayerActor->int_pos().Z, pPlayerActor->sector(), &pActorB, var_30, 768);
@ -2182,7 +2182,7 @@ sectdone:
ChangeActorStat(pActorB, 899);
}
SetSavePoint(nPlayer, pPlayerActor->int_pos().X, pPlayerActor->int_pos().Y, pPlayerActor->int_pos().Z, pPlayerActor->sector(), pPlayerActor->spr.ang);
SetSavePoint(nPlayer, pPlayerActor->int_pos().X, pPlayerActor->int_pos().Y, pPlayerActor->int_pos().Z, pPlayerActor->sector(), pPlayerActor->spr.__int_angle);
break;
}
@ -2530,7 +2530,7 @@ sectdone:
inity = pPlayerActor->int_pos().Y;
initz = pPlayerActor->int_pos().Z;
initsectp = pPlayerActor->sector();
inita = pPlayerActor->spr.ang;
inita = pPlayerActor->spr.__int_angle;
}
if (!PlayerList[nPlayer].nHealth)
@ -2576,7 +2576,7 @@ sectdone:
if (pPlayerActor->sector()->pAbove != nullptr)
{
pDopple->spr.ang = pPlayerActor->spr.ang;
pDopple->spr.__int_angle = pPlayerActor->spr.__int_angle;
ChangeActorSect(pDopple, pPlayerActor->sector()->pAbove);
pDopple->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
}
@ -2737,7 +2737,7 @@ DEFINE_ACTION_FUNCTION(_ExhumedPlayer, IsUnderwater)
DEFINE_ACTION_FUNCTION(_ExhumedPlayer, GetAngle)
{
PARAM_SELF_STRUCT_PROLOGUE(Player);
ACTION_RETURN_INT(self->pActor->spr.ang);
ACTION_RETURN_INT(self->pActor->spr.__int_angle);
}

View file

@ -282,7 +282,7 @@ void DestroyAllEggs()
void SetHeadVel(DExhumedActor* pActor)
{
int nAngle = pActor->spr.ang;
int nAngle = pActor->spr.__int_angle;
pActor->spr.xvel = bcos(nAngle, nVelShift);
pActor->spr.yvel = bsin(nAngle, nVelShift);
@ -295,7 +295,7 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int val
if (pActor2 == nullptr)
{
pActor->spr.zvel = 0;
nAngle = pActor->spr.ang;
nAngle = pActor->spr.__int_angle;
}
else
{
@ -320,7 +320,7 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int val
int var_14 = GetMyAngle(nSqrt, edx);
int nAngDelta = AngleDelta(pActor->spr.ang, nMyAngle, 1024);
int nAngDelta = AngleDelta(pActor->spr.__int_angle, nMyAngle, 1024);
if (abs(nAngDelta) > 127)
{
@ -337,12 +337,12 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int val
nAngDelta = val2;
}
nAngle = (nAngDelta + pActor->spr.ang) & kAngleMask;
nAngle = (nAngDelta + pActor->spr.__int_angle) & kAngleMask;
pActor->spr.zvel = (AngleDelta(pActor->spr.zvel, var_14, 24) + pActor->spr.zvel) & kAngleMask;
}
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
int da = pActor->spr.zvel;
int x = abs(bcos(da));
@ -448,7 +448,7 @@ void BuildQueenEgg(int nQueen, int nVal)
int y = pActor->int_pos().Y;
auto pSector =pActor->sector();
int nFloorZ = pSector->int_floorz();
int nAngle = pActor->spr.ang;
int nAngle = pActor->spr.__int_angle;
auto pActor2 = insertActor(pSector, 121);
@ -459,15 +459,15 @@ void BuildQueenEgg(int nQueen, int nVal)
pActor2->spr.yoffset = 0;
pActor2->spr.shade = -12;
pActor2->spr.picnum = 1;
pActor2->spr.ang = (RandomSize(9) + (nAngle - 256)) & kAngleMask;
pActor2->spr.__int_angle = (RandomSize(9) + (nAngle - 256)) & kAngleMask;
pActor2->backuppos();
if (!nVal)
{
pActor2->spr.xrepeat = 30;
pActor2->spr.yrepeat = 30;
pActor2->spr.xvel = bcos(pActor2->spr.ang);
pActor2->spr.yvel = bsin(pActor2->spr.ang);
pActor2->spr.xvel = bcos(pActor2->spr.__int_angle);
pActor2->spr.yvel = bsin(pActor2->spr.__int_angle);
pActor2->spr.zvel = -6000;
pActor2->spr.cstat = 0;
}
@ -588,11 +588,11 @@ void AIQueenEgg::Tick(RunListEvent* ev)
nAngle = GetWallNormal(nMov.hitWall);
break;
case kHitSprite:
nAngle = nMov.actor()->spr.ang;
nAngle = nMov.actor()->spr.__int_angle;
break;
}
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
pActor->spr.xvel = bcos(nAngle, -1);
pActor->spr.yvel = bsin(nAngle, -1);
}
@ -624,10 +624,10 @@ void AIQueenEgg::Tick(RunListEvent* ev)
}
[[fallthrough]];
case kHitWall:
pActor->spr.ang += (RandomSize(9) + 768);
pActor->spr.ang &= kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.ang, -3);
pActor->spr.yvel = bsin(pActor->spr.ang, -3);
pActor->spr.__int_angle += (RandomSize(9) + 768);
pActor->spr.__int_angle &= kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -3);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -3);
pActor->spr.zvel = -RandomSize(5);
break;
}
@ -651,7 +651,7 @@ void AIQueenEgg::Tick(RunListEvent* ev)
pEgg->nCounter--;
if (pEgg->nCounter <= 0)
{
auto pWaspSprite = BuildWasp(nullptr, pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, pActor->sector(), pActor->spr.ang, true);
auto pWaspSprite = BuildWasp(nullptr, pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, pActor->sector(), pActor->spr.__int_angle, true);
pActor->set_int_z(pWaspSprite->int_pos().Z);
DestroyEgg(nEgg);
@ -704,7 +704,7 @@ void BuildQueenHead(int nQueen)
int x = pActor->int_pos().X;
int y = pActor->int_pos().Y;
int nAngle = pActor->spr.ang;
int nAngle = pActor->spr.__int_angle;
auto pSector = pActor->sector();
int z = pSector->int_floorz();
@ -720,7 +720,7 @@ void BuildQueenHead(int nQueen)
pActor2->spr.pal = 0;
pActor2->spr.xoffset = 0;
pActor2->spr.yoffset = 0;
pActor2->spr.ang = nAngle;
pActor2->spr.__int_angle = nAngle;
nVelShift = 2;
SetHeadVel(pActor2);
@ -812,11 +812,11 @@ void AIQueenHead::Tick(RunListEvent* ev)
auto nMov = MoveCreature(pActor);
// original BUG - this line doesn't exist in original code?
int nNewAng = pActor->spr.ang;
int nNewAng = pActor->spr.__int_angle;
if (nMov.exbits == 0)
{
if (nMov.type == kHitSprite) nNewAng = nMov.actor()->spr.ang;
if (nMov.type == kHitSprite) nNewAng = nMov.actor()->spr.__int_angle;
else if (nMov.type == kHitWall) nNewAng = GetWallNormal(nMov.hitWall);
}
else if (nMov.exbits == kHitAux2)
@ -831,7 +831,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
}
// original BUG - var_18 isn't being set if the check above == 0x20000 ?
pActor->spr.ang = nNewAng;
pActor->spr.__int_angle = nNewAng;
nVelShift++;
if (nVelShift < 5)
@ -906,8 +906,8 @@ void AIQueenHead::Tick(RunListEvent* ev)
runlist_DamageEnemy(pTarget, pActor, 10);
D3PlayFX(StaticSound[kSoundQTail] | 0x2000, pActor);
pActor->spr.ang += RandomSize(9) + 768;
pActor->spr.ang &= kAngleMask;
pActor->spr.__int_angle += RandomSize(9) + 768;
pActor->spr.__int_angle &= kAngleMask;
pActor->spr.zvel = (-20) - RandomSize(6);
@ -923,7 +923,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
MoveQZ[nQHead] = pActor->int_pos().Z;
assert(pActor->sector());
MoveQS[nQHead] = pActor->sector();
MoveQA[nQHead] = pActor->spr.ang;
MoveQA[nQHead] = pActor->spr.__int_angle;
nHd = nQHead;
@ -946,7 +946,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
}
pTActor->set_int_pos({ MoveQX[nHd], MoveQY[nHd], MoveQZ[nHd] });
pTActor->spr.ang = MoveQA[nHd];
pTActor->spr.__int_angle = MoveQA[nHd];
}
}
@ -1114,7 +1114,7 @@ void BuildQueen(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
x = pActor->int_pos().X;
y = pActor->int_pos().Y;
z = pActor->sector()->int_floorz();
nAngle = pActor->spr.ang;
nAngle = pActor->spr.__int_angle;
}
pActor->set_int_pos({ x, y, z });
@ -1127,7 +1127,7 @@ void BuildQueen(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0;
pActor->spr.picnum = 1;
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
pActor->spr.zvel = 0;
@ -1158,8 +1158,8 @@ void BuildQueen(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
void SetQueenSpeed(DExhumedActor* pActor, int nSpeed)
{
pActor->spr.xvel = bcos(pActor->spr.ang, -(2 - nSpeed));
pActor->spr.yvel = bsin(pActor->spr.ang, -(2 - nSpeed));
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -(2 - nSpeed));
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -(2 - nSpeed));
}
void AIQueen::Tick(RunListEvent* ev)
@ -1303,8 +1303,8 @@ void AIQueen::Tick(RunListEvent* ev)
}
[[fallthrough]];
case 0x8000:
pActor->spr.ang += 256;
pActor->spr.ang &= kAngleMask;
pActor->spr.__int_angle += 256;
pActor->spr.__int_angle &= kAngleMask;
SetQueenSpeed(pActor, si);
break;
@ -1346,7 +1346,7 @@ void AIQueen::Tick(RunListEvent* ev)
if (!si)
{
BuildBullet(pActor, 12, -1, pActor->spr.ang, pTarget, 1);
BuildBullet(pActor, 12, -1, pActor->spr.__int_angle, pTarget, 1);
}
else
{

View file

@ -69,8 +69,8 @@ void InitRats()
void SetRatVel(DExhumedActor* pActor)
{
pActor->spr.xvel = bcos(pActor->spr.ang, -2);
pActor->spr.yvel = bsin(pActor->spr.ang, -2);
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -2);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -2);
}
void BuildRat(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, int nAngle)
@ -84,7 +84,7 @@ void BuildRat(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, i
x = pActor->int_pos().X;
y = pActor->int_pos().Y;
z = pActor->int_pos().Z;
nAngle = pActor->spr.ang;
nAngle = pActor->spr.__int_angle;
ChangeActorStat(pActor, 108);
}
@ -97,7 +97,7 @@ void BuildRat(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, i
pActor->spr.picnum = 1;
pActor->spr.pal = pActor->sector()->ceilingpal;
pActor->spr.clipdist = 30;
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
pActor->spr.xrepeat = 50;
pActor->spr.yrepeat = 50;
pActor->spr.xvel = 0;
@ -332,7 +332,7 @@ void AIRat::Tick(RunListEvent* ev)
return;
}
pActor->spr.ang = RandomSize(11);
pActor->spr.__int_angle = RandomSize(11);
SetRatVel(pActor);
return;
}

View file

@ -48,7 +48,7 @@ void BuildRex(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, i
x = pActor->int_pos().X;
y = pActor->int_pos().Y;
z = pActor->sector()->int_floorz();
nAngle = pActor->spr.ang;
nAngle = pActor->spr.__int_angle;
ChangeActorStat(pActor, 119);
}
@ -63,7 +63,7 @@ void BuildRex(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, i
pActor->spr.pal = pActor->sector()->ceilingpal;
pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0;
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
pActor->spr.zvel = 0;
@ -206,9 +206,9 @@ void AIRex::Tick(RunListEvent* ev)
{
if (pTarget == nullptr)
{
auto nAngle = pActor->spr.ang; // make backup of this variable
auto nAngle = pActor->spr.__int_angle; // make backup of this variable
pActor->pTarget = FindPlayer(pActor, 60);
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
}
else
{
@ -224,8 +224,8 @@ void AIRex::Tick(RunListEvent* ev)
pActor->nAction = 1;
pActor->nFrame = 0;
pActor->spr.xvel = bcos(pActor->spr.ang, -2);
pActor->spr.yvel = bsin(pActor->spr.ang, -2);
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -2);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -2);
D3PlayFX(StaticSound[kSound48], pActor);
@ -257,7 +257,7 @@ void AIRex::Tick(RunListEvent* ev)
{
if (((PlotCourseToSprite(pActor, pTarget) >> 8) >= 60) || pActor->nCount > 0)
{
int nAngle = pActor->spr.ang & 0xFFF8;
int nAngle = pActor->spr.__int_angle & 0xFFF8;
pActor->spr.xvel = bcos(nAngle, -2);
pActor->spr.yvel = bsin(nAngle, -2);
}
@ -289,9 +289,9 @@ void AIRex::Tick(RunListEvent* ev)
}
case kHitWall:
{
pActor->spr.ang = (pActor->spr.ang + 256) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.ang, -2);
pActor->spr.yvel = bsin(pActor->spr.ang, -2);
pActor->spr.__int_angle = (pActor->spr.__int_angle + 256) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -2);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -2);
pActor->nAction = 1;
pActor->nFrame = 0;
nAction = 1;
@ -309,8 +309,8 @@ void AIRex::Tick(RunListEvent* ev)
{
PlotCourseToSprite(pActor, pTarget);
pActor->spr.xvel = bcos(pActor->spr.ang, -1);
pActor->spr.yvel = bsin(pActor->spr.ang, -1);
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -1);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -1);
auto nMov = MoveCreatureWithCaution(pActor);
@ -321,9 +321,9 @@ void AIRex::Tick(RunListEvent* ev)
SetQuake(pActor, 25);
pActor->nCount = 60;
pActor->spr.ang = (pActor->spr.ang + 256) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.ang, -2);
pActor->spr.yvel = bsin(pActor->spr.ang, -2);
pActor->spr.__int_angle = (pActor->spr.__int_angle + 256) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -2);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -2);
pActor->nAction = 1;
pActor->nFrame = 0;
nAction = 1;
@ -338,7 +338,7 @@ void AIRex::Tick(RunListEvent* ev)
if (pHitActor->spr.statnum && pHitActor->spr.statnum < 107)
{
int nAngle = pActor->spr.ang;
int nAngle = pActor->spr.__int_angle;
runlist_DamageEnemy(nMov.actor(), pActor, 15);

View file

@ -47,7 +47,7 @@ void BuildRoach(int nType, DExhumedActor* pActor, int x, int y, int z, sectortyp
x = pActor->int_pos().X;
y = pActor->int_pos().Y;
z = pActor->sector()->int_floorz();
angle = pActor->spr.ang;
angle = pActor->spr.__int_angle;
}
pActor->set_int_pos({ x, y, z });
@ -58,7 +58,7 @@ void BuildRoach(int nType, DExhumedActor* pActor, int x, int y, int z, sectortyp
pActor->spr.picnum = 1;
pActor->spr.pal = pActor->sector()->ceilingpal;
pActor->spr.clipdist = 60;
pActor->spr.ang = angle;
pActor->spr.__int_angle = angle;
pActor->spr.xrepeat = 40;
pActor->spr.yrepeat = 40;
pActor->spr.xvel = 0;
@ -93,8 +93,8 @@ void BuildRoach(int nType, DExhumedActor* pActor, int x, int y, int z, sectortyp
void GoRoach(DExhumedActor* pActor)
{
pActor->spr.xvel = bcos(pActor->spr.ang, -1) - bcos(pActor->spr.ang, -3);
pActor->spr.yvel = bsin(pActor->spr.ang, -1) - bsin(pActor->spr.ang, -3);
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -1) - bcos(pActor->spr.__int_angle, -3);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -1) - bsin(pActor->spr.__int_angle, -3);
}
void AIRoach::Draw(RunListEvent* ev)
@ -275,19 +275,19 @@ void AIRoach::Tick(RunListEvent* ev)
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
pActor->spr.ang = GetMyAngle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
pActor->spr.__int_angle = GetMyAngle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
pActor->nFrame = 0;
}
else
{
pActor->spr.ang = (pActor->spr.ang + 256) & kAngleMask;
pActor->spr.__int_angle = (pActor->spr.__int_angle + 256) & kAngleMask;
GoRoach(pActor);
}
}
else if (nMov.type == kHitWall)
{
pActor->spr.ang = (pActor->spr.ang + 256) & kAngleMask;
pActor->spr.__int_angle = (pActor->spr.__int_angle + 256) & kAngleMask;
GoRoach(pActor);
}
else
@ -304,7 +304,7 @@ void AIRoach::Tick(RunListEvent* ev)
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
pActor->spr.ang = GetMyAngle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
pActor->spr.__int_angle = GetMyAngle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
pActor->nFrame = 0;
}
@ -340,7 +340,7 @@ void AIRoach::Tick(RunListEvent* ev)
{
if (nFlag & 0x80)
{
BuildBullet(pActor, 13, -1, pActor->spr.ang, pTarget, 1);
BuildBullet(pActor, 13, -1, pActor->spr.__int_angle, pTarget, 1);
}
}

View file

@ -51,7 +51,7 @@ void BuildScorp(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
x = pActor->int_pos().X;
y = pActor->int_pos().Y;
z = pActor->sector()->int_floorz();
nAngle = pActor->spr.ang;
nAngle = pActor->spr.__int_angle;
}
pActor->set_int_pos({ x, y, z });
@ -64,7 +64,7 @@ void BuildScorp(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
pActor->spr.pal = pActor->sector()->ceilingpal;
pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0;
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
pActor->spr.zvel = 0;
@ -220,8 +220,8 @@ void AIScorp::Tick(RunListEvent* ev)
D3PlayFX(StaticSound[kSound41], pActor);
pActor->nFrame = 0;
pActor->spr.xvel = bcos(pActor->spr.ang);
pActor->spr.yvel = bsin(pActor->spr.ang);
pActor->spr.xvel = bcos(pActor->spr.__int_angle);
pActor->spr.yvel = bsin(pActor->spr.__int_angle);
pActor->nAction = 1;
pActor->pTarget = pTarget;
@ -249,7 +249,7 @@ void AIScorp::Tick(RunListEvent* ev)
if (pTarget == nMov.actor())
{
int nAngle = getangle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
if (AngleDiff(pActor->spr.ang, nAngle) < 64)
if (AngleDiff(pActor->spr.__int_angle, nAngle) < 64)
{
pActor->nAction = 2;
pActor->nFrame = 0;
@ -305,8 +305,8 @@ void AIScorp::Tick(RunListEvent* ev)
{
pActor->nAction = 1;
pActor->spr.xvel = bcos(pActor->spr.ang);
pActor->spr.yvel = bsin(pActor->spr.ang);
pActor->spr.xvel = bcos(pActor->spr.__int_angle);
pActor->spr.yvel = bsin(pActor->spr.__int_angle);
pActor->nFrame = 0;
return;
@ -317,7 +317,7 @@ void AIScorp::Tick(RunListEvent* ev)
return;
}
auto nBulletSprite = BuildBullet(pActor, 16, -1, pActor->spr.ang, pTarget, 1);
auto nBulletSprite = BuildBullet(pActor, 16, -1, pActor->spr.__int_angle, pTarget, 1);
if (nBulletSprite)
{
PlotCourseToSprite(nBulletSprite, pTarget);
@ -367,15 +367,15 @@ void AIScorp::Tick(RunListEvent* ev)
return;
}
auto pSpiderActor = BuildSpider(nullptr, pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, pActor->sector(), pActor->spr.ang);
auto pSpiderActor = BuildSpider(nullptr, pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, pActor->sector(), pActor->spr.__int_angle);
if (pSpiderActor)
{
pSpiderActor->spr.ang = RandomSize(11);
pSpiderActor->spr.__int_angle = RandomSize(11);
int nVel = RandomSize(5) + 1;
pSpiderActor->spr.xvel = bcos(pSpiderActor->spr.ang, -8) * nVel;
pSpiderActor->spr.yvel = bsin(pSpiderActor->spr.ang, -8) * nVel;
pSpiderActor->spr.xvel = bcos(pSpiderActor->spr.__int_angle, -8) * nVel;
pSpiderActor->spr.yvel = bsin(pSpiderActor->spr.__int_angle, -8) * nVel;
pSpiderActor->spr.zvel = (-(RandomSize(5) + 3)) << 8;
}
@ -410,11 +410,11 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode)
if (mode == 0)
{
PlotCourseToSprite(pActor, pTarget);
pActor->spr.ang += RandomSize(7) - 63;
pActor->spr.ang &= kAngleMask;
pActor->spr.__int_angle += RandomSize(7) - 63;
pActor->spr.__int_angle &= kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.ang);
pActor->spr.yvel = bsin(pActor->spr.ang);
pActor->spr.xvel = bcos(pActor->spr.__int_angle);
pActor->spr.yvel = bsin(pActor->spr.__int_angle);
}
if (mode <= 1)
{
@ -431,7 +431,7 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode)
{
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
pActor->spr.ang = GetMyAngle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
pActor->spr.__int_angle = GetMyAngle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
pActor->nIndex = RandomSize(2) + RandomSize(3);

View file

@ -481,7 +481,7 @@ int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal)
tspritetype* pTSprite = mytspriteArray->get(nSprite);
int nAngle = GetMyAngle(nCamerax - pTSprite->int_pos().X, nCameray - pTSprite->int_pos().Y);
int nSeqOffset = ((((pTSprite->ang + 512) - nAngle) + 128) & kAngleMask) >> 8;
int nSeqOffset = ((((pTSprite->__int_angle + 512) - nAngle) + 128) & kAngleMask) >> 8;
int16_t nFrame = SeqBase[nSeqOffset + nSeq] + nVal;
@ -538,7 +538,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx)
}
else
{
val = (((pTSprite->ang - nAngle) + 128) & kAngleMask) >> 8;
val = (((pTSprite->__int_angle - nAngle) + 128) & kAngleMask) >> 8;
}
int eax = SeqBase[edx] + nFrame;
@ -587,7 +587,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx)
tsp->pal = pTSprite->pal;
tsp->xrepeat = pTSprite->xrepeat;
tsp->yrepeat = pTSprite->yrepeat;
tsp->ang = pTSprite->ang;
tsp->__int_angle = pTSprite->__int_angle;
tsp->ownerActor = pTSprite->ownerActor;
tsp->sectp = pTSprite->sectp;
tsp->cstat = pTSprite->cstat |= CSTAT_SPRITE_YCENTER;

View file

@ -51,7 +51,7 @@ void BuildSet(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, i
x = pActor->int_pos().X;
y = pActor->int_pos().Y;
z = pActor->sector()->int_floorz();
nAngle = pActor->spr.ang;
nAngle = pActor->spr.__int_angle;
}
pActor->set_int_pos({ x, y, z });
@ -66,7 +66,7 @@ void BuildSet(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, i
pActor->spr.pal = pActor->sector()->ceilingpal;
pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0;
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
pActor->spr.picnum = 1;
pActor->spr.hitag = 0;
pActor->spr.lotag = runlist_HeadRun() + 1;
@ -106,7 +106,7 @@ void BuildSoul(DExhumedActor* pSet)
pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0;
pActor->spr.picnum = seq_GetSeqPicnum(kSeqSet, 75, 0);
pActor->spr.ang = RandomSize(11);
pActor->spr.__int_angle = RandomSize(11);
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
pActor->spr.zvel = (-256) - RandomSize(10);
@ -141,7 +141,7 @@ void AISoul::Tick(RunListEvent* ev)
int nVel = bcos(pActor->spr.extra, -7);
auto coll = movesprite(pActor, bcos(pActor->spr.ang) * nVel, bsin(pActor->spr.ang) * nVel, pActor->spr.zvel, 5120, 0, CLIPMASK0);
auto coll = movesprite(pActor, bcos(pActor->spr.__int_angle) * nVel, bsin(pActor->spr.__int_angle) * nVel, pActor->spr.zvel, 5120, 0, CLIPMASK0);
if (coll.exbits & 0x10000)
{
DExhumedActor* pSet = pActor->pTarget;
@ -297,8 +297,8 @@ void AISet::Tick(RunListEvent* ev)
pActor->nFrame = 0;
pActor->pTarget = pTarget;
pActor->spr.xvel = bcos(pActor->spr.ang, -1);
pActor->spr.yvel = bsin(pActor->spr.ang, -1);
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -1);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -1);
}
}
@ -390,7 +390,7 @@ void AISet::Tick(RunListEvent* ev)
}
// loc_338E2
int nAngle = pActor->spr.ang & 0xFFF8;
int nAngle = pActor->spr.__int_angle & 0xFFF8;
pActor->spr.xvel = bcos(nAngle, -1);
pActor->spr.yvel = bsin(nAngle, -1);
@ -420,9 +420,9 @@ void AISet::Tick(RunListEvent* ev)
}
}
pActor->spr.ang = (pActor->spr.ang + 256) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.ang, -1);
pActor->spr.yvel = bsin(pActor->spr.ang, -1);
pActor->spr.__int_angle = (pActor->spr.__int_angle + 256) & kAngleMask;
pActor->spr.xvel = bcos(pActor->spr.__int_angle, -1);
pActor->spr.yvel = bsin(pActor->spr.__int_angle, -1);
break;
}
else if (nMov.type == kHitSprite)
@ -430,7 +430,7 @@ void AISet::Tick(RunListEvent* ev)
if (pTarget == nMov.actor())
{
int nAng = getangle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
if (AngleDiff(pActor->spr.ang, nAng) < 64)
if (AngleDiff(pActor->spr.__int_angle, nAng) < 64)
{
pActor->nAction = 4;
pActor->nFrame = 0;
@ -494,7 +494,7 @@ void AISet::Tick(RunListEvent* ev)
{
if (nFlag & 0x80)
{
auto pBullet = BuildBullet(pActor, 11, -1, pActor->spr.ang, pTarget, 1);
auto pBullet = BuildBullet(pActor, 11, -1, pActor->spr.__int_angle, pTarget, 1);
if (pBullet)
SetBulletEnemy(pBullet->nPhase, pTarget);
@ -524,8 +524,8 @@ void AISet::Tick(RunListEvent* ev)
pActor->nAction = 8;
pActor->nFrame = 0;
pActor->spr.xvel = bcos(pActor->spr.ang);
pActor->spr.yvel = bsin(pActor->spr.ang);
pActor->spr.xvel = bcos(pActor->spr.__int_angle);
pActor->spr.yvel = bsin(pActor->spr.__int_angle);
}
return;
}

View file

@ -136,7 +136,7 @@ void BuildSnake(int nPlayer, int zVal)
int x = pPlayerActor->int_pos().X;
int y = pPlayerActor->int_pos().Y;
int z = (pPlayerActor->int_pos().Z + zVal) - 2560;
int nAngle = pPlayerActor->spr.ang;
int nAngle = pPlayerActor->spr.__int_angle;
HitInfo hit{};
hitscan({ x, y, z }, pPlayerActor->sector(), { bcos(nAngle), bsin(nAngle), 0 }, hit, CLIPMASK1);
@ -212,7 +212,7 @@ void BuildSnake(int nPlayer, int zVal)
pActor->spr.pal = 0;
pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0;
pActor->spr.ang = pPlayerActor->spr.ang;
pActor->spr.__int_angle = pPlayerActor->spr.__int_angle;
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
pActor->spr.zvel = 0;
@ -259,7 +259,7 @@ DExhumedActor* FindSnakeEnemy(int nSnake)
DExhumedActor* pActor = SnakeList[nSnake].pSprites[0]; // CHECKME
if (!pActor) return nullptr;
int nAngle = pActor->spr.ang;
int nAngle = pActor->spr.__int_angle;
auto pSector =pActor->sector();
int esi = 2048;
@ -320,8 +320,8 @@ void AISnake::Tick(RunListEvent* ev)
{
SEARCH_ENEMY:
nMov = movesprite(pActor,
600 * bcos(pActor->spr.ang),
600 * bsin(pActor->spr.ang),
600 * bcos(pActor->spr.__int_angle),
600 * bsin(pActor->spr.__int_angle),
bsin(SnakeList[nSnake].nAngle, -5),
0, 0, CLIPMASK1);
@ -356,7 +356,7 @@ void AISnake::Tick(RunListEvent* ev)
}
else
{
int nAngle = pActor->spr.ang;
int nAngle = pActor->spr.__int_angle;
int var_30 = -bcos(nAngle, 6);
int var_34 = -bsin(nAngle, 6);
@ -376,7 +376,7 @@ void AISnake::Tick(RunListEvent* ev)
DExhumedActor* pActor2 = SnakeList[nSnake].pSprites[i];
if (!pActor2) continue;
pActor2->spr.ang = nAngle;
pActor2->spr.__int_angle = nAngle;
pActor2->set_int_pos({ x, y, z });
ChangeActorSect(pActor2, pSector);

View file

@ -504,7 +504,7 @@ void GameInterface::UpdateSounds()
{
Snake *pSnake = &SnakeList[nSnakeCam];
pos = pSnake->pSprites[0]->int_pos();
ang = pSnake->pSprites[0]->spr.ang;
ang = pSnake->pSprites[0]->spr.__int_angle;
}
else
{

View file

@ -49,7 +49,7 @@ DExhumedActor* BuildSpider(DExhumedActor* spp, int x, int y, int z, sectortype*
x = spp->int_pos().X;
y = spp->int_pos().Y;
z = spp->sector()->int_floorz();
nAngle = spp->spr.ang;
nAngle = spp->spr.__int_angle;
}
spp->set_int_pos({ x, y, z });
@ -64,7 +64,7 @@ DExhumedActor* BuildSpider(DExhumedActor* spp, int x, int y, int z, sectortype*
spp->spr.pal = spp->sector()->ceilingpal;
spp->spr.xoffset = 0;
spp->spr.yoffset = 0;
spp->spr.ang = nAngle;
spp->spr.__int_angle = nAngle;
spp->spr.picnum = 1;
spp->spr.hitag = 0;
spp->spr.lotag = runlist_HeadRun() + 1;
@ -144,8 +144,8 @@ void AISpider::Tick(RunListEvent* ev)
spp->nFrame = 0;
spp->pTarget = pTarget;
spp->spr.xvel = bcos(spp->spr.ang);
spp->spr.yvel = bsin(spp->spr.ang);
spp->spr.xvel = bcos(spp->spr.__int_angle);
spp->spr.yvel = bsin(spp->spr.__int_angle);
return;
}
}
@ -195,8 +195,8 @@ void AISpider::Tick(RunListEvent* ev)
if (RandomSize(3))
{
spp->spr.xvel = bcos(spp->spr.ang);
spp->spr.yvel = bsin(spp->spr.ang);
spp->spr.xvel = bcos(spp->spr.__int_angle);
spp->spr.yvel = bsin(spp->spr.__int_angle);
}
else
{
@ -301,9 +301,9 @@ void AISpider::Tick(RunListEvent* ev)
{
case kHitWall:
{
spp->spr.ang = (spp->spr.ang + 256) & 0x7EF;
spp->spr.xvel = bcos(spp->spr.ang);
spp->spr.yvel = bsin(spp->spr.ang);
spp->spr.__int_angle = (spp->spr.__int_angle + 256) & 0x7EF;
spp->spr.xvel = bcos(spp->spr.__int_angle);
spp->spr.yvel = bsin(spp->spr.__int_angle);
return;
}
case kHitSprite:
@ -311,7 +311,7 @@ void AISpider::Tick(RunListEvent* ev)
if (nMov.actor() == pTarget)
{
int nAng = getangle(pTarget->int_pos().X - spp->int_pos().X, pTarget->int_pos().Y - spp->int_pos().Y);
if (AngleDiff(spp->spr.ang, nAng) < 64)
if (AngleDiff(spp->spr.__int_angle, nAng) < 64)
{
spp->nAction = 2;
spp->nFrame = 0;

View file

@ -74,7 +74,7 @@ static void analyzesprites(tspriteArray& tsprites, int x, int y, int z, double c
{
// interpolate sprite position
pTSprite->pos = pTSprite->ownerActor->interpolatedvec3(smoothratio);
pTSprite->ang = pTSprite->ownerActor->interpolatedang(smoothratio);
pTSprite->__int_angle = pTSprite->ownerActor->interpolatedang(smoothratio);
}
}
@ -88,7 +88,7 @@ static void analyzesprites(tspriteArray& tsprites, int x, int y, int z, double c
auto pSector =pPlayerActor->sector();
int nAngle = (2048 - pPlayerActor->spr.ang) & kAngleMask;
int nAngle = (2048 - pPlayerActor->spr.__int_angle) & kAngleMask;
for (int nTSprite = int(tsprites.Size()-1); nTSprite >= 0; nTSprite--)
{
@ -211,7 +211,7 @@ void DrawView(double smoothRatio, bool sceneonly)
playerY = pActor->int_pos().Y;
playerZ = pActor->int_pos().Z;
pSector = pActor->sector();
nAngle = buildang(pActor->spr.ang);
nAngle = buildang(pActor->spr.__int_angle);
rotscrnang = buildang(0);
SetGreenPal();
@ -374,7 +374,7 @@ void DrawView(double smoothRatio, bool sceneonly)
pPlayerActor->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
int ang2 = nCameraa.asbuild() - pPlayerActor->spr.ang;
int ang2 = nCameraa.asbuild() - pPlayerActor->spr.__int_angle;
if (ang2 < 0)
ang2 = -ang2;

View file

@ -36,8 +36,8 @@ static actionSeq WaspSeq[] = {
void SetWaspVel(DExhumedActor* pActor)
{
pActor->spr.xvel = bcos(pActor->spr.ang);
pActor->spr.yvel = bsin(pActor->spr.ang);
pActor->spr.xvel = bcos(pActor->spr.__int_angle);
pActor->spr.yvel = bsin(pActor->spr.__int_angle);
}
DExhumedActor* BuildWasp(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, int nAngle, bool bEggWasp)
@ -50,7 +50,7 @@ DExhumedActor* BuildWasp(DExhumedActor* pActor, int x, int y, int z, sectortype*
}
else
{
nAngle = pActor->spr.ang;
nAngle = pActor->spr.__int_angle;
ChangeActorStat(pActor, 107);
}
@ -73,7 +73,7 @@ DExhumedActor* BuildWasp(DExhumedActor* pActor, int x, int y, int z, sectortype*
pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0;
pActor->spr.picnum = 1;
pActor->spr.ang = nAngle;
pActor->spr.__int_angle = nAngle;
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
pActor->spr.zvel = 0;
@ -156,8 +156,8 @@ void AIWasp::Damage(RunListEvent* ev)
}
pActor->nAction = 1;
pActor->spr.ang += RandomSize(9) + 768;
pActor->spr.ang &= kAngleMask;
pActor->spr.__int_angle += RandomSize(9) + 768;
pActor->spr.__int_angle &= kAngleMask;
pActor->nVel = 3000;
@ -170,7 +170,7 @@ void AIWasp::Damage(RunListEvent* ev)
pActor->nFrame = 0;
pActor->spr.cstat = 0;
pActor->spr.ang = (pActor->spr.ang + 1024) & kAngleMask;
pActor->spr.__int_angle = (pActor->spr.__int_angle + 1024) & kAngleMask;
SetWaspVel(pActor);
@ -304,8 +304,8 @@ void AIWasp::Tick(RunListEvent* ev)
{
if (bVal)
{
pActor->spr.ang += RandomSize(9) + 768;
pActor->spr.ang &= kAngleMask;
pActor->spr.__int_angle += RandomSize(9) + 768;
pActor->spr.__int_angle &= kAngleMask;
pActor->spr.zvel = (-20) - RandomSize(6);
pActor->nAction = 1;

View file

@ -127,7 +127,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
actor->user.RotNum = 0;
actor->spr.xvel <<= 1;
actor->user.ActorActionFunc = nullptr;
actor->spr.ang = NORM_ANGLE(actor->spr.ang + 1024);
actor->spr.__int_angle = NORM_ANGLE(actor->spr.__int_angle + 1024);
break;
case NINJA_RUN_R0:
@ -158,7 +158,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
actor->spr.xvel = 200 + RandomRange(200);
actor->user.jump_speed = -200 - RandomRange(250);
DoActorBeginJump(actor);
actor->spr.ang = weapActor->spr.ang;
actor->spr.__int_angle = weapActor->spr.__int_angle;
}
}
else
@ -177,7 +177,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
actor->user.ActorActionFunc = nullptr;
//actor->user.ActorActionFunc = NullAnimator;
if (!sw_ninjahack)
actor->spr.ang = weapActor->spr.ang;
actor->spr.__int_angle = weapActor->spr.__int_angle;
break;
case COOLG_RUN_R0:
@ -211,7 +211,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
}
actor->user.ActorActionFunc = nullptr;
// Get angle to player
actor->spr.ang = NORM_ANGLE(getangle(actor->user.targetActor->int_pos().X - actor->int_pos().X, actor->user.targetActor->int_pos().Y - actor->int_pos().Y) + 1024);
actor->spr.__int_angle = NORM_ANGLE(getangle(actor->user.targetActor->int_pos().X - actor->int_pos().X, actor->user.targetActor->int_pos().Y - actor->int_pos().Y) + 1024);
break;
case UZI_SMOKE+1: // Shotgun
@ -234,7 +234,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
DoActorBeginJump(actor);
actor->user.ActorActionFunc = nullptr;
// Get angle to player
actor->spr.ang = NORM_ANGLE(getangle(actor->user.targetActor->int_pos().X - actor->int_pos().X, actor->user.targetActor->int_pos().Y - actor->int_pos().Y) + 1024);
actor->spr.__int_angle = NORM_ANGLE(getangle(actor->user.targetActor->int_pos().X - actor->int_pos().X, actor->user.targetActor->int_pos().Y - actor->int_pos().Y) + 1024);
break;
default:
@ -259,7 +259,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
actor->spr.xvel = 300 + RandomRange(400);
actor->user.jump_speed = -300 - RandomRange(350);
DoActorBeginJump(actor);
actor->spr.ang = weapActor->spr.ang;
actor->spr.__int_angle = weapActor->spr.__int_angle;
break;
}
break;
@ -413,16 +413,16 @@ int DoActorDebris(DSWActor* actor)
}
else
{
//nx = actor->spr.xvel * ACTORMOVETICS * bcos(actor->spr.ang) >> 14;
//ny = actor->spr.xvel * ACTORMOVETICS * bsin(actor->spr.ang) >> 14;
nx = MulScale(ACTORMOVETICS, bcos(actor->spr.ang), 14);
ny = MulScale(ACTORMOVETICS, bsin(actor->spr.ang), 14);
//nx = actor->spr.xvel * ACTORMOVETICS * bcos(actor->spr.__int_angle) >> 14;
//ny = actor->spr.xvel * ACTORMOVETICS * bsin(actor->spr.__int_angle) >> 14;
nx = MulScale(ACTORMOVETICS, bcos(actor->spr.__int_angle), 14);
ny = MulScale(ACTORMOVETICS, bsin(actor->spr.__int_angle), 14);
//actor->spr.clipdist = (256+128)>>2;
if (!move_debris(actor, nx, ny, 0L))
{
actor->spr.ang = RANDOM_P2(2048);
actor->spr.__int_angle = RANDOM_P2(2048);
}
}
@ -445,13 +445,13 @@ int DoFireFly(DSWActor* actor)
{
int nx, ny;
nx = 4 * ACTORMOVETICS * bcos(actor->spr.ang) >> 14;
ny = 4 * ACTORMOVETICS * bsin(actor->spr.ang) >> 14;
nx = 4 * ACTORMOVETICS * bcos(actor->spr.__int_angle) >> 14;
ny = 4 * ACTORMOVETICS * bsin(actor->spr.__int_angle) >> 14;
actor->spr.clipdist = 256>>2;
if (!move_actor(actor, nx, ny, 0L))
{
actor->spr.ang = NORM_ANGLE(actor->spr.ang + 1024);
actor->spr.__int_angle = NORM_ANGLE(actor->spr.__int_angle + 1024);
}
actor->user.WaitTics = (actor->user.WaitTics + (ACTORMOVETICS << 1)) & 2047;
@ -476,7 +476,7 @@ int DoGenerateSewerDebris(DSWActor* actor)
{
actor->user.Tics = actor->user.WaitTics;
auto spawned = SpawnActor(STAT_DEAD_ACTOR, 0, Debris[RANDOM_P2(4<<8)>>8], actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.ang, 200);
auto spawned = SpawnActor(STAT_DEAD_ACTOR, 0, Debris[RANDOM_P2(4<<8)>>8], actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.__int_angle, 200);
SetOwner(actor, spawned);
}
@ -737,8 +737,8 @@ int DoActorStopFall(DSWActor* actor)
// don't stand on face or wall sprites - jump again
if (actor->user.lowActor && !(actor->user.lowActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR))
{
//actor->spr.ang = NORM_ANGLE(actor->spr.ang + (RANDOM_P2(64<<8)>>8) - 32);
actor->spr.ang = NORM_ANGLE(actor->spr.ang + 1024 + (RANDOM_P2(512<<8)>>8));
//actor->spr.__int_angle = NORM_ANGLE(actor->spr.__int_angle + (RANDOM_P2(64<<8)>>8) - 32);
actor->spr.__int_angle = NORM_ANGLE(actor->spr.__int_angle + 1024 + (RANDOM_P2(512<<8)>>8));
actor->user.jump_speed = -350;
DoActorBeginJump(actor);
@ -782,8 +782,8 @@ int DoActorDeathMove(DSWActor* actor)
DoActorFall(actor);
}
nx = MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14);
ny = MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14);
nx = MulScale(actor->spr.xvel, bcos(actor->spr.__int_angle), 14);
ny = MulScale(actor->spr.xvel, bsin(actor->spr.__int_angle), 14);
actor->spr.clipdist = (128+64)>>2;
move_actor(actor, nx, ny, 0);

Some files were not shown because too many files have changed in this diff Show more