From 9a27dc202090308ff1bfb060e10e96d3b3907e15 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 27 Aug 2022 14:57:06 +0200 Subject: [PATCH] - handle all leftover __int_angles. Most were in comments but were changed anyway. --- source/games/blood/src/ai.cpp | 2 +- source/games/blood/src/nnexts.cpp | 8 ++++---- source/games/blood/src/triggers.cpp | 6 +++--- source/games/blood/src/view.cpp | 2 +- source/games/exhumed/src/init.cpp | 2 +- source/games/sw/src/actor.cpp | 6 +++--- source/games/sw/src/jweapon.cpp | 2 +- source/games/sw/src/player.cpp | 4 ---- source/games/sw/src/sector.cpp | 2 +- source/games/sw/src/sprite.cpp | 6 +++--- source/games/sw/src/weapon.cpp | 10 ++++------ 11 files changed, 22 insertions(+), 28 deletions(-) diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index 6af30dfa2..fcc15f943 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -273,7 +273,7 @@ void aiChooseDirection(DBloodActor* actor, int a3) else if (CanMove(actor, actor->GetTarget(), actor->int_ang() - v8, vsi)) actor->xspr.goalAng = actor->int_ang() - v8; //else if (actor->spr.flags&2) - //actor->xspr.goalAng = actor->spr.__int_angle+341; + //actor->xspr.goalAng = actor->spr.angle+341; else // Weird.. actor->xspr.goalAng = actor->int_ang() + 341; if (Chance(0x8000)) diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 2d2ca4899..61fc901c8 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -3281,11 +3281,11 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor) { if (pPlayer) { - pPlayer->angle.settarget(buildang(sourceactor->spr.__int_angle)); + pPlayer->angle.settarget(buildang(sourceactor->spr.angle)); pPlayer->angle.lockinput(); } - else if (isDude) sourceactor->xspr.goalAng = actor->spr.__int_angle = sourceactor->spr.__int_angle; - else actor->spr.__int_angle = sourceactor->spr.__int_angle; + else if (isDude) sourceactor->xspr.goalAng = actor->spr.angle = sourceactor->spr.angle; + else actor->spr.__int_angle = sourceactor->spr.angle; } #endif @@ -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.__int_angle) & 2047) - 1024; + int losAngle = ((1024 + nAngle - dudeactor->spr.angle) & 2047) - 1024; // is the target visible? if (abs(losAngle) < 2048) // 360 deg periphery here*/ diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 2c3066e3c..421cda3d7 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -2352,9 +2352,9 @@ void trInit(TArray& 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.__int_angle, marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.__int_angle, 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_ang(), marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.int_ang(), 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.__int_angle, marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.__int_angle, 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_ang(), marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.int_ang(), pSector->type == kSectorSlide); ZTranslateSector(pSector, pXSector, pXSector->busy, 1); break; } @@ -2362,7 +2362,7 @@ void trInit(TArray& 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.__int_angle, 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_ang(), 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->int_ang(), pSector->type == kSectorRotate); ZTranslateSector(pSector, pXSector, pXSector->busy, 1); diff --git a/source/games/blood/src/view.cpp b/source/games/blood/src/view.cpp index c927bb79a..fa6bc9080 100644 --- a/source/games/blood/src/view.cpp +++ b/source/games/blood/src/view.cpp @@ -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.__int_angle; + int v50 = pOther->actor->spr.angle; int v54 = 0; if (pOther->flickerEffect) { diff --git a/source/games/exhumed/src/init.cpp b/source/games/exhumed/src/init.cpp index e0c2bbacb..490ccd2c5 100644 --- a/source/games/exhumed/src/init.cpp +++ b/source/games/exhumed/src/init.cpp @@ -628,7 +628,7 @@ void ProcessSpriteTag(DExhumedActor* pActor, int nLotag, int nHitag) { auto pSector = pActor->sector(); pSector->Speed = nSpeed; - pSector->Flag |= pActor->spr.__int_angle; + pSector->Flag |= pActor->spr.int_ang(); DeleteActor(pActor); return; diff --git a/source/games/sw/src/actor.cpp b/source/games/sw/src/actor.cpp index 6478d1cad..ab9868808 100644 --- a/source/games/sw/src/actor.cpp +++ b/source/games/sw/src/actor.cpp @@ -413,8 +413,8 @@ int DoActorDebris(DSWActor* actor) } else { - //nx = actor->spr.xvel * ACTORMOVETICS * bcos(actor->spr.__int_angle) >> 14; - //ny = actor->spr.xvel * ACTORMOVETICS * bsin(actor->spr.__int_angle) >> 14; + //nx = actor->spr.xvel * ACTORMOVETICS * bcos(actor->spr.angle) >> 14; + //ny = actor->spr.xvel * ACTORMOVETICS * bsin(actor->spr.angle) >> 14; nx = MulScale(ACTORMOVETICS, bcos(actor->int_ang()), 14); ny = MulScale(ACTORMOVETICS, bsin(actor->int_ang()), 14); @@ -737,7 +737,7 @@ 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.__int_angle = NORM_ANGLE(actor->spr.__int_angle + (RANDOM_P2(64<<8)>>8) - 32); + //actor->spr.__int_angle = NORM_ANGLE(actor->spr.angle + (RANDOM_P2(64<<8)>>8) - 32); actor->set_int_ang(NORM_ANGLE(actor->int_ang() + 1024 + (RANDOM_P2(512<<8)>>8))); actor->user.jump_speed = -350; diff --git a/source/games/sw/src/jweapon.cpp b/source/games/sw/src/jweapon.cpp index efd346bf8..e8d69c996 100644 --- a/source/games/sw/src/jweapon.cpp +++ b/source/games/sw/src/jweapon.cpp @@ -1645,7 +1645,7 @@ int PlayerInitCaltrops(PLAYER* pp) actorNew->user.Flags |= (SPR_UNDERWATER); // They go out at different angles -// spawnedActor->spr.__int_angle = NORM_ANGLE(pp->angle.ang.asbuild() + (RandomRange(50) - 25)); +// spawnedActor->spr.angle = NORM_ANGLE(pp->angle.ang.asbuild() + (RandomRange(50) - 25)); actorNew->spr.zvel = -pp->horizon.horiz.asq16() >> 9; diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index da3362bf0..bbfb04896 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1790,10 +1790,6 @@ void UpdatePlayerSprite(PLAYER* pp) { actor->set_int_z(pp->pos.Z + Z(17)); - // move it forward a bit to look like its on the ladder - //actor->spr.x += MOVEx(256+64, actor->spr.__int_angle); - //actor->spr.y += MOVEy(256+64, actor->spr.__int_angle); - ChangeActorSect(pp->actor, pp->cursector); } else if (pp->DoPlayerAction == DoPlayerFly) diff --git a/source/games/sw/src/sector.cpp b/source/games/sw/src/sector.cpp index 3b25cbdbb..7152c31e8 100644 --- a/source/games/sw/src/sector.cpp +++ b/source/games/sw/src/sector.cpp @@ -861,7 +861,7 @@ void DoExplodeSector(short match) sectortype* sectp; - orig_ang = 0; //actor->spr.__int_angle; + orig_ang = 0; SWStatIterator it(STAT_EXPLODING_CEIL_FLOOR); while (auto actor = it.Next()) diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 7ef50ec8a..843cd1993 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -2855,7 +2855,7 @@ KeyMain: * * actor->user.State = actor->user.StateStart = &s_FireFly[0]; actor->user.RotNum = 0; * - * actor->spr.__int_angle = 0; actor->spr.xvel = 4; + * actor->spr.angle = 0; actor->spr.xvel = 4; * * if (labs(actor->spr.z - actor->sector()->int_floorz()) < Z(32)) actor->spr.z = * actor->sector()->int_floorz() - Z(32); @@ -4574,8 +4574,8 @@ bool DropAhead(DSWActor* actor, int min_height) { int dax, day; - // dax = actor->spr.x + MOVEx(128, actor->spr.__int_angle); - // day = actor->spr.y + MOVEy(128, actor->spr.__int_angle); + // dax = actor->spr.x + MOVEx(128, actor->spr.angle); + // day = actor->spr.y + MOVEy(128, actor->spr.angle); dax = actor->int_pos().X + MOVEx(256, actor->int_ang()); day = actor->int_pos().Y + MOVEy(256, actor->int_ang()); diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index eef8914e4..eddbdd480 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -3723,7 +3723,6 @@ AutoShrap: case EMP: shrap_bounce = false; actor->add_int_z(-Z(4)); - //actor->spr.__int_angle = NORM_ANGLE(actor->spr.__int_angle + 1024); shrap_xsize = actor->user.pos.X = 5 + (RANDOM_P2(4<<8)>>8); shrap_ysize = actor->user.pos.Y = 5 + (RANDOM_P2(4<<8)>>8); break; @@ -5351,7 +5350,6 @@ int PlayerCheckDeath(PLAYER* pp, DSWActor* weapActor) DoPlayerBeginDie(pp); // for death direction - //actor->user.slide_ang = weapActor->spr.__int_angle; actor->user.slide_ang = getangle(actor->int_pos().X - weapActor->int_pos().X, actor->int_pos().Y - weapActor->int_pos().Y); // for death velocity actor->user.slide_vel = actor->user.LastDamage * 5; @@ -6544,7 +6542,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) } else if (actor->user.PlayerP) { - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.__int_angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -6556,7 +6554,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) ActorHealth(actor, damage); ActorPain(actor); ActorStdMissile(actor, weapActor); - ActorDamageSlide(actor, damage, weapActor->spr.__int_angle); + ActorDamageSlide(actor, damage, weapActor->spr.angle); ActorChooseDeath(actor, weapActor); } @@ -8270,7 +8268,7 @@ int DoGrenade(DSWActor* actor) wall_ang = NORM_ANGLE(getangle(wph->delta())+512); - //actor->spr.__int_angle = NORM_ANGLE(actor->spr.__int_angle + 1); + //actor->spr.angle = NORM_ANGLE(actor->spr.angle + 1); WallBounce(actor, wall_ang); ScaleSpriteVector(actor, 22000); @@ -15507,7 +15505,7 @@ int InitTurretRocket(DSWActor* actor, PLAYER* pp) WeaponAutoAim(actor, actorNew, 64, false); // a bit of randomness - //actorNew->spr.__int_angle += RandomRange(30) - 15; + //actorNew->spr.angle += RandomRange(30) - 15; actorNew->user.change.X = MOVEx(actorNew->spr.xvel, actorNew->int_ang()); actorNew->user.change.Y = MOVEy(actorNew->spr.xvel, actorNew->int_ang());