From 43bd8acb31ad4e4fe3278399dacb7549dc0c11cc Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 31 Jan 2022 23:33:44 +0100 Subject: [PATCH] - Exhumed: renamed all spr.pos. --- source/games/exhumed/src/anims.cpp | 8 +-- source/games/exhumed/src/anubis.cpp | 14 ++-- source/games/exhumed/src/bubbles.cpp | 6 +- source/games/exhumed/src/bullet.cpp | 48 ++++++------- source/games/exhumed/src/exhumed.cpp | 4 +- source/games/exhumed/src/fish.cpp | 32 ++++----- source/games/exhumed/src/grenade.cpp | 12 ++-- source/games/exhumed/src/gun.cpp | 14 ++-- source/games/exhumed/src/items.cpp | 12 ++-- source/games/exhumed/src/lavadude.cpp | 14 ++-- source/games/exhumed/src/lighting.cpp | 4 +- source/games/exhumed/src/lion.cpp | 14 ++-- source/games/exhumed/src/map.cpp | 4 +- source/games/exhumed/src/move.cpp | 98 +++++++++++++-------------- source/games/exhumed/src/mummy.cpp | 20 +++--- source/games/exhumed/src/object.cpp | 40 +++++------ source/games/exhumed/src/osdcmds.cpp | 2 +- source/games/exhumed/src/player.cpp | 76 ++++++++++----------- source/games/exhumed/src/queen.cpp | 54 +++++++-------- source/games/exhumed/src/ra.cpp | 4 +- source/games/exhumed/src/ramses.cpp | 2 +- source/games/exhumed/src/rat.cpp | 24 +++---- source/games/exhumed/src/rex.cpp | 4 +- source/games/exhumed/src/roach.cpp | 8 +-- source/games/exhumed/src/runlist.cpp | 18 ++--- source/games/exhumed/src/scorp.cpp | 14 ++-- source/games/exhumed/src/set.cpp | 14 ++-- source/games/exhumed/src/snake.cpp | 24 +++---- source/games/exhumed/src/sound.cpp | 16 ++--- source/games/exhumed/src/spider.cpp | 6 +- source/games/exhumed/src/switch.cpp | 2 +- source/games/exhumed/src/view.cpp | 12 ++-- source/games/exhumed/src/wasp.cpp | 2 +- 33 files changed, 313 insertions(+), 313 deletions(-) diff --git a/source/games/exhumed/src/anims.cpp b/source/games/exhumed/src/anims.cpp index b5fb1d345..fa81660e5 100644 --- a/source/games/exhumed/src/anims.cpp +++ b/source/games/exhumed/src/anims.cpp @@ -134,7 +134,7 @@ void AIAnim::Tick(RunListEvent* ev) if (pIgniter) { - pActor->set_int_pos(pIgniter->spr.pos); + pActor->set_int_pos(pIgniter->int_pos()); if (pIgniter->sector() != pActor->sector()) { @@ -234,12 +234,12 @@ void BuildExplosion(DExhumedActor* pActor) { edx = 75; } - else if (pActor->spr.pos.Z == pActor->sector()->floorz) + else if (pActor->int_pos().Z == pActor->sector()->floorz) { edx = 34; } - BuildAnim(nullptr, edx, 0, pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, pActor->sector(), pActor->spr.xrepeat, 4); + BuildAnim(nullptr, edx, 0, pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, pActor->sector(), pActor->spr.xrepeat, 4); } void BuildSplash(DExhumedActor* pActor, sectortype* pSector) @@ -272,7 +272,7 @@ void BuildSplash(DExhumedActor* pActor, sectortype* pSector) nFlag = 0; } - auto pSpawned = BuildAnim(nullptr, edx, 0, pActor->spr.pos.X, pActor->spr.pos.Y, pSector->floorz, pSector, nRepeat, nFlag); + auto pSpawned = BuildAnim(nullptr, edx, 0, pActor->int_pos().X, pActor->int_pos().Y, pSector->floorz, pSector, nRepeat, nFlag); if (!bIsLava) { diff --git a/source/games/exhumed/src/anubis.cpp b/source/games/exhumed/src/anubis.cpp index 7da2c197b..6e29d8ad4 100644 --- a/source/games/exhumed/src/anubis.cpp +++ b/source/games/exhumed/src/anubis.cpp @@ -53,8 +53,8 @@ void BuildAnubis(DExhumedActor* ap, int x, int y, int z, sectortype* pSector, in { ChangeActorStat(ap, 101); - x = ap->spr.pos.X; - y = ap->spr.pos.Y; + x = ap->int_pos().X; + y = ap->int_pos().Y; z = ap->sector()->floorz; nAngle = ap->spr.ang; } @@ -182,7 +182,7 @@ void AIAnubis::Tick(RunListEvent* ev) { if (move.actor() == pTarget) { - int nAng = getangle(pTarget->spr.pos.X - ap->spr.pos.X, pTarget->spr.pos.Y - ap->spr.pos.Y); + 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); if (nAngDiff < 64) @@ -215,12 +215,12 @@ void AIAnubis::Tick(RunListEvent* ev) if (pTarget != nullptr) // NOTE: nTarget can be -1. this check wasn't in original code. TODO: demo compatiblity? { - if (cansee(ap->spr.pos.X, ap->spr.pos.Y, ap->spr.pos.Z - GetActorHeight(ap), ap->sector(), - pTarget->spr.pos.X, pTarget->spr.pos.Y, pTarget->spr.pos.Z - GetActorHeight(pTarget), pTarget->sector())) + if (cansee(ap->int_pos().X, ap->int_pos().Y, ap->int_pos().Z - GetActorHeight(ap), ap->sector(), + pTarget->int_pos().X, pTarget->int_pos().Y, pTarget->int_pos().Z - GetActorHeight(pTarget), pTarget->sector())) { ap->spr.xvel = 0; ap->spr.yvel = 0; - ap->spr.ang = GetMyAngle(pTarget->spr.pos.X - ap->spr.pos.X, pTarget->spr.pos.Y - ap->spr.pos.Y); + ap->spr.ang = GetMyAngle(pTarget->int_pos().X - ap->int_pos().X, pTarget->int_pos().Y - ap->int_pos().Y); ap->nAction = 3; ap->nFrame = 0; @@ -397,7 +397,7 @@ void AIAnubis::Damage(RunListEvent* ev) { auto pDrumActor = insertActor(ap->sector(), kStatAnubisDrum); - pDrumActor->set_int_pos({ ap->spr.pos.X, ap->spr.pos.Y, pDrumActor->sector()->floorz }); + pDrumActor->set_int_pos({ ap->int_pos().X, ap->int_pos().Y, pDrumActor->sector()->floorz }); pDrumActor->spr.xrepeat = 40; pDrumActor->spr.yrepeat = 40; pDrumActor->spr.shade = -64; diff --git a/source/games/exhumed/src/bubbles.cpp b/source/games/exhumed/src/bubbles.cpp index b859e5248..3c336fe91 100644 --- a/source/games/exhumed/src/bubbles.cpp +++ b/source/games/exhumed/src/bubbles.cpp @@ -91,12 +91,12 @@ void AIBubble::Tick(RunListEvent* ev) auto pSector = pActor->sector(); - if (pActor->spr.pos.Z <= pSector->ceilingz) + if (pActor->int_pos().Z <= pSector->ceilingz) { auto pSectAbove = pSector->pAbove; if (pActor->spr.hitag > -1 && pSectAbove != nullptr) { - BuildAnim(nullptr, 70, 0, pActor->spr.pos.X, pActor->spr.pos.Y, pSectAbove->floorz, pSectAbove, 64, 0); + BuildAnim(nullptr, 70, 0, pActor->int_pos().X, pActor->int_pos().Y, pSectAbove->floorz, pSectAbove, 64, 0); } DestroyBubble(pActor); @@ -124,7 +124,7 @@ void DoBubbleMachines() { pActor->nCount = (RandomWord() % pActor->nFrame) + 30; - BuildBubble(pActor->spr.pos, pActor->sector()); + BuildBubble(pActor->int_pos(), pActor->sector()); } } } diff --git a/source/games/exhumed/src/bullet.cpp b/source/games/exhumed/src/bullet.cpp index 598a1b3b3..dd65641c5 100644 --- a/source/games/exhumed/src/bullet.cpp +++ b/source/games/exhumed/src/bullet.cpp @@ -165,7 +165,7 @@ void IgniteSprite(DExhumedActor* pActor) { pActor->spr.hitag += 2; - auto pAnimActor = BuildAnim(nullptr, 38, 0, pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, pActor->sector(), 40, 20); + auto pAnimActor = BuildAnim(nullptr, 38, 0, pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, pActor->sector(), 40, 20); if (pAnimActor) { @@ -310,9 +310,9 @@ int MoveBullet(int nBullet) DExhumedActor* pActor = BulletList[nBullet].pActor; - int x = pActor->spr.pos.X; - int y = pActor->spr.pos.Y; - int z = pActor->spr.pos.Z; // ebx + int x = pActor->int_pos().X; + int y = pActor->int_pos().Y; + int z = pActor->int_pos().Z; // ebx int nSectFlag = pActor->sector()->Flag; int x2, y2, z2; @@ -369,9 +369,9 @@ MOVEEND: if (coll.type || coll.exbits) { nVal = 1; - x2 = pActor->spr.pos.X; - y2 = pActor->spr.pos.Y; - z2 = pActor->spr.pos.Z; + x2 = pActor->int_pos().X; + y2 = pActor->int_pos().Y; + z2 = pActor->int_pos().Z; pHitSect = pActor->sector(); switch (coll.type) @@ -405,7 +405,7 @@ MOVEEND: if (nVal == 0 && nType != 15 && nType != 3) { - AddFlash(pActor->sector(), pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, 0); + AddFlash(pActor->sector(), pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, 0); if (pActor->spr.pal != 5) { pActor->spr.pal = 1; @@ -419,9 +419,9 @@ MOVEEND: if (BulletList[nBullet].pEnemy) { hitactor = BulletList[nBullet].pEnemy; - x2 = hitactor->spr.pos.X; - y2 = hitactor->spr.pos.Y; - z2 = hitactor->spr.pos.Z - (GetActorHeight(hitactor) >> 1); + x2 = hitactor->int_pos().X; + y2 = hitactor->int_pos().Y; + z2 = hitactor->int_pos().Z - (GetActorHeight(hitactor) >> 1); pHitSect = hitactor->sector(); } else @@ -530,7 +530,7 @@ HITSPRITE: nRadialBullet = -1; - AddFlash(pActor->sector(), pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, 128); + AddFlash(pActor->sector(), pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, 128); } } } @@ -570,7 +570,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n assert(pTarget->sector()); - BulletHitsSprite(&sBullet, pActor, pTarget, pTarget->spr.pos.X, pTarget->spr.pos.Y, pTarget->spr.pos.Z - (nHeight >> 1), pTarget->sector()); + BulletHitsSprite(&sBullet, pActor, pTarget, pTarget->int_pos().X, pTarget->int_pos().Y, pTarget->int_pos().Z - (nHeight >> 1), pTarget->sector()); DeleteActor(sBullet.pActor); return nullptr; } @@ -605,7 +605,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n nZOffset = -nHeight; } - pBulletActor->set_int_pos(pActor->spr.pos); + pBulletActor->set_int_pos(pActor->int_pos()); Bullet *pBullet = &BulletList[nBullet]; @@ -682,7 +682,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n pSector = pBulletActor->sector(); - while (pBulletActor->spr.pos.Z < pSector->ceilingz) + while (pBulletActor->int_pos().Z < pSector->ceilingz) { if (pSector->pAbove == nullptr) { @@ -717,14 +717,14 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n nHeight -= nHeight >> 1; } - int var_20 = pTarget->spr.pos.Z - nHeight; + int var_20 = pTarget->int_pos().Z - nHeight; int x, y; if (pActor != nullptr && pActor->spr.statnum != 100) { - x = pTarget->spr.pos.X; - y = pTarget->spr.pos.Y; + x = pTarget->int_pos().X; + y = pTarget->int_pos().Y; if (pTarget->spr.statnum != 100) { @@ -741,8 +741,8 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n } } - x -= pBulletActor->spr.pos.X; - y -= pBulletActor->spr.pos.Y; + x -= pBulletActor->int_pos().X; + y -= pBulletActor->int_pos().Y; nAngle = GetMyAngle(x, y); pActor->spr.ang = nAngle; @@ -750,14 +750,14 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n else { // loc_2ABA3: - x = pTarget->spr.pos.X - pBulletActor->spr.pos.X; - y = pTarget->spr.pos.Y - pBulletActor->spr.pos.Y; + x = pTarget->int_pos().X - pBulletActor->int_pos().X; + y = pTarget->int_pos().Y - pBulletActor->int_pos().Y; } int nSqrt = lsqrt(y*y + x*x); if ((unsigned int)nSqrt > 0) { - var_18 = ((var_20 - pBulletActor->spr.pos.Z) * pBulletInfo->field_4) / nSqrt; + var_18 = ((var_20 - pBulletActor->int_pos().Z) * pBulletInfo->field_4) / nSqrt; } else { @@ -801,7 +801,7 @@ void AIBullet::Tick(RunListEvent* ev) if (nFlag & 0x80) { - BuildAnim(nullptr, 45, 0, pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, pActor->sector(), pActor->spr.xrepeat, 0); + BuildAnim(nullptr, 45, 0, pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, pActor->sector(), pActor->spr.xrepeat, 0); } BulletList[nBullet].nFrame++; diff --git a/source/games/exhumed/src/exhumed.cpp b/source/games/exhumed/src/exhumed.cpp index 5676dc8cc..d104574d2 100644 --- a/source/games/exhumed/src/exhumed.cpp +++ b/source/games/exhumed/src/exhumed.cpp @@ -208,8 +208,8 @@ void DoRedAlert(int nVal) { if (nVal) { - PlayFXAtXYZ(StaticSound[kSoundAlarm], ac->spr.pos.X, ac->spr.pos.Y, ac->spr.pos.Z); - AddFlash(ac->sector(), ac->spr.pos.X, ac->spr.pos.Y, ac->spr.pos.Z, 192); + PlayFXAtXYZ(StaticSound[kSoundAlarm], ac->int_pos().X, ac->int_pos().Y, ac->int_pos().Z); + AddFlash(ac->sector(), ac->int_pos().X, ac->int_pos().Y, ac->int_pos().Z, 192); } } } diff --git a/source/games/exhumed/src/fish.cpp b/source/games/exhumed/src/fish.cpp index bd8e6454d..69160d8b5 100644 --- a/source/games/exhumed/src/fish.cpp +++ b/source/games/exhumed/src/fish.cpp @@ -47,7 +47,7 @@ void BuildFishLimb(DExhumedActor* pActor, int anim) pChunkActor->nCount = anim + 40; pChunkActor->nFrame = RandomSize(3) % SeqSize[SeqOffsets[kSeqFish] + anim + 40]; - pChunkActor->set_int_pos(pActor->spr.pos); + pChunkActor->set_int_pos(pActor->int_pos()); pChunkActor->spr.cstat = 0; pChunkActor->spr.shade = -12; pChunkActor->spr.pal = 0; @@ -94,17 +94,17 @@ void AIFishLimb::Tick(RunListEvent* ev) { pActor->nFrame = 0; if (RandomBit()) { - BuildBlood(pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, pActor->sector()); + BuildBlood(pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, pActor->sector()); } } int FloorZ = pActor->sector()->floorz; - if (FloorZ <= pActor->spr.pos.Z) + if (FloorZ <= pActor->int_pos().Z) { pActor->add_int_z(256); - if ((pActor->spr.pos.Z - FloorZ) > 25600) + if ((pActor->int_pos().Z - FloorZ) > 25600) { pActor->spr.zvel = 0; runlist_DoSubRunRec(pActor->spr.intowner); @@ -112,7 +112,7 @@ void AIFishLimb::Tick(RunListEvent* ev) runlist_SubRunRec(pActor->spr.hitag); DeleteActor(pActor); } - else if ((pActor->spr.pos.Z - FloorZ) > 0) + else if ((pActor->int_pos().Z - FloorZ) > 0) { pActor->spr.zvel = 1024; } @@ -146,9 +146,9 @@ void BuildFish(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, } else { - x = pActor->spr.pos.X; - y = pActor->spr.pos.Y; - z = pActor->spr.pos.Z; + x = pActor->int_pos().X; + y = pActor->int_pos().Y; + z = pActor->int_pos().Z; nAngle = pActor->spr.ang; ChangeActorStat(pActor, 103); } @@ -275,7 +275,7 @@ void AIFish::Damage(RunListEvent* ev) BuildFishLimb(pActor, i); } - PlayFXAtXYZ(StaticSound[kSound40], pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z); + PlayFXAtXYZ(StaticSound[kSound40], pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z); DestroyFish(pActor); } else @@ -342,7 +342,7 @@ void AIFish::Tick(RunListEvent* ev) pActor->nAction = 2; pActor->nFrame = 0; - int nAngle = GetMyAngle(pTargetActor->spr.pos.X - pActor->spr.pos.X, pTargetActor->spr.pos.Z - pActor->spr.pos.Z); + int nAngle = GetMyAngle(pTargetActor->int_pos().X - pActor->int_pos().X, pTargetActor->int_pos().Z - pActor->int_pos().Z); pActor->spr.zvel = bsin(nAngle, -5); pActor->nCount = RandomSize(6) + 90; @@ -373,7 +373,7 @@ void AIFish::Tick(RunListEvent* ev) PlotCourseToSprite(pActor, pTargetActor); int nHeight = GetActorHeight(pActor) >> 1; - int z = abs(pTargetActor->spr.pos.Z - pActor->spr.pos.Z); + int z = abs(pTargetActor->int_pos().Z - pActor->int_pos().Z); if (z <= nHeight) { @@ -386,7 +386,7 @@ void AIFish::Tick(RunListEvent* ev) pActor->spr.yvel = 0; } - pActor->spr.zvel = (pTargetActor->spr.pos.Z - pActor->spr.pos.Z) >> 3; + pActor->spr.zvel = (pTargetActor->int_pos().Z - pActor->int_pos().Z) >> 3; } break; } @@ -415,9 +415,9 @@ void AIFish::Tick(RunListEvent* ev) } } - int x = pActor->spr.pos.X; - int y = pActor->spr.pos.Y; - int z = pActor->spr.pos.Z; + int x = pActor->int_pos().X; + int y = pActor->int_pos().Y; + int z = pActor->int_pos().Z; auto pSector =pActor->sector(); // loc_2EF54 @@ -460,7 +460,7 @@ void AIFish::Tick(RunListEvent* ev) if (pHitAct->spr.statnum == 100) { pActor->pTarget = coll.actor(); - pActor->spr.ang = GetMyAngle(pHitAct->spr.pos.X - pActor->spr.pos.X, pHitAct->spr.pos.Y - pActor->spr.pos.Y); + pActor->spr.ang = GetMyAngle(pHitAct->int_pos().X - pActor->int_pos().X, pHitAct->int_pos().Y - pActor->int_pos().Y); if (nAction != 3) { diff --git a/source/games/exhumed/src/grenade.cpp b/source/games/exhumed/src/grenade.cpp index 382c684e4..c10e2cc76 100644 --- a/source/games/exhumed/src/grenade.cpp +++ b/source/games/exhumed/src/grenade.cpp @@ -59,7 +59,7 @@ void ThrowGrenade(int nPlayer, int, int, int ecx, int push1) ChangeActorSect(pActor, PlayerList[nPlayer].pPlayerViewSect); - pActor->set_int_pos(pPlayerActor->spr.pos); + pActor->set_int_pos(pPlayerActor->int_pos()); if (nAngle < 0) { nAngle = pPlayerActor->spr.ang; @@ -102,7 +102,7 @@ void BuildGrenade(int nPlayer) auto pPlayerActor = PlayerList[nPlayer].pActor; - pActor->set_int_pos({ pPlayerActor->spr.pos.X, pPlayerActor->spr.pos.Y, pPlayerActor->spr.pos.Z - 3840 }); + pActor->set_int_pos({ pPlayerActor->int_pos().X, pPlayerActor->int_pos().Y, pPlayerActor->int_pos().Z - 3840 }); pActor->spr.shade = -64; pActor->spr.xrepeat = 20; pActor->spr.yrepeat = 20; @@ -152,7 +152,7 @@ void ExplodeGrenade(DExhumedActor* pActor) } else { - if (pActor->spr.pos.Z < pGrenadeSect->floorz) + if (pActor->int_pos().Z < pGrenadeSect->floorz) { var_20 = 200; var_28 = 36; @@ -173,7 +173,7 @@ void ExplodeGrenade(DExhumedActor* pActor) auto pPlayerActor = PlayerList[nPlayer].pActor; int nAngle = pPlayerActor->spr.ang; - pActor->set_int_pos({ bcos(nAngle, -5) + pPlayerActor->spr.pos.X, bsin(nAngle, -5) + pPlayerActor->spr.pos.Y, pPlayerActor->spr.pos.Z }); + pActor->set_int_pos({ bcos(nAngle, -5) + pPlayerActor->int_pos().X, bsin(nAngle, -5) + pPlayerActor->int_pos().Y, pPlayerActor->int_pos().Z }); ChangeActorSect(pActor, pPlayerActor->sector()); @@ -190,8 +190,8 @@ void ExplodeGrenade(DExhumedActor* pActor) runlist_RadialDamageEnemy(pActor, nDamage, BulletInfo[kWeaponGrenade].nRadius); - BuildAnim(nullptr, var_28, 0, pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, pActor->sector(), var_20, 4); - AddFlash(pActor->sector(), pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, 128); + BuildAnim(nullptr, var_28, 0, pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, pActor->sector(), var_20, 4); + AddFlash(pActor->sector(), pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, 128); DestroyGrenade(pActor); } diff --git a/source/games/exhumed/src/gun.cpp b/source/games/exhumed/src/gun.cpp index b4e8e69d3..f50602e22 100644 --- a/source/games/exhumed/src/gun.cpp +++ b/source/games/exhumed/src/gun.cpp @@ -614,9 +614,9 @@ loc_flag: BuildFlash(nPlayer, 512); AddFlash( pPlayerActor->sector(), - pPlayerActor->spr.pos.X, - pPlayerActor->spr.pos.Y, - pPlayerActor->spr.pos.Z, + pPlayerActor->int_pos().X, + pPlayerActor->int_pos().Y, + pPlayerActor->int_pos().Z, 0); } @@ -648,9 +648,9 @@ loc_flag: int nAmmoType = WeaponInfo[nWeapon].nAmmoType; int nAngle = pPlayerActor->spr.ang; - int theX = pPlayerActor->spr.pos.X; - int theY = pPlayerActor->spr.pos.Y; - int theZ = pPlayerActor->spr.pos.Z; + int theX = pPlayerActor->int_pos().X; + int theY = pPlayerActor->int_pos().Y; + int theZ = pPlayerActor->int_pos().Z; int ebp = bcos(nAngle) * (pPlayerActor->spr.clipdist << 3); int ebx = bsin(nAngle) * (pPlayerActor->spr.clipdist << 3); @@ -808,7 +808,7 @@ loc_flag: DExhumedActor* t = sPlayerInput[nPlayer].pTarget; // only autoaim if target is in front of the player. assert(t->sector()); - int angletotarget = bvectangbam(t->spr.pos.X - pPlayerActor->spr.pos.X, t->spr.pos.Y - pPlayerActor->spr.pos.Y).asbuild(); + 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; if (anglediff < 512 || anglediff > 1536) { diff --git a/source/games/exhumed/src/items.cpp b/source/games/exhumed/src/items.cpp index c643ed0b2..a9ae214c2 100644 --- a/source/games/exhumed/src/items.cpp +++ b/source/games/exhumed/src/items.cpp @@ -123,7 +123,7 @@ void BuildItemAnim(DExhumedActor* pActor) if (nItemAnimInfo[nItem].a >= 0) { - auto pAnimActor = BuildAnim(pActor, 41, nItemAnimInfo[nItem].a, pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, pActor->sector(), nItemAnimInfo[nItem].repeat, 20); + auto pAnimActor = BuildAnim(pActor, 41, nItemAnimInfo[nItem].a, pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, pActor->sector(), nItemAnimInfo[nItem].repeat, 20); if (nItem == 44) { pAnimActor->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT; @@ -338,16 +338,16 @@ void DropMagic(DExhumedActor* pActor) nullptr, 64, 0, - pActor->spr.pos.X, - pActor->spr.pos.Y, - pActor->spr.pos.Z, + pActor->int_pos().X, + pActor->int_pos().Y, + pActor->int_pos().Z, pActor->sector(), 48, 4); if (pAnimActor) { - AddFlash(pAnimActor->sector(), pAnimActor->spr.pos.X, pAnimActor->spr.pos.Y, pAnimActor->spr.pos.Z, 128); + AddFlash(pAnimActor->sector(), pAnimActor->int_pos().X, pAnimActor->int_pos().Y, pAnimActor->int_pos().Z, 128); ChangeActorStat(pAnimActor, 950); } nMagicCount = RandomSize(2); @@ -401,7 +401,7 @@ void DoRegenerates() if (pActor->spr.extra <= 0) { - BuildAnim(nullptr, 38, 0, pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, pActor->sector(), 64, 4); + BuildAnim(nullptr, 38, 0, pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, pActor->sector(), 64, 4); D3PlayFX(StaticSound[kSoundTorchOn], pActor); } else { diff --git a/source/games/exhumed/src/lavadude.cpp b/source/games/exhumed/src/lavadude.cpp index 5bbbaca27..743413d60 100644 --- a/source/games/exhumed/src/lavadude.cpp +++ b/source/games/exhumed/src/lavadude.cpp @@ -41,7 +41,7 @@ DExhumedActor* BuildLavaLimb(DExhumedActor* pActor, int move, int ebx) { auto pLimbActor = insertActor(pActor->sector(), 118); - pLimbActor->set_int_pos({ pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z - RandomLong() % ebx }); + pLimbActor->set_int_pos({ pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z - RandomLong() % ebx }); pLimbActor->spr.cstat = 0; pLimbActor->spr.shade = -127; pLimbActor->spr.pal = 1; @@ -107,8 +107,8 @@ void BuildLava(DExhumedActor* pActor, int x, int y, int, sectortype* pSector, in { pSector = pActor->sector(); nAngle = pActor->spr.ang; - x = pActor->spr.pos.X; - y = pActor->spr.pos.Y; + x = pActor->int_pos().X; + y = pActor->int_pos().Y; ChangeActorStat(pActor, 118); } @@ -278,9 +278,9 @@ void AILavaDude::Tick(RunListEvent* ev) } } - int x = pActor->spr.pos.X; - int y = pActor->spr.pos.Y; - int z = pActor->spr.pos.Z; + int x = pActor->int_pos().X; + int y = pActor->int_pos().Y; + int z = pActor->int_pos().Z; auto pSector =pActor->sector(); auto coll = movesprite(pActor, pActor->spr.xvel << 8, pActor->spr.yvel << 8, 0, 0, 0, CLIPMASK0); @@ -311,7 +311,7 @@ void AILavaDude::Tick(RunListEvent* ev) { if (coll.actor() == pTarget) { - int nAng = getangle(pTarget->spr.pos.X - pActor->spr.pos.X, pTarget->spr.pos.Y - pActor->spr.pos.Y); + 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) { pActor->nAction = 2; diff --git a/source/games/exhumed/src/lighting.cpp b/source/games/exhumed/src/lighting.cpp index 11e67aaab..ae9a154d4 100644 --- a/source/games/exhumed/src/lighting.cpp +++ b/source/games/exhumed/src/lighting.cpp @@ -353,12 +353,12 @@ void AddFlash(sectortype* pSector, int x, int y, int z, int val) if (!var_18) { - int xDiff = x - pActor->spr.pos.X; + int xDiff = x - pActor->int_pos().X; if (xDiff < 0) { xDiff = -xDiff; } - int yDiff = y - pActor->spr.pos.Y; + int yDiff = y - pActor->int_pos().Y; if (yDiff < 0) { yDiff = -yDiff; } diff --git a/source/games/exhumed/src/lion.cpp b/source/games/exhumed/src/lion.cpp index 6ba48176f..4be658f39 100644 --- a/source/games/exhumed/src/lion.cpp +++ b/source/games/exhumed/src/lion.cpp @@ -50,8 +50,8 @@ void BuildLion(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, else { ChangeActorStat(pActor, 104); - x = pActor->spr.pos.X; - y = pActor->spr.pos.Y; + x = pActor->int_pos().X; + y = pActor->int_pos().Y; z = pActor->sector()->floorz; nAngle = pActor->spr.ang; } @@ -311,7 +311,7 @@ void AILion::Tick(RunListEvent* ev) } else { - int nAng = getangle(pTarget->spr.pos.X - pActor->spr.pos.X, pTarget->spr.pos.Y - pActor->spr.pos.Y); + 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) { @@ -382,9 +382,9 @@ void AILion::Tick(RunListEvent* ev) pActor->spr.zvel = -4000; pActor->nCount = 0; - int x = pActor->spr.pos.X; - int y = pActor->spr.pos.Y; - int z = pActor->spr.pos.Z - (GetActorHeight(pActor) >> 1); + int x = pActor->int_pos().X; + int y = pActor->int_pos().Y; + int z = pActor->int_pos().Z - (GetActorHeight(pActor) >> 1); int nCheckDist = 0x7FFFFFFF; @@ -444,7 +444,7 @@ void AILion::Tick(RunListEvent* ev) { if (nMov.actor() == pTarget) { - int nAng = getangle(pTarget->spr.pos.X - pActor->spr.pos.X, pTarget->spr.pos.Y - pActor->spr.pos.Y); + 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) { pActor->nAction = 3; diff --git a/source/games/exhumed/src/map.cpp b/source/games/exhumed/src/map.cpp index eb46b67df..8acfaf14b 100644 --- a/source/games/exhumed/src/map.cpp +++ b/source/games/exhumed/src/map.cpp @@ -59,7 +59,7 @@ void DrawMap(double const smoothratio) void GetActorExtents(DExhumedActor* actor, int* top, int* bottom) { - *top = *bottom = actor->spr.pos.Z; + *top = *bottom = actor->int_pos().Z; if ((actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_FLOOR) { int height = tileHeight(actor->spr.picnum); @@ -89,7 +89,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int x, int y, int z, int a int nTile = pPlayerActor->spr.picnum; int ceilZ, floorZ; Collision ceilHit, floorHit; - getzrange(pPlayerActor->spr.pos, pPlayerActor->sector(), &ceilZ, ceilHit, &floorZ, floorHit, (pPlayerActor->spr.clipdist << 2) + 16, CLIPMASK0); + getzrange(pPlayerActor->int_pos(), pPlayerActor->sector(), &ceilZ, ceilHit, &floorZ, floorHit, (pPlayerActor->spr.clipdist << 2) + 16, CLIPMASK0); int nTop, nBottom; GetActorExtents(pPlayerActor, &nTop, &nBottom); int nScale = (pPlayerActor->spr.yrepeat + ((floorZ - nBottom) >> 8)) * z; diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index 110e60c1e..eec5e7c3f 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -240,13 +240,13 @@ void clipwall() int BelowNear(DExhumedActor* pActor, int x, int y, int walldist) { auto pSector = pActor->sector(); - int z = pActor->spr.pos.Z; + int z = pActor->int_pos().Z; int z2; if (loHit.type == kHitSprite) { - z2 = loHit.actor()->spr.pos.Z; + z2 = loHit.actor()->int_pos().Z; } else { @@ -292,7 +292,7 @@ int BelowNear(DExhumedActor* pActor, int x, int y, int walldist) } - if (z2 < pActor->spr.pos.Z) + if (z2 < pActor->int_pos().Z) { pActor->set_int_z(z2); overridesect = pSector; @@ -330,7 +330,7 @@ Collision movespritez(DExhumedActor* pActor, int z, int height, int, int clipdis z >>= 1; } - int spriteZ = pActor->spr.pos.Z; + int spriteZ = pActor->int_pos().Z; int floorZ = pSector->floorz; int ebp = spriteZ + z; @@ -371,7 +371,7 @@ Collision movespritez(DExhumedActor* pActor, int z, int height, int, int clipdis // This function will keep the player from falling off cliffs when you're too close to the edge. // This function finds the highest and lowest z coordinates that your clipping BOX can get to. - vec3_t pos = pActor->spr.pos; + vec3_t pos = pActor->int_pos(); pos.Z -= 256; getzrange(pos, pActor->sector(), &sprceiling, hiHit, &sprfloor, loHit, 128, CLIPMASK0); @@ -470,7 +470,7 @@ Collision movespritez(DExhumedActor* pActor, int z, int height, int, int clipdis if (pActor->spr.statnum == 100) { - nRet.exbits |= BelowNear(pActor, pActor->spr.pos.X, pActor->spr.pos.Y, clipdist + (clipdist / 2)); + nRet.exbits |= BelowNear(pActor, pActor->int_pos().X, pActor->int_pos().Y, clipdist + (clipdist / 2)); } return nRet; @@ -491,9 +491,9 @@ Collision movesprite(DExhumedActor* pActor, int dx, int dy, int dz, int ceildist { bTouchFloor = false; - int x = pActor->spr.pos.X; - int y = pActor->spr.pos.Y; - int z = pActor->spr.pos.Z; + int x = pActor->int_pos().X; + int y = pActor->int_pos().Y; + int z = pActor->int_pos().Z; int nSpriteHeight = GetActorHeight(pActor); @@ -521,7 +521,7 @@ Collision movesprite(DExhumedActor* pActor, int dx, int dy, int dz, int ceildist int varA = 0; int varB = 0; - CheckSectorFloor(overridesect, pActor->spr.pos.Z, &varB, &varA); + CheckSectorFloor(overridesect, pActor->int_pos().Z, &varB, &varA); if (varB || varA) { @@ -534,11 +534,11 @@ Collision movesprite(DExhumedActor* pActor, int dx, int dy, int dz, int ceildist } else { - CheckSectorFloor(overridesect, pActor->spr.pos.Z, &dx, &dy); + CheckSectorFloor(overridesect, pActor->int_pos().Z, &dx, &dy); } Collision coll; - auto pos = pActor->spr.pos; + auto pos = pActor->int_pos(); clipmove(pos, &pSector, dx, dy, nClipDist, nSpriteHeight, flordist, clipmask, coll); pActor->set_int_pos(pos); if (coll.type != kHitNone) // originally this or'ed the two values which can create unpredictable bad values in some edge cases. @@ -622,9 +622,9 @@ Collision MoveCreature(DExhumedActor* pActor) Collision MoveCreatureWithCaution(DExhumedActor* pActor) { - int x = pActor->spr.pos.X; - int y = pActor->spr.pos.Y; - int z = pActor->spr.pos.Z; + int x = pActor->int_pos().X; + int y = pActor->int_pos().Y; + int z = pActor->int_pos().Z; auto pSectorPre = pActor->sector(); auto ecx = MoveCreature(pActor); @@ -661,7 +661,7 @@ int GetAngleToSprite(DExhumedActor* a1, DExhumedActor* a2) if (!a1 || !a2) return -1; - return GetMyAngle(a2->spr.pos.X - a1->spr.pos.X, a2->spr.pos.Y - a1->spr.pos.Y); + return GetMyAngle(a2->int_pos().X - a1->int_pos().X, a2->int_pos().Y - a1->int_pos().Y); } int PlotCourseToSprite(DExhumedActor* pActor1, DExhumedActor* pActor2) @@ -669,8 +669,8 @@ int PlotCourseToSprite(DExhumedActor* pActor1, DExhumedActor* pActor2) if (pActor1 == nullptr || pActor2 == nullptr) return -1; - int x = pActor2->spr.pos.X - pActor1->spr.pos.X; - int y = pActor2->spr.pos.Y - pActor1->spr.pos.Y; + 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); @@ -695,11 +695,11 @@ DExhumedActor* FindPlayer(DExhumedActor* pActor, int nDistance, bool dontengage) if (nDistance < 0) nDistance = 100; - int x = pActor->spr.pos.X; - int y = pActor->spr.pos.Y; + int x = pActor->int_pos().X; + int y = pActor->int_pos().Y; auto pSector =pActor->sector(); - int z = pActor->spr.pos.Z - GetActorHeight(pActor); + int z = pActor->int_pos().Z - GetActorHeight(pActor); nDistance <<= 8; @@ -715,13 +715,13 @@ DExhumedActor* FindPlayer(DExhumedActor* pActor, int nDistance, bool dontengage) if ((pPlayerActor->spr.cstat & CSTAT_SPRITE_BLOCK_ALL) && (!(pPlayerActor->spr.cstat & CSTAT_SPRITE_INVISIBLE))) { - int v9 = abs(pPlayerActor->spr.pos.X - x); + int v9 = abs(pPlayerActor->int_pos().X - x); if (v9 < nDistance) { - int v10 = abs(pPlayerActor->spr.pos.Y - y); + int v10 = abs(pPlayerActor->int_pos().Y - y); - if (v10 < nDistance && cansee(pPlayerActor->spr.pos.X, pPlayerActor->spr.pos.Y, pPlayerActor->spr.pos.Z - 7680, pPlayerActor->sector(), x, y, z, pSector)) + if (v10 < nDistance && cansee(pPlayerActor->int_pos().X, pPlayerActor->int_pos().Y, pPlayerActor->int_pos().Z - 7680, pPlayerActor->sector(), x, y, z, pSector)) { break; } @@ -763,11 +763,11 @@ void CheckSectorFloor(sectortype* pSector, int z, int *x, int *y) int GetUpAngle(DExhumedActor* pActor1, int nVal, DExhumedActor* pActor2, int ecx) { - int x = pActor2->spr.pos.X - pActor1->spr.pos.X; - int y = pActor2->spr.pos.Y - pActor1->spr.pos.Y; + int x = pActor2->int_pos().X - pActor1->int_pos().X; + int y = pActor2->int_pos().Y - pActor1->int_pos().Y; - int ebx = (pActor2->spr.pos.Z + ecx) - (pActor1->spr.pos.Z + nVal); - int edx = (pActor2->spr.pos.Z + ecx) - (pActor1->spr.pos.Z + nVal); + int ebx = (pActor2->int_pos().Z + ecx) - (pActor1->int_pos().Z + nVal); + int edx = (pActor2->int_pos().Z + ecx) - (pActor1->int_pos().Z + nVal); ebx >>= 4; edx >>= 8; @@ -981,12 +981,12 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel) } else { - pos.Z = pActor->spr.pos.Z; + pos.Z = pActor->int_pos().Z; if ((nSectFlag & kSectUnderwater) || pos.Z != nZVal || pActor->spr.cstat & CSTAT_SPRITE_INVISIBLE) { - pos.X = pActor->spr.pos.X; - pos.Y = pActor->spr.pos.Y; + pos.X = pActor->int_pos().X; + pos.Y = pActor->int_pos().Y; pSectorB = pSector; clipmove(pos, &pSectorB, -xvect, -yvect, 4 * pActor->spr.clipdist, 0, 0, CLIPMASK0, scratch); @@ -1002,7 +1002,7 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel) { if (pActor->spr.statnum >= 99) { - pos = pActor->spr.pos; + pos = pActor->int_pos(); pSectorB = pNextSector; clipmove(pos, &pSectorB, @@ -1013,7 +1013,7 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel) if (pSectorB != pNextSector && (pSectorB == pSector || pNextSector == pSector)) { - if (pSectorB != pSector || nFloorZ >= pActor->spr.pos.Z) + if (pSectorB != pSector || nFloorZ >= pActor->int_pos().Z) { if (pSectorB) { ChangeActorSect(pActor, pSectorB); @@ -1048,10 +1048,10 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel) ExhumedSectIterator it(pSector); while (auto pActor = it.Next()) { - if (pActor->spr.statnum >= 99 && nZVal == pActor->spr.pos.Z && !(pActor->spr.cstat & CSTAT_SPRITE_INVISIBLE)) + if (pActor->spr.statnum >= 99 && nZVal == pActor->int_pos().Z && !(pActor->spr.cstat & CSTAT_SPRITE_INVISIBLE)) { pSectorB = pSector; - auto lpos = pActor->spr.pos; + auto lpos = pActor->int_pos(); clipmove(lpos, &pSectorB, xvect, yvect, 4 * pActor->spr.clipdist, 5120, -5120, CLIPMASK0, scratch); pActor->set_int_pos(lpos); @@ -1076,17 +1076,17 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel) TODO: Might need to be done elsewhere too? */ auto pActor = PlayerList[nLocalPlayer].pActor; - initx = pActor->spr.pos.X; - inity = pActor->spr.pos.Y; - initz = pActor->spr.pos.Z; + initx = pActor->int_pos().X; + inity = pActor->int_pos().Y; + initz = pActor->int_pos().Z; inita = pActor->spr.ang; initsectp = pActor->sector(); } void SetQuake(DExhumedActor* pActor, int nVal) { - int x = pActor->spr.pos.X; - int y = pActor->spr.pos.Y; + int x = pActor->int_pos().X; + int y = pActor->int_pos().Y; nVal *= 256; @@ -1095,8 +1095,8 @@ void SetQuake(DExhumedActor* pActor, int nVal) auto pPlayerActor = PlayerList[i].pActor; - uint32_t xDiff = abs((int32_t)((pPlayerActor->spr.pos.X - x) >> 8)); - uint32_t yDiff = abs((int32_t)((pPlayerActor->spr.pos.Y - y) >> 8)); + uint32_t xDiff = abs((int32_t)((pPlayerActor->int_pos().X - x) >> 8)); + uint32_t yDiff = abs((int32_t)((pPlayerActor->int_pos().Y - y) >> 8)); uint32_t sqrtNum = xDiff * xDiff + yDiff * yDiff; @@ -1155,10 +1155,10 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int ebx, int { int nHeight = tileHeight(pActor2->spr.picnum) * pActor2->spr.yrepeat * 2; - int nMyAngle = GetMyAngle(pActor2->spr.pos.X - pActor->spr.pos.X, pActor2->spr.pos.Y - pActor->spr.pos.Y); + int nMyAngle = GetMyAngle(pActor2->int_pos().X - pActor->int_pos().X, pActor2->int_pos().Y - pActor->int_pos().Y); - uint32_t xDiff = abs(pActor2->spr.pos.X - pActor->spr.pos.X); - uint32_t yDiff = abs(pActor2->spr.pos.Y - pActor->spr.pos.Y); + uint32_t xDiff = abs(pActor2->int_pos().X - pActor->int_pos().X); + uint32_t yDiff = abs(pActor2->int_pos().Y - pActor->int_pos().Y); uint32_t sqrtNum = xDiff * xDiff + yDiff * yDiff; @@ -1170,7 +1170,7 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int ebx, int int nSqrt = ksqrt(sqrtNum); - int var_18 = GetMyAngle(nSqrt, ((pActor2->spr.pos.Z - nHeight) - pActor->spr.pos.Z) >> 8); + int var_18 = GetMyAngle(nSqrt, ((pActor2->int_pos().Z - nHeight) - pActor->int_pos().Z) >> 8); int nAngDelta = AngleDelta(pActor->spr.ang, nMyAngle, 1024); int nAngDelta2 = abs(nAngDelta); @@ -1239,7 +1239,7 @@ void WheresMyMouth(int nPlayer, vec3_t* pos, sectortype **sectnum) int height = GetActorHeight(pActor) >> 1; *sectnum = pActor->sector(); - *pos = pActor->spr.pos; + *pos = pActor->int_pos(); pos->Z -= height; Collision scratch; @@ -1355,7 +1355,7 @@ DExhumedActor* BuildCreatureChunk(DExhumedActor* pSrc, int nPic, bool bSpecial) if (pActor == nullptr) { return nullptr; } - pActor->set_int_pos(pSrc->spr.pos); + pActor->set_int_pos(pSrc->int_pos()); ChangeActorSect(pActor, pSrc->sector()); @@ -1403,7 +1403,7 @@ void AICreatureChunk::Tick(RunListEvent* ev) auto nVal = movesprite(pActor, pActor->spr.xvel << 10, pActor->spr.yvel << 10, pActor->spr.zvel, 2560, -2560, CLIPMASK1); - if (pActor->spr.pos.Z >= pSector->floorz) + if (pActor->int_pos().Z >= pSector->floorz) { // re-grab this variable as it may have changed in movesprite(). Note the check above is against the value *before* movesprite so don't change it. pSector = pActor->sector(); diff --git a/source/games/exhumed/src/mummy.cpp b/source/games/exhumed/src/mummy.cpp index 8826ad26a..8602da50e 100644 --- a/source/games/exhumed/src/mummy.cpp +++ b/source/games/exhumed/src/mummy.cpp @@ -45,9 +45,9 @@ void BuildMummy(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, } else { - x = pActor->spr.pos.X; - y = pActor->spr.pos.Y; - z = pActor->spr.pos.Z; + x = pActor->int_pos().X; + y = pActor->int_pos().Y; + z = pActor->int_pos().Z; nAngle = pActor->spr.ang; ChangeActorStat(pActor, 102); @@ -97,13 +97,13 @@ void CheckMummyRevive(DExhumedActor* pActor) if (pOther->nAction != 5) { continue; } - int x = abs(pOther->spr.pos.X - pActor->spr.pos.X) >> 8; - int y = abs(pOther->spr.pos.Y - pActor->spr.pos.Y) >> 8; + int x = abs(pOther->int_pos().X - pActor->int_pos().X) >> 8; + int y = abs(pOther->int_pos().Y - pActor->int_pos().Y) >> 8; if (x <= 20 && y <= 20) { - if (cansee(pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z - 8192, pActor->sector(), - pOther->spr.pos.X, pOther->spr.pos.Y, pOther->spr.pos.Z - 8192, pOther->sector())) + if (cansee(pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z - 8192, pActor->sector(), + pOther->int_pos().X, pOther->int_pos().Y, pOther->int_pos().Z - 8192, pOther->sector())) { pOther->spr.cstat = 0; pOther->nAction = 6; @@ -206,8 +206,8 @@ void AIMummy::Tick(RunListEvent* ev) { if (RandomBit() && pTarget) { - if (cansee(pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z - GetActorHeight(pActor), pActor->sector(), - pTarget->spr.pos.X, pTarget->spr.pos.Y, pTarget->spr.pos.Z - GetActorHeight(pTarget), pTarget->sector())) + if (cansee(pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z - GetActorHeight(pActor), pActor->sector(), + pTarget->int_pos().X, pTarget->int_pos().Y, pTarget->int_pos().Z - GetActorHeight(pTarget), pTarget->sector())) { pActor->nAction = 3; pActor->nFrame = 0; @@ -274,7 +274,7 @@ void AIMummy::Tick(RunListEvent* ev) { if (nMov.actor() == pTarget) { - int nAngle = getangle(pTarget->spr.pos.X - pActor->spr.pos.X, pTarget->spr.pos.Y - pActor->spr.pos.Y); + 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) { pActor->nAction = 2; diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 40bdeeaaa..d5c622d49 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -441,8 +441,8 @@ DExhumedActor* FindWallSprites(sectortype* pSector) { if ((actor->spr.cstat & (CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_ONE_SIDE)) == (CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_ONE_SIDE)) { - int var_28 = actor->spr.pos.X; - int ebx = actor->spr.pos.Y; + int var_28 = actor->int_pos().X; + int ebx = actor->int_pos().Y; if ((var_28 >= var_24) && (esi >= var_28) && (ebx >= ecx) && (ebx <= edi)) { @@ -606,9 +606,9 @@ int CheckSectorSprites(sectortype* pSector, int nVal) if (pActor->spr.statnum == 100 && PlayerList[GetPlayerFromActor(pActor)].nHealth <= 0) { PlayFXAtXYZ(StaticSound[kSoundJonFDie], - pActor->spr.pos.X, - pActor->spr.pos.Y, - pActor->spr.pos.Z, + pActor->int_pos().X, + pActor->int_pos().Y, + pActor->int_pos().Z, CHANF_NONE, 0x4000); } } @@ -639,7 +639,7 @@ void MoveSectorSprites(sectortype* pSector, int z) ExhumedSectIterator it(pSector); while (auto pActor = it.Next()) { - int actz = pActor->spr.pos.Z; + int actz = pActor->int_pos().Z; if ((pActor->spr.statnum != 200 && actz >= minz && actz <= maxz) || pActor->spr.statnum >= 900) { pActor->set_int_z(newz); @@ -834,7 +834,7 @@ void AIElev::Tick(RunListEvent* ev) SetQuake(pElevSpr, 30); } - PlayFXAtXYZ(StaticSound[kSound26], pElevSpr->spr.pos.X, pElevSpr->spr.pos.Y, pElevSpr->spr.pos.Z); + PlayFXAtXYZ(StaticSound[kSound26], pElevSpr->int_pos().X, pElevSpr->int_pos().Y, pElevSpr->int_pos().Z); } if (var_18 & 0x4) @@ -1353,7 +1353,7 @@ DExhumedActor* BuildSpark(DExhumedActor* pActor, int nVal) { auto pSpark = insertActor(pActor->sector(), 0); - pSpark->set_int_xy(pActor->spr.pos.X, pActor->spr.pos.Y); + pSpark->set_int_xy(pActor->int_pos().X, pActor->int_pos().Y); pSpark->spr.cstat = 0; pSpark->spr.shade = -127; pSpark->spr.pal = 1; @@ -1397,7 +1397,7 @@ DExhumedActor* BuildSpark(DExhumedActor* pActor, int nVal) pSpark->spr.picnum = kTile985 + nVal; } - pSpark->set_int_z(pActor->spr.pos.Z); + pSpark->set_int_z(pActor->int_pos().Z); pSpark->spr.lotag = runlist_HeadRun() + 1; pSpark->spr.clipdist = 1; pSpark->spr.hitag = 0; @@ -1581,7 +1581,7 @@ DExhumedActor* BuildEnergyBlock(sectortype* pSector) pActor->set_int_z(pSector->firstWall()->nextSector()->floorz); // CHECKME - name of this variable? - int nRepeat = (pActor->spr.pos.Z - pSector->floorz) >> 8; + int nRepeat = (pActor->int_pos().Z - pSector->floorz) >> 8; if (nRepeat > 255) { nRepeat = 255; } @@ -1656,9 +1656,9 @@ void ExplodeEnergyBlock(DExhumedActor* pActor) pSector->floorshade = 50; pSector->extra = -1; - pSector->setfloorz(pActor->spr.pos.Z); + pSector->setfloorz(pActor->int_pos().Z); - pActor->set_int_z((pActor->spr.pos.Z + pSector->floorz) / 2); + pActor->set_int_z((pActor->int_pos().Z + pSector->floorz) / 2); BuildSpark(pActor, 3); @@ -1765,7 +1765,7 @@ void AIEnergyBlock::RadialDamage(RunListEvent* ev) int nFloorZ = pSector->floorz; - pSector->setfloorz(pActor->spr.pos.Z); + pSector->setfloorz(pActor->int_pos().Z); pActor->add_int_z(-256); ev->nDamage = runlist_CheckRadialDamage(pActor); @@ -1824,7 +1824,7 @@ DExhumedActor* BuildObject(DExhumedActor* pActor, int nOjectType, int nHitag) pActor->nIndex2 = -1; pActor2->spr.cstat = CSTAT_SPRITE_INVISIBLE; - pActor2->set_int_pos(pActor->spr.pos); + pActor2->set_int_pos(pActor->int_pos()); } else { @@ -1919,7 +1919,7 @@ void AIObject::Tick(RunListEvent* ev) int var_18; // red branch - if ((nStat == kStatExplodeTarget) || (pActor->spr.pos.Z < pActor->sector()->floorz)) + if ((nStat == kStatExplodeTarget) || (pActor->int_pos().Z < pActor->sector()->floorz)) { var_18 = 36; } @@ -1928,8 +1928,8 @@ void AIObject::Tick(RunListEvent* ev) var_18 = 34; } - AddFlash(pActor->sector(), pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, 128); - BuildAnim(nullptr, var_18, 0, pActor->spr.pos.X, pActor->spr.pos.Y, pActor->sector()->floorz, pActor->sector(), 240, 4); + AddFlash(pActor->sector(), pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, 128); + BuildAnim(nullptr, var_18, 0, pActor->int_pos().X, pActor->int_pos().Y, pActor->sector()->floorz, pActor->sector(), 240, 4); // int edi = nSprite | 0x4000; @@ -1961,7 +1961,7 @@ void AIObject::Tick(RunListEvent* ev) StartRegenerate(pActor); pActor->nHealth = 120; - pActor->set_int_pos(pActor->pTarget->spr.pos); + pActor->set_int_pos(pActor->pTarget->int_pos()); ChangeActorSect(pActor, pActor->pTarget->sector()); return; } @@ -2210,8 +2210,8 @@ void ProcessTrailSprite(DExhumedActor* pActor, int nLotag, int nHitag) { auto nPoint = sTrailPoint.Reserve(1); - sTrailPoint[nPoint].x = pActor->spr.pos.X; - sTrailPoint[nPoint].y = pActor->spr.pos.Y; + sTrailPoint[nPoint].x = pActor->int_pos().X; + sTrailPoint[nPoint].y = pActor->int_pos().Y; int nTrail = FindTrail(nHitag); diff --git a/source/games/exhumed/src/osdcmds.cpp b/source/games/exhumed/src/osdcmds.cpp index ddb467225..bb682989f 100644 --- a/source/games/exhumed/src/osdcmds.cpp +++ b/source/games/exhumed/src/osdcmds.cpp @@ -38,7 +38,7 @@ void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz) Player *nPlayer = &PlayerList[nLocalPlayer]; nPlayer->pActor->set_int_pos({ x, y, z }); - nPlayer->pActor->opos = nPlayer->pActor->spr.pos; + nPlayer->pActor->opos = nPlayer->pActor->int_pos(); if (ang != INT_MIN) { diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 645e8f34a..cff108f26 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -132,9 +132,9 @@ void feebtag(int x, int y, int z, sectortype* pSector, DExhumedActor **nSprite, if (nStat >= 900 && !(pActor->spr.cstat & CSTAT_SPRITE_INVISIBLE)) { - uint32_t xDiff = abs(pActor->spr.pos.X - x); - uint32_t yDiff = abs(pActor->spr.pos.Y - y); - int zDiff = pActor->spr.pos.Z - z; + uint32_t xDiff = abs(pActor->int_pos().X - x); + uint32_t yDiff = abs(pActor->int_pos().Y - y); + int zDiff = pActor->int_pos().Z - z; if (zDiff < 5120 && zDiff > -25600) { @@ -263,14 +263,14 @@ void RestartPlayer(int nPlayer) nCurStartSprite = 0; } - pActor->set_int_pos(nNStartSprite->spr.pos); + 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(); floorsprt = insertActor(pActor->sector(), 0); - floorsprt->set_int_pos(pActor->spr.pos); + floorsprt->set_int_pos(pActor->int_pos()); floorsprt->spr.yrepeat = 64; floorsprt->spr.xrepeat = 64; floorsprt->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR; @@ -311,7 +311,7 @@ void RestartPlayer(int nPlayer) pActor->spr.extra = -1; pActor->spr.lotag = runlist_HeadRun() + 1; - pDActor->set_int_pos(pActor->spr.pos); + pDActor->set_int_pos(pActor->int_pos()); pDActor->spr.xrepeat = pActor->spr.xrepeat; pDActor->spr.yrepeat = pActor->spr.yrepeat; pDActor->spr.xoffset = 0; @@ -454,7 +454,7 @@ void StartDeathSeq(int nPlayer, int nVal) auto pGunActor = GrabBodyGunSprite(); ChangeActorSect(pGunActor, pSector); - pGunActor->set_int_pos({ pActor->spr.pos.X, pActor->spr.pos.Y, pSector->floorz - 512 }); + pGunActor->set_int_pos({ pActor->int_pos().X, pActor->int_pos().Y, pSector->floorz - 512 }); ChangeActorStat(pGunActor, nGunLotag[nWeapon] + 900); @@ -773,9 +773,9 @@ void AIPlayer::Tick(RunListEvent* ev) { nFlashDepth = 5; AddFlash(pPlayerActor->sector(), - pPlayerActor->spr.pos.X, - pPlayerActor->spr.pos.Y, - pPlayerActor->spr.pos.Z, 0); + pPlayerActor->int_pos().X, + pPlayerActor->int_pos().Y, + pPlayerActor->int_pos().Z, 0); } } } @@ -847,8 +847,8 @@ void AIPlayer::Tick(RunListEvent* ev) auto pSector = pPlayerActor->sector(); int nSectFlag = PlayerList[nPlayer].pPlayerViewSect->Flag; - int playerX = pPlayerActor->spr.pos.X; - int playerY = pPlayerActor->spr.pos.Y; + int playerX = pPlayerActor->int_pos().X; + int playerY = pPlayerActor->int_pos().Y; int x = (sPlayerInput[nPlayer].xVel * 4) >> 2; int y = (sPlayerInput[nPlayer].yVel * 4) >> 2; @@ -863,9 +863,9 @@ void AIPlayer::Tick(RunListEvent* ev) y /= 2; } - int spr_x = pPlayerActor->spr.pos.X; - int spr_y = pPlayerActor->spr.pos.Y; - int spr_z = pPlayerActor->spr.pos.Z; + int spr_x = pPlayerActor->int_pos().X; + int spr_y = pPlayerActor->int_pos().Y; + int spr_z = pPlayerActor->int_pos().Z; auto spr_sect = pPlayerActor->sector(); // TODO @@ -879,7 +879,7 @@ void AIPlayer::Tick(RunListEvent* ev) { pPlayerActor->add_int_pos({ (x >> 14), (y >> 14), 0 }); - vec3_t pos = pPlayerActor->spr.pos; + vec3_t pos = pPlayerActor->int_pos(); SetActor(pPlayerActor, &pos); pPlayerActor->set_int_z(pPlayerActor->sector()->floorz); @@ -897,7 +897,7 @@ void AIPlayer::Tick(RunListEvent* ev) } // loc_1A6E4 - if (inside(pPlayerActor->spr.pos.X, pPlayerActor->spr.pos.Y, pPlayerActor->sector()) != 1) + if (inside(pPlayerActor->int_pos().X, pPlayerActor->int_pos().Y, pPlayerActor->sector()) != 1) { ChangeActorSect(pPlayerActor, spr_sect); @@ -988,7 +988,7 @@ void AIPlayer::Tick(RunListEvent* ev) pPlayerActor->spr.yvel = 0; StopActorSound(pPlayerActor); - PlayFXAtXYZ(StaticSound[kSoundJonFDie], pPlayerActor->spr.pos.X, pPlayerActor->spr.pos.Y, pPlayerActor->spr.pos.Z, CHANF_NONE, 1); // CHECKME + PlayFXAtXYZ(StaticSound[kSoundJonFDie], pPlayerActor->int_pos().X, pPlayerActor->int_pos().Y, pPlayerActor->int_pos().Z, CHANF_NONE, 1); // CHECKME } else { @@ -1070,11 +1070,11 @@ void AIPlayer::Tick(RunListEvent* ev) sectdone: if (!PlayerList[nPlayer].bPlayerPan && !PlayerList[nPlayer].bLockPan) { - PlayerList[nPlayer].nDestVertPan = q16horiz(clamp((spr_z - pPlayerActor->spr.pos.Z) << 9, gi->playerHorizMin(), gi->playerHorizMax())); + PlayerList[nPlayer].nDestVertPan = q16horiz(clamp((spr_z - pPlayerActor->int_pos().Z) << 9, gi->playerHorizMin(), gi->playerHorizMax())); } - playerX -= pPlayerActor->spr.pos.X; - playerY -= pPlayerActor->spr.pos.Y; + playerX -= pPlayerActor->int_pos().X; + playerY -= pPlayerActor->int_pos().Y; uint32_t sqrtNum = playerX * playerX + playerY * playerY; @@ -1089,7 +1089,7 @@ sectdone: auto pViewSect = pPlayerActor->sector(); - int EyeZ = PlayerList[nPlayer].eyelevel + pPlayerActor->spr.pos.Z + nQuake[nPlayer]; + int EyeZ = PlayerList[nPlayer].eyelevel + pPlayerActor->int_pos().Z + nQuake[nPlayer]; while (1) { @@ -1111,9 +1111,9 @@ sectdone: { if (nMove.type == kHitWall) { - int var_C4 = pPlayerActor->spr.pos.X; - int var_D4 = pPlayerActor->spr.pos.Y; - int var_C8 = pPlayerActor->spr.pos.Z; + int var_C4 = pPlayerActor->int_pos().X; + int var_D4 = pPlayerActor->int_pos().Y; + int var_C8 = pPlayerActor->int_pos().Z; ChangeActorSect(pPlayerActor, pViewSect); @@ -1140,8 +1140,8 @@ sectdone: // loc_1ADAF PlayerList[nPlayer].pPlayerViewSect = pViewSect; - PlayerList[nPlayer].nPlayerD.X = pPlayerActor->spr.pos.X - spr_x; - PlayerList[nPlayer].nPlayerD.Y = pPlayerActor->spr.pos.Y - spr_y; + PlayerList[nPlayer].nPlayerD.X = pPlayerActor->int_pos().X - spr_x; + PlayerList[nPlayer].nPlayerD.Y = pPlayerActor->int_pos().Y - spr_y; int var_5C = pViewSect->Flag & kSectUnderwater; @@ -1223,7 +1223,7 @@ sectdone: { auto pTmpSect = pPlayerActor->sector(); - if (PlayerList[nPlayer].totalvel > 25 && pPlayerActor->spr.pos.Z > pTmpSect->floorz) + if (PlayerList[nPlayer].totalvel > 25 && pPlayerActor->int_pos().Z > pTmpSect->floorz) { if (pTmpSect->Depth && !pTmpSect->Speed && !pTmpSect->Damage) { @@ -1258,7 +1258,7 @@ sectdone: DExhumedActor* pFloorActor = PlayerList[nPlayer].pPlayerFloorSprite; if (nTotalPlayers > 1 && pFloorActor) { - pFloorActor->set_int_xy(pPlayerActor->spr.pos.X, pPlayerActor->spr.pos.Y); + pFloorActor->set_int_xy(pPlayerActor->int_pos().X, pPlayerActor->int_pos().Y); if (pFloorActor->sector() != pPlayerActor->sector()) { @@ -1284,10 +1284,10 @@ sectdone: HitInfo near; // neartag finds the nearest sector, wall, and sprite which has its hitag and/or lotag set to a value. - neartag(pPlayerActor->spr.pos, pPlayerActor->sector(), pPlayerActor->spr.ang, near, 1024, 2); + neartag(pPlayerActor->int_pos(), pPlayerActor->sector(), pPlayerActor->spr.ang, near, 1024, 2); DExhumedActor* pActorB; - feebtag(pPlayerActor->spr.pos.X, pPlayerActor->spr.pos.Y, pPlayerActor->spr.pos.Z, pPlayerActor->sector(), &pActorB, var_30, 768); + feebtag(pPlayerActor->int_pos().X, pPlayerActor->int_pos().Y, pPlayerActor->int_pos().Z, pPlayerActor->sector(), &pActorB, var_30, 768); // Item pickup code if (pActorB != nullptr && pActorB->spr.statnum >= 900) @@ -2182,7 +2182,7 @@ sectdone: ChangeActorStat(pActorB, 899); } - SetSavePoint(nPlayer, pPlayerActor->spr.pos.X, pPlayerActor->spr.pos.Y, pPlayerActor->spr.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.ang); break; } @@ -2500,7 +2500,7 @@ sectdone: case 16: PlayerList[nPlayer].nSeqSize = SeqSize[var_AC] - 1; - if (pPlayerActor->spr.pos.Z < pPlayerActor->sector()->floorz) { + if (pPlayerActor->int_pos().Z < pPlayerActor->sector()->floorz) { pPlayerActor->add_int_z(256); } @@ -2510,7 +2510,7 @@ sectdone: sectortype* mouthSect; WheresMyMouth(nPlayer, &pos, &mouthSect); - BuildAnim(nullptr, 71, 0, pos.X, pos.Y, pPlayerActor->spr.pos.Z + 3840, mouthSect, 75, 128); + BuildAnim(nullptr, 71, 0, pos.X, pos.Y, pPlayerActor->int_pos().Z + 3840, mouthSect, 75, 128); } break; case 17: @@ -2526,9 +2526,9 @@ sectdone: // loc_1C3B4: if (nPlayer == nLocalPlayer) { - initx = pPlayerActor->spr.pos.X; - inity = pPlayerActor->spr.pos.Y; - initz = pPlayerActor->spr.pos.Z; + initx = pPlayerActor->int_pos().X; + inity = pPlayerActor->int_pos().Y; + initz = pPlayerActor->int_pos().Z; initsectp = pPlayerActor->sector(); inita = pPlayerActor->spr.ang; } @@ -2572,7 +2572,7 @@ sectdone: } // loc_1C4E1 - pDopple->set_int_pos(pPlayerActor->spr.pos); + pDopple->set_int_pos(pPlayerActor->int_pos()); if (pPlayerActor->sector()->pAbove != nullptr) { diff --git a/source/games/exhumed/src/queen.cpp b/source/games/exhumed/src/queen.cpp index e118f4300..5954ddc2a 100644 --- a/source/games/exhumed/src/queen.cpp +++ b/source/games/exhumed/src/queen.cpp @@ -249,7 +249,7 @@ void DestroyEgg(int nEgg) if (QueenEgg[nEgg].nAction != 4) { - BuildAnim(nullptr, 34, 0, pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, pActor->sector(), pActor->spr.xrepeat, 4); + BuildAnim(nullptr, 34, 0, pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, pActor->sector(), pActor->spr.xrepeat, 4); } else { @@ -301,12 +301,12 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int val { int nTileY = (tileHeight(pActor2->spr.picnum) * pActor2->spr.yrepeat) * 2; - int nMyAngle = GetMyAngle(pActor2->spr.pos.X - pActor->spr.pos.X, pActor2->spr.pos.Y - pActor->spr.pos.Y); + int nMyAngle = GetMyAngle(pActor2->int_pos().X - pActor->int_pos().X, pActor2->int_pos().Y - pActor->int_pos().Y); - int edx = ((pActor2->spr.pos.Z - nTileY) - pActor->spr.pos.Z) >> 8; + int edx = ((pActor2->int_pos().Z - nTileY) - pActor->int_pos().Z) >> 8; - uint32_t xDiff = abs(pActor2->spr.pos.X - pActor->spr.pos.X); - uint32_t yDiff = abs(pActor2->spr.pos.Y - pActor->spr.pos.Y); + uint32_t xDiff = abs(pActor2->int_pos().X - pActor->int_pos().X); + uint32_t yDiff = abs(pActor2->int_pos().Y - pActor->int_pos().Y); uint32_t sqrtVal = xDiff * xDiff + yDiff * yDiff; @@ -392,9 +392,9 @@ void BuildTail() { auto head = QueenHead.pActor; - int x = head->spr.pos.X; - int y = head->spr.pos.Y; - int z = head->spr.pos.Z; + int x = head->int_pos().X; + int y = head->int_pos().Y; + int z = head->int_pos().Z; auto pSector =head->sector(); int i; @@ -444,8 +444,8 @@ void BuildQueenEgg(int nQueen, int nVal) DExhumedActor* pActor = QueenList[nQueen].pActor; if (!pActor) return; - int x = pActor->spr.pos.X; - int y = pActor->spr.pos.Y; + int x = pActor->int_pos().X; + int y = pActor->int_pos().Y; auto pSector =pActor->sector(); int nFloorZ = pSector->floorz; int nAngle = pActor->spr.ang; @@ -651,8 +651,8 @@ void AIQueenEgg::Tick(RunListEvent* ev) pEgg->nCounter--; if (pEgg->nCounter <= 0) { - auto pWaspSprite = BuildWasp(nullptr, pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, pActor->sector(), pActor->spr.ang, true); - pActor->set_int_z(pWaspSprite->spr.pos.Z); + auto pWaspSprite = BuildWasp(nullptr, pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, pActor->sector(), pActor->spr.ang, true); + pActor->set_int_z(pWaspSprite->int_pos().Z); DestroyEgg(nEgg); } @@ -702,8 +702,8 @@ void BuildQueenHead(int nQueen) DExhumedActor* pActor = QueenList[nQueen].pActor; if (!pActor) return; - int x = pActor->spr.pos.X; - int y = pActor->spr.pos.Y; + int x = pActor->int_pos().X; + int y = pActor->int_pos().Y; int nAngle = pActor->spr.ang; auto pSector = pActor->sector(); int z = pSector->floorz; @@ -862,7 +862,7 @@ void AIQueenHead::Tick(RunListEvent* ev) [[fallthrough]]; case 1: - if ((pTarget->spr.pos.Z - 51200) > pActor->spr.pos.Z) + if ((pTarget->int_pos().Z - 51200) > pActor->int_pos().Z) { QueenHead.nAction = 4; QueenHead.nFrame = 0; @@ -918,9 +918,9 @@ void AIQueenHead::Tick(RunListEvent* ev) // switch break. MoveQS stuff? __MOVEQS: - MoveQX[nQHead] = pActor->spr.pos.X; - MoveQY[nQHead] = pActor->spr.pos.Y; - MoveQZ[nQHead] = pActor->spr.pos.Z; + MoveQX[nQHead] = pActor->int_pos().X; + MoveQY[nQHead] = pActor->int_pos().Y; + MoveQZ[nQHead] = pActor->int_pos().Z; assert(pActor->sector()); MoveQS[nQHead] = pActor->sector(); MoveQA[nQHead] = pActor->spr.ang; @@ -968,9 +968,9 @@ void AIQueenHead::Tick(RunListEvent* ev) { if (QueenHead.nIndex2 >= 15 || QueenHead.nIndex2 < 10) { - int x = pActor->spr.pos.X; - int y = pActor->spr.pos.Y; - int z = pActor->spr.pos.Z; + int x = pActor->int_pos().X; + int y = pActor->int_pos().Y; + int z = pActor->int_pos().Z; auto pSector =pActor->sector(); int nAngle = RandomSize(11) & kAngleMask; @@ -1111,8 +1111,8 @@ void BuildQueen(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, else { ChangeActorStat(pActor, 121); - x = pActor->spr.pos.X; - y = pActor->spr.pos.Y; + x = pActor->int_pos().X; + y = pActor->int_pos().Y; z = pActor->sector()->floorz; nAngle = pActor->spr.ang; } @@ -1398,9 +1398,9 @@ void AIQueen::Tick(RunListEvent* ev) PlayFXAtXYZ( StaticSound[kSound40], - pActor->spr.pos.X, - pActor->spr.pos.Y, - pActor->spr.pos.Z); + pActor->int_pos().X, + pActor->int_pos().Y, + pActor->int_pos().Z); BuildQueenHead(nQueen); @@ -1463,7 +1463,7 @@ void AIQueen::Damage(RunListEvent* ev) QueenList[nQueen].nHealth = 4000; QueenList[nQueen].nAction = 7; - BuildAnim(nullptr, 36, 0, pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z - 7680, pActor->sector(), pActor->spr.xrepeat, 4); + BuildAnim(nullptr, 36, 0, pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z - 7680, pActor->sector(), pActor->spr.xrepeat, 4); break; case 2: QueenList[nQueen].nHealth = 4000; diff --git a/source/games/exhumed/src/ra.cpp b/source/games/exhumed/src/ra.cpp index d97009f86..e0e83857a 100644 --- a/source/games/exhumed/src/ra.cpp +++ b/source/games/exhumed/src/ra.cpp @@ -100,7 +100,7 @@ void BuildRa(int nPlayer) pActor->spr.pal = 1; pActor->spr.xrepeat = 64; pActor->spr.yrepeat = 64; - pActor->set_int_pos(pPlayerActor->spr.pos); + pActor->set_int_pos(pPlayerActor->int_pos()); // GrabTimeSlot(3); @@ -163,7 +163,7 @@ void MoveRaToEnemy(int nPlayer) pTarget = PlayerList[nPlayer].pActor; } - pActor->set_int_pos({ pTarget->spr.pos.X, pTarget->spr.pos.Y, pTarget->spr.pos.Z - GetActorHeight(pTarget) }); + pActor->set_int_pos({ pTarget->int_pos().X, pTarget->int_pos().Y, pTarget->int_pos().Z - GetActorHeight(pTarget) }); if (pActor->sector() != pTarget->sector()) { ChangeActorSect(pActor, pTarget->sector()); diff --git a/source/games/exhumed/src/ramses.cpp b/source/games/exhumed/src/ramses.cpp index 314c29725..7ca4e7fe2 100644 --- a/source/games/exhumed/src/ramses.cpp +++ b/source/games/exhumed/src/ramses.cpp @@ -426,7 +426,7 @@ void DoSpiritHead() if (nCount < (15 * nPixels) / 16) { SoundBigEntrance(); AddGlow(pSpiritSpr->sector(), 20); - AddFlash(pSpiritSpr->sector(), pSpiritSpr->spr.pos.X, pSpiritSpr->spr.pos.Y, pSpiritSpr->spr.pos.Z, 128); + AddFlash(pSpiritSpr->sector(), pSpiritSpr->int_pos().X, pSpiritSpr->int_pos().Y, pSpiritSpr->int_pos().Z, 128); nHeadStage = 3; TintPalette(255, 255, 255); CopyHeadToWorkTile(kTileRamsesNormal); diff --git a/source/games/exhumed/src/rat.cpp b/source/games/exhumed/src/rat.cpp index 99c978d7f..b0acb3106 100644 --- a/source/games/exhumed/src/rat.cpp +++ b/source/games/exhumed/src/rat.cpp @@ -81,9 +81,9 @@ void BuildRat(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, i } else { - x = pActor->spr.pos.X; - y = pActor->spr.pos.Y; - z = pActor->spr.pos.Z; + x = pActor->int_pos().X; + y = pActor->int_pos().Y; + z = pActor->int_pos().Z; nAngle = pActor->spr.ang; ChangeActorStat(pActor, 108); @@ -129,9 +129,9 @@ void BuildRat(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, i DExhumedActor* FindFood(DExhumedActor* pActor) { auto pSector = pActor->sector(); - int x = pActor->spr.pos.X; - int y = pActor->spr.pos.Y; - int z = pActor->spr.pos.Z; + int x = pActor->int_pos().X; + int y = pActor->int_pos().Y; + int z = pActor->int_pos().Z; int z2 = (z + pSector->ceilingz) / 2; @@ -140,7 +140,7 @@ DExhumedActor* FindFood(DExhumedActor* pActor) DExhumedActor* pActor2 = nChunkSprite[RandomSize(7) % nChunkTotal]; if (pActor2 != nullptr) { - if (cansee(x, y, z2, pSector, pActor2->spr.pos.X, pActor2->spr.pos.Y, pActor2->spr.pos.Z, pActor2->sector())) { + if (cansee(x, y, z2, pSector, pActor2->int_pos().X, pActor2->int_pos().Y, pActor2->int_pos().Z, pActor2->sector())) { return pActor2; } } @@ -155,7 +155,7 @@ DExhumedActor* FindFood(DExhumedActor* pActor) { if (nPlayerPic == pActor2->spr.picnum) { - if (cansee(x, y, z, pSector, pActor2->spr.pos.X, pActor2->spr.pos.Y, pActor2->spr.pos.Z, pActor2->sector())) { + if (cansee(x, y, z, pSector, pActor2->int_pos().X, pActor2->int_pos().Y, pActor2->int_pos().Z, pActor2->sector())) { return pActor2; } } @@ -235,8 +235,8 @@ void AIRat::Tick(RunListEvent* ev) return; } - int xVal = abs(pActor->spr.pos.X - pTarget->spr.pos.X); - int yVal = abs(pActor->spr.pos.Y - pTarget->spr.pos.Y); + int xVal = abs(pActor->int_pos().X - pTarget->int_pos().X); + int yVal = abs(pActor->int_pos().Y - pTarget->int_pos().Y); if (xVal > 50 || yVal > 50) { @@ -288,8 +288,8 @@ void AIRat::Tick(RunListEvent* ev) MoveCreature(pActor); - int xVal = abs(pActor->spr.pos.X - pTarget->spr.pos.X); - int yVal = abs(pActor->spr.pos.Y - pTarget->spr.pos.Y); + int xVal = abs(pActor->int_pos().X - pTarget->int_pos().X); + int yVal = abs(pActor->int_pos().Y - pTarget->int_pos().Y); if (xVal >= 50 || yVal >= 50) { diff --git a/source/games/exhumed/src/rex.cpp b/source/games/exhumed/src/rex.cpp index 5b1ea5a73..4bc0d0000 100644 --- a/source/games/exhumed/src/rex.cpp +++ b/source/games/exhumed/src/rex.cpp @@ -45,8 +45,8 @@ void BuildRex(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, i } else { - x = pActor->spr.pos.X; - y = pActor->spr.pos.Y; + x = pActor->int_pos().X; + y = pActor->int_pos().Y; z = pActor->sector()->floorz; nAngle = pActor->spr.ang; diff --git a/source/games/exhumed/src/roach.cpp b/source/games/exhumed/src/roach.cpp index c4acfeaa5..7504c9066 100644 --- a/source/games/exhumed/src/roach.cpp +++ b/source/games/exhumed/src/roach.cpp @@ -44,8 +44,8 @@ void BuildRoach(int nType, DExhumedActor* pActor, int x, int y, int z, sectortyp else { ChangeActorStat(pActor, 105); - x = pActor->spr.pos.X; - y = pActor->spr.pos.Y; + x = pActor->int_pos().X; + y = pActor->int_pos().Y; z = pActor->sector()->floorz; angle = pActor->spr.ang; } @@ -275,7 +275,7 @@ void AIRoach::Tick(RunListEvent* ev) pActor->spr.xvel = 0; pActor->spr.yvel = 0; - pActor->spr.ang = GetMyAngle(pTarget->spr.pos.X - pActor->spr.pos.X, pTarget->spr.pos.Y - pActor->spr.pos.Y); + pActor->spr.ang = GetMyAngle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y); pActor->nFrame = 0; } @@ -304,7 +304,7 @@ void AIRoach::Tick(RunListEvent* ev) pActor->spr.xvel = 0; pActor->spr.yvel = 0; - pActor->spr.ang = GetMyAngle(pTarget->spr.pos.X - pActor->spr.pos.X, pTarget->spr.pos.Y - pActor->spr.pos.Y); + pActor->spr.ang = GetMyAngle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y); pActor->nFrame = 0; } diff --git a/source/games/exhumed/src/runlist.cpp b/source/games/exhumed/src/runlist.cpp index 8c57c088f..3327474f2 100644 --- a/source/games/exhumed/src/runlist.cpp +++ b/source/games/exhumed/src/runlist.cpp @@ -1604,9 +1604,9 @@ int runlist_CheckRadialDamage(DExhumedActor* pActor) return 0; } - int x = (pActor->spr.pos.X - pRadialActor->spr.pos.X) >> 8; - int y = (pActor->spr.pos.Y - pRadialActor->spr.pos.Y) >> 8; - int z = (pActor->spr.pos.Z - pRadialActor->spr.pos.Z) >> 12; + int x = (pActor->int_pos().X - pRadialActor->int_pos().X) >> 8; + int y = (pActor->int_pos().Y - pRadialActor->int_pos().Y) >> 8; + int z = (pActor->int_pos().Z - pRadialActor->int_pos().Z) >> 12; if (abs(x) > nDamageRadius) { return 0; @@ -1641,13 +1641,13 @@ int runlist_CheckRadialDamage(DExhumedActor* pActor) pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; if (((kStatExplodeTarget - pActor->spr.statnum) <= 1) || - cansee(pRadialActor->spr.pos.X, - pRadialActor->spr.pos.Y, - pRadialActor->spr.pos.Z - 512, + cansee(pRadialActor->int_pos().X, + pRadialActor->int_pos().Y, + pRadialActor->int_pos().Z - 512, pRadialActor->sector(), - pActor->spr.pos.X, - pActor->spr.pos.Y, - pActor->spr.pos.Z - 8192, + pActor->int_pos().X, + pActor->int_pos().Y, + pActor->int_pos().Z - 8192, pActor->sector())) { edi = (nRadialDamage * (nDamageRadius - nDist)) / nDamageRadius; diff --git a/source/games/exhumed/src/scorp.cpp b/source/games/exhumed/src/scorp.cpp index 484105d11..8b8a9518d 100644 --- a/source/games/exhumed/src/scorp.cpp +++ b/source/games/exhumed/src/scorp.cpp @@ -48,8 +48,8 @@ void BuildScorp(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, { ChangeActorStat(pActor, 122); - x = pActor->spr.pos.X; - y = pActor->spr.pos.Y; + x = pActor->int_pos().X; + y = pActor->int_pos().Y; z = pActor->sector()->floorz; nAngle = pActor->spr.ang; } @@ -248,7 +248,7 @@ void AIScorp::Tick(RunListEvent* ev) { if (pTarget == nMov.actor()) { - int nAngle = getangle(pTarget->spr.pos.X - pActor->spr.pos.X, pTarget->spr.pos.Y - pActor->spr.pos.Y); + 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) { pActor->nAction = 2; @@ -367,7 +367,7 @@ void AIScorp::Tick(RunListEvent* ev) return; } - auto pSpiderActor = BuildSpider(nullptr, pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.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.ang); if (pSpiderActor) { pSpiderActor->spr.ang = RandomSize(11); @@ -426,12 +426,12 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode) { pActor->nCount = 45; - if (cansee(pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z - GetActorHeight(pActor), pActor->sector(), - pTarget->spr.pos.X, pTarget->spr.pos.Y, pTarget->spr.pos.Z - GetActorHeight(pTarget), pTarget->sector())) + if (cansee(pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z - GetActorHeight(pActor), pActor->sector(), + pTarget->int_pos().X, pTarget->int_pos().Y, pTarget->int_pos().Z - GetActorHeight(pTarget), pTarget->sector())) { pActor->spr.xvel = 0; pActor->spr.yvel = 0; - pActor->spr.ang = GetMyAngle(pTarget->spr.pos.X - pActor->spr.pos.X, pTarget->spr.pos.Y - pActor->spr.pos.Y); + pActor->spr.ang = GetMyAngle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y); pActor->nIndex = RandomSize(2) + RandomSize(3); diff --git a/source/games/exhumed/src/set.cpp b/source/games/exhumed/src/set.cpp index cb4bfb710..b56f0a91d 100644 --- a/source/games/exhumed/src/set.cpp +++ b/source/games/exhumed/src/set.cpp @@ -48,8 +48,8 @@ void BuildSet(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, i else { ChangeActorStat(pActor, 120); - x = pActor->spr.pos.X; - y = pActor->spr.pos.Y; + x = pActor->int_pos().X; + y = pActor->int_pos().Y; z = pActor->sector()->floorz; nAngle = pActor->spr.ang; } @@ -110,7 +110,7 @@ void BuildSoul(DExhumedActor* pSet) pActor->spr.xvel = 0; pActor->spr.yvel = 0; pActor->spr.zvel = (-256) - RandomSize(10); - pActor->set_int_pos({ pSet->spr.pos.X, pSet->spr.pos.Y, (RandomSize(8) << 8) + 8192 + pActor->sector()->ceilingz - GetActorHeight(pActor) }); + pActor->set_int_pos({ pSet->int_pos().X, pSet->int_pos().Y, (RandomSize(8) << 8) + 8192 + pActor->sector()->ceilingz - GetActorHeight(pActor) }); //pActor->spr.hitag = nSet; pActor->pTarget = pSet; @@ -150,7 +150,7 @@ void AISoul::Tick(RunListEvent* ev) pActor->spr.cstat = 0; pActor->spr.yrepeat = 1; pActor->spr.xrepeat = 1; - pActor->set_int_pos({ pSet->spr.pos.X, pSet->spr.pos.Y, pSet->spr.pos.Z - (GetActorHeight(pSet) >> 1) }); + pActor->set_int_pos({ pSet->int_pos().X, pSet->int_pos().Y, pSet->int_pos().Z - (GetActorHeight(pSet) >> 1) }); ChangeActorSect(pActor, pSet->sector()); return; } @@ -406,9 +406,9 @@ void AISet::Tick(RunListEvent* ev) if (pSector) { - if ((pActor->spr.pos.Z - pSector->floorz) < 55000) + if ((pActor->int_pos().Z - pSector->floorz) < 55000) { - if (pActor->spr.pos.Z > pSector->ceilingz) + if (pActor->int_pos().Z > pSector->ceilingz) { pActor->nIndex = 1; pActor->nAction = 7; @@ -429,7 +429,7 @@ void AISet::Tick(RunListEvent* ev) { if (pTarget == nMov.actor()) { - int nAng = getangle(pTarget->spr.pos.X - pActor->spr.pos.X, pTarget->spr.pos.Y - pActor->spr.pos.Y); + 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) { pActor->nAction = 4; diff --git a/source/games/exhumed/src/snake.cpp b/source/games/exhumed/src/snake.cpp index 2726c3310..a74d665c0 100644 --- a/source/games/exhumed/src/snake.cpp +++ b/source/games/exhumed/src/snake.cpp @@ -117,9 +117,9 @@ void ExplodeSnakeSprite(DExhumedActor* pActor, int nPlayer) pActor->pTarget = nOwner; - BuildAnim(nullptr, 23, 0, pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, pActor->sector(), 40, 4); + BuildAnim(nullptr, 23, 0, pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, pActor->sector(), 40, 4); - AddFlash(pActor->sector(), pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, 128); + AddFlash(pActor->sector(), pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, 128); StopActorSound(pActor); } @@ -133,9 +133,9 @@ void BuildSnake(int nPlayer, int zVal) auto pViewSect = PlayerList[nPlayer].pPlayerViewSect; int nPic = seq_GetSeqPicnum(kSeqSnakBody, 0, 0); - int x = pPlayerActor->spr.pos.X; - int y = pPlayerActor->spr.pos.Y; - int z = (pPlayerActor->spr.pos.Z + zVal) - 2560; + 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; HitInfo hit{}; @@ -193,7 +193,7 @@ void BuildSnake(int nPlayer, int zVal) if (i == 0) { - pActor->set_int_pos({ pPlayerActor->spr.pos.X, pPlayerActor->spr.pos.Y, pPlayerActor->spr.pos.Z + zVal }); + pActor->set_int_pos({ pPlayerActor->int_pos().X, pPlayerActor->int_pos().Y, pPlayerActor->int_pos().Z + zVal }); pActor->spr.xrepeat = 32; pActor->spr.yrepeat = 32; pViewSect = pActor->sector(); @@ -201,7 +201,7 @@ void BuildSnake(int nPlayer, int zVal) } else { - pActor->set_int_pos(sprt->spr.pos); + pActor->set_int_pos(sprt->int_pos()); pActor->spr.xrepeat = 40 - 3 * i; pActor->spr.yrepeat = 40 - 3 * i; } @@ -337,11 +337,11 @@ void AISnake::Tick(RunListEvent* ev) goto SEARCH_ENEMY; } - zVal = pActor->spr.pos.Z; + zVal = pActor->int_pos().Z; nMov = AngleChase(pActor, pEnemySprite, 1200, SnakeList[nSnake].nAngle, 32); - zVal = pActor->spr.pos.Z - zVal; + zVal = pActor->int_pos().Z - zVal; } if (nMov.type || nMov.exbits) @@ -367,9 +367,9 @@ void AISnake::Tick(RunListEvent* ev) int var_28 = (nAngle + 512) & kAngleMask; auto pSector = pActor->sector(); - int x = pActor->spr.pos.X; - int y = pActor->spr.pos.Y; - int z = pActor->spr.pos.Z; + int x = pActor->int_pos().X; + int y = pActor->int_pos().Y; + int z = pActor->int_pos().Z; for (int i = 7; i > 0; i--) { diff --git a/source/games/exhumed/src/sound.cpp b/source/games/exhumed/src/sound.cpp index 92f438bb9..9209d2fde 100644 --- a/source/games/exhumed/src/sound.cpp +++ b/source/games/exhumed/src/sound.cpp @@ -429,7 +429,7 @@ void EXSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], if (nSnakeCam > -1) { Snake* pSnake = &SnakeList[nSnakeCam]; - campos = pSnake->pSprites[0]->spr.pos; + campos = pSnake->pSprites[0]->int_pos(); } else { @@ -477,7 +477,7 @@ void EXSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], assert(actor != nullptr); if (actor != nullptr) { - *pos = GetSoundPos(actor->spr.pos); + *pos = GetSoundPos(actor->int_pos()); } } if ((chanflags & CHANF_LISTENERZ) && type != SOURCE_None) @@ -503,7 +503,7 @@ void GameInterface::UpdateSounds() if (nSnakeCam > -1) { Snake *pSnake = &SnakeList[nSnakeCam]; - pos = pSnake->pSprites[0]->spr.pos; + pos = pSnake->pSprites[0]->int_pos(); ang = pSnake->pSprites[0]->spr.ang; } else @@ -565,9 +565,9 @@ void PlayFX2(int nSound, DExhumedActor* pActor, int sectf, EChanFlags chanflags, { fullvol = (sprflags & 0x2000) != 0; hiprio = (sprflags & 0x4000) != 0; - soundx = pActor->spr.pos.X; - soundy = pActor->spr.pos.Y; - soundz = pActor->spr.pos.Z; + soundx = pActor->int_pos().X; + soundy = pActor->int_pos().Y; + soundz = pActor->int_pos().Z; } int nVolume = 255; @@ -686,7 +686,7 @@ void CheckAmbience(sectortype* sect) { if (sect == pSector2) { - amb = GetSoundPos(PlayerList[0].pActor->spr.pos); + amb = GetSoundPos(PlayerList[0].pActor->int_pos()); } else { @@ -731,7 +731,7 @@ void UpdateCreepySounds() if (totalmoves & 2) vax = -vax; - auto sp = PlayerList[nLocalPlayer].pActor->spr.pos + vec3_t({ vdx, vax, 0 }); + auto sp = PlayerList[nLocalPlayer].pActor->int_pos() + vec3_t({ vdx, vax, 0 }); creepy = GetSoundPos(sp); if ((vsi & 0x1ff) >= kMaxSounds || !soundEngine->isValidSoundId((vsi & 0x1ff) + 1)) diff --git a/source/games/exhumed/src/spider.cpp b/source/games/exhumed/src/spider.cpp index a533461be..d9803c3f4 100644 --- a/source/games/exhumed/src/spider.cpp +++ b/source/games/exhumed/src/spider.cpp @@ -46,8 +46,8 @@ DExhumedActor* BuildSpider(DExhumedActor* spp, int x, int y, int z, sectortype* { ChangeActorStat(spp, 99); - x = spp->spr.pos.X; - y = spp->spr.pos.Y; + x = spp->int_pos().X; + y = spp->int_pos().Y; z = spp->sector()->floorz; nAngle = spp->spr.ang; } @@ -310,7 +310,7 @@ void AISpider::Tick(RunListEvent* ev) { if (nMov.actor() == pTarget) { - int nAng = getangle(pTarget->spr.pos.X - spp->spr.pos.X, pTarget->spr.pos.Y - spp->spr.pos.Y); + 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) { spp->nAction = 2; diff --git a/source/games/exhumed/src/switch.cpp b/source/games/exhumed/src/switch.cpp index 8d5a8cd7e..733b534ae 100644 --- a/source/games/exhumed/src/switch.cpp +++ b/source/games/exhumed/src/switch.cpp @@ -442,7 +442,7 @@ void AISWPressSector::Use(RunListEvent* ev) { if (SwitchData[nSwitch].nKeyMask) { - auto& pos = PlayerList[nPlayer].pActor->spr.pos; + auto& pos = PlayerList[nPlayer].pActor->int_pos(); PlayFXAtXYZ(StaticSound[nSwitchSound], pos.X, pos.Y, 0, CHANF_LISTENERZ); StatusMessage(300, GStrings("TXT_EX_NEEDKEY")); diff --git a/source/games/exhumed/src/view.cpp b/source/games/exhumed/src/view.cpp index acd06e8f6..6c0c609ce 100644 --- a/source/games/exhumed/src/view.cpp +++ b/source/games/exhumed/src/view.cpp @@ -123,8 +123,8 @@ static void analyzesprites(tspriteArray& tsprites, int x, int y, int z, double c if ((pActor->spr.statnum < 150) && (pActor->spr.cstat & CSTAT_SPRITE_BLOCK_ALL) && (pActor != pPlayerActor)) { - int xval = pActor->spr.pos.X - x; - int yval = pActor->spr.pos.Y - y; + int xval = pActor->int_pos().X - x; + int yval = pActor->int_pos().Y - y; int vcos = bcos(nAngle); int vsin = bsin(nAngle); @@ -163,7 +163,7 @@ static void analyzesprites(tspriteArray& tsprites, int x, int y, int z, double c { nCreepyTimer = kCreepyCount; - if (!cansee(x, y, z, pSector, targ->spr.pos.X, targ->spr.pos.Y, targ->spr.pos.Z - GetActorHeight(targ), targ->sector())) + if (!cansee(x, y, z, pSector, targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - GetActorHeight(targ), targ->sector())) { bestTarget = nullptr; } @@ -207,9 +207,9 @@ void DrawView(double smoothRatio, bool sceneonly) { DExhumedActor* pActor = SnakeList[nSnakeCam].pSprites[0]; - playerX = pActor->spr.pos.X; - playerY = pActor->spr.pos.Y; - playerZ = pActor->spr.pos.Z; + playerX = pActor->int_pos().X; + playerY = pActor->int_pos().Y; + playerZ = pActor->int_pos().Z; pSector = pActor->sector(); nAngle = buildang(pActor->spr.ang); rotscrnang = buildang(0); diff --git a/source/games/exhumed/src/wasp.cpp b/source/games/exhumed/src/wasp.cpp index 11937c3c8..6854c9c04 100644 --- a/source/games/exhumed/src/wasp.cpp +++ b/source/games/exhumed/src/wasp.cpp @@ -334,7 +334,7 @@ void AIWasp::Tick(RunListEvent* ev) pActor->add_int_z(pActor->spr.zvel); - if (pActor->spr.pos.Z >= pSector->floorz) + if (pActor->int_pos().Z >= pSector->floorz) { if (pSector->pBelow != nullptr) {