- Exhumed: renamed all spr.pos.

This commit is contained in:
Christoph Oelckers 2022-01-31 23:33:44 +01:00
parent 78720f93b2
commit 43bd8acb31
33 changed files with 313 additions and 313 deletions

View file

@ -134,7 +134,7 @@ void AIAnim::Tick(RunListEvent* ev)
if (pIgniter) if (pIgniter)
{ {
pActor->set_int_pos(pIgniter->spr.pos); pActor->set_int_pos(pIgniter->int_pos());
if (pIgniter->sector() != pActor->sector()) if (pIgniter->sector() != pActor->sector())
{ {
@ -234,12 +234,12 @@ void BuildExplosion(DExhumedActor* pActor)
{ {
edx = 75; edx = 75;
} }
else if (pActor->spr.pos.Z == pActor->sector()->floorz) else if (pActor->int_pos().Z == pActor->sector()->floorz)
{ {
edx = 34; 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) void BuildSplash(DExhumedActor* pActor, sectortype* pSector)
@ -272,7 +272,7 @@ void BuildSplash(DExhumedActor* pActor, sectortype* pSector)
nFlag = 0; 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) if (!bIsLava)
{ {

View file

@ -53,8 +53,8 @@ void BuildAnubis(DExhumedActor* ap, int x, int y, int z, sectortype* pSector, in
{ {
ChangeActorStat(ap, 101); ChangeActorStat(ap, 101);
x = ap->spr.pos.X; x = ap->int_pos().X;
y = ap->spr.pos.Y; y = ap->int_pos().Y;
z = ap->sector()->floorz; z = ap->sector()->floorz;
nAngle = ap->spr.ang; nAngle = ap->spr.ang;
} }
@ -182,7 +182,7 @@ void AIAnubis::Tick(RunListEvent* ev)
{ {
if (move.actor() == pTarget) 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); int nAngDiff = AngleDiff(ap->spr.ang, nAng);
if (nAngDiff < 64) 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 (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(), if (cansee(ap->int_pos().X, ap->int_pos().Y, ap->int_pos().Z - GetActorHeight(ap), ap->sector(),
pTarget->spr.pos.X, pTarget->spr.pos.Y, pTarget->spr.pos.Z - GetActorHeight(pTarget), pTarget->sector())) pTarget->int_pos().X, pTarget->int_pos().Y, pTarget->int_pos().Z - GetActorHeight(pTarget), pTarget->sector()))
{ {
ap->spr.xvel = 0; ap->spr.xvel = 0;
ap->spr.yvel = 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->nAction = 3;
ap->nFrame = 0; ap->nFrame = 0;
@ -397,7 +397,7 @@ void AIAnubis::Damage(RunListEvent* ev)
{ {
auto pDrumActor = insertActor(ap->sector(), kStatAnubisDrum); 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.xrepeat = 40;
pDrumActor->spr.yrepeat = 40; pDrumActor->spr.yrepeat = 40;
pDrumActor->spr.shade = -64; pDrumActor->spr.shade = -64;

View file

@ -91,12 +91,12 @@ void AIBubble::Tick(RunListEvent* ev)
auto pSector = pActor->sector(); auto pSector = pActor->sector();
if (pActor->spr.pos.Z <= pSector->ceilingz) if (pActor->int_pos().Z <= pSector->ceilingz)
{ {
auto pSectAbove = pSector->pAbove; auto pSectAbove = pSector->pAbove;
if (pActor->spr.hitag > -1 && pSectAbove != nullptr) { 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); DestroyBubble(pActor);
@ -124,7 +124,7 @@ void DoBubbleMachines()
{ {
pActor->nCount = (RandomWord() % pActor->nFrame) + 30; pActor->nCount = (RandomWord() % pActor->nFrame) + 30;
BuildBubble(pActor->spr.pos, pActor->sector()); BuildBubble(pActor->int_pos(), pActor->sector());
} }
} }
} }

View file

@ -165,7 +165,7 @@ void IgniteSprite(DExhumedActor* pActor)
{ {
pActor->spr.hitag += 2; 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) if (pAnimActor)
{ {
@ -310,9 +310,9 @@ int MoveBullet(int nBullet)
DExhumedActor* pActor = BulletList[nBullet].pActor; DExhumedActor* pActor = BulletList[nBullet].pActor;
int x = pActor->spr.pos.X; int x = pActor->int_pos().X;
int y = pActor->spr.pos.Y; int y = pActor->int_pos().Y;
int z = pActor->spr.pos.Z; // ebx int z = pActor->int_pos().Z; // ebx
int nSectFlag = pActor->sector()->Flag; int nSectFlag = pActor->sector()->Flag;
int x2, y2, z2; int x2, y2, z2;
@ -369,9 +369,9 @@ MOVEEND:
if (coll.type || coll.exbits) if (coll.type || coll.exbits)
{ {
nVal = 1; nVal = 1;
x2 = pActor->spr.pos.X; x2 = pActor->int_pos().X;
y2 = pActor->spr.pos.Y; y2 = pActor->int_pos().Y;
z2 = pActor->spr.pos.Z; z2 = pActor->int_pos().Z;
pHitSect = pActor->sector(); pHitSect = pActor->sector();
switch (coll.type) switch (coll.type)
@ -405,7 +405,7 @@ MOVEEND:
if (nVal == 0 && nType != 15 && nType != 3) 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) { if (pActor->spr.pal != 5) {
pActor->spr.pal = 1; pActor->spr.pal = 1;
@ -419,9 +419,9 @@ MOVEEND:
if (BulletList[nBullet].pEnemy) if (BulletList[nBullet].pEnemy)
{ {
hitactor = BulletList[nBullet].pEnemy; hitactor = BulletList[nBullet].pEnemy;
x2 = hitactor->spr.pos.X; x2 = hitactor->int_pos().X;
y2 = hitactor->spr.pos.Y; y2 = hitactor->int_pos().Y;
z2 = hitactor->spr.pos.Z - (GetActorHeight(hitactor) >> 1); z2 = hitactor->int_pos().Z - (GetActorHeight(hitactor) >> 1);
pHitSect = hitactor->sector(); pHitSect = hitactor->sector();
} }
else else
@ -530,7 +530,7 @@ HITSPRITE:
nRadialBullet = -1; 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()); 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); DeleteActor(sBullet.pActor);
return nullptr; return nullptr;
} }
@ -605,7 +605,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
nZOffset = -nHeight; nZOffset = -nHeight;
} }
pBulletActor->set_int_pos(pActor->spr.pos); pBulletActor->set_int_pos(pActor->int_pos());
Bullet *pBullet = &BulletList[nBullet]; Bullet *pBullet = &BulletList[nBullet];
@ -682,7 +682,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
pSector = pBulletActor->sector(); pSector = pBulletActor->sector();
while (pBulletActor->spr.pos.Z < pSector->ceilingz) while (pBulletActor->int_pos().Z < pSector->ceilingz)
{ {
if (pSector->pAbove == nullptr) if (pSector->pAbove == nullptr)
{ {
@ -717,14 +717,14 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
nHeight -= nHeight >> 1; nHeight -= nHeight >> 1;
} }
int var_20 = pTarget->spr.pos.Z - nHeight; int var_20 = pTarget->int_pos().Z - nHeight;
int x, y; int x, y;
if (pActor != nullptr && pActor->spr.statnum != 100) if (pActor != nullptr && pActor->spr.statnum != 100)
{ {
x = pTarget->spr.pos.X; x = pTarget->int_pos().X;
y = pTarget->spr.pos.Y; y = pTarget->int_pos().Y;
if (pTarget->spr.statnum != 100) if (pTarget->spr.statnum != 100)
{ {
@ -741,8 +741,8 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
} }
} }
x -= pBulletActor->spr.pos.X; x -= pBulletActor->int_pos().X;
y -= pBulletActor->spr.pos.Y; y -= pBulletActor->int_pos().Y;
nAngle = GetMyAngle(x, y); nAngle = GetMyAngle(x, y);
pActor->spr.ang = nAngle; pActor->spr.ang = nAngle;
@ -750,14 +750,14 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
else else
{ {
// loc_2ABA3: // loc_2ABA3:
x = pTarget->spr.pos.X - pBulletActor->spr.pos.X; x = pTarget->int_pos().X - pBulletActor->int_pos().X;
y = pTarget->spr.pos.Y - pBulletActor->spr.pos.Y; y = pTarget->int_pos().Y - pBulletActor->int_pos().Y;
} }
int nSqrt = lsqrt(y*y + x*x); int nSqrt = lsqrt(y*y + x*x);
if ((unsigned int)nSqrt > 0) 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 else
{ {
@ -801,7 +801,7 @@ void AIBullet::Tick(RunListEvent* ev)
if (nFlag & 0x80) 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++; BulletList[nBullet].nFrame++;

View file

@ -208,8 +208,8 @@ void DoRedAlert(int nVal)
{ {
if (nVal) if (nVal)
{ {
PlayFXAtXYZ(StaticSound[kSoundAlarm], ac->spr.pos.X, ac->spr.pos.Y, ac->spr.pos.Z); PlayFXAtXYZ(StaticSound[kSoundAlarm], ac->int_pos().X, ac->int_pos().Y, ac->int_pos().Z);
AddFlash(ac->sector(), ac->spr.pos.X, ac->spr.pos.Y, ac->spr.pos.Z, 192); AddFlash(ac->sector(), ac->int_pos().X, ac->int_pos().Y, ac->int_pos().Z, 192);
} }
} }
} }

View file

@ -47,7 +47,7 @@ void BuildFishLimb(DExhumedActor* pActor, int anim)
pChunkActor->nCount = anim + 40; pChunkActor->nCount = anim + 40;
pChunkActor->nFrame = RandomSize(3) % SeqSize[SeqOffsets[kSeqFish] + 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.cstat = 0;
pChunkActor->spr.shade = -12; pChunkActor->spr.shade = -12;
pChunkActor->spr.pal = 0; pChunkActor->spr.pal = 0;
@ -94,17 +94,17 @@ void AIFishLimb::Tick(RunListEvent* ev)
{ {
pActor->nFrame = 0; pActor->nFrame = 0;
if (RandomBit()) { 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; int FloorZ = pActor->sector()->floorz;
if (FloorZ <= pActor->spr.pos.Z) if (FloorZ <= pActor->int_pos().Z)
{ {
pActor->add_int_z(256); pActor->add_int_z(256);
if ((pActor->spr.pos.Z - FloorZ) > 25600) if ((pActor->int_pos().Z - FloorZ) > 25600)
{ {
pActor->spr.zvel = 0; pActor->spr.zvel = 0;
runlist_DoSubRunRec(pActor->spr.intowner); runlist_DoSubRunRec(pActor->spr.intowner);
@ -112,7 +112,7 @@ void AIFishLimb::Tick(RunListEvent* ev)
runlist_SubRunRec(pActor->spr.hitag); runlist_SubRunRec(pActor->spr.hitag);
DeleteActor(pActor); DeleteActor(pActor);
} }
else if ((pActor->spr.pos.Z - FloorZ) > 0) else if ((pActor->int_pos().Z - FloorZ) > 0)
{ {
pActor->spr.zvel = 1024; pActor->spr.zvel = 1024;
} }
@ -146,9 +146,9 @@ void BuildFish(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
} }
else else
{ {
x = pActor->spr.pos.X; x = pActor->int_pos().X;
y = pActor->spr.pos.Y; y = pActor->int_pos().Y;
z = pActor->spr.pos.Z; z = pActor->int_pos().Z;
nAngle = pActor->spr.ang; nAngle = pActor->spr.ang;
ChangeActorStat(pActor, 103); ChangeActorStat(pActor, 103);
} }
@ -275,7 +275,7 @@ void AIFish::Damage(RunListEvent* ev)
BuildFishLimb(pActor, i); 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); DestroyFish(pActor);
} }
else else
@ -342,7 +342,7 @@ void AIFish::Tick(RunListEvent* ev)
pActor->nAction = 2; pActor->nAction = 2;
pActor->nFrame = 0; 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->spr.zvel = bsin(nAngle, -5);
pActor->nCount = RandomSize(6) + 90; pActor->nCount = RandomSize(6) + 90;
@ -373,7 +373,7 @@ void AIFish::Tick(RunListEvent* ev)
PlotCourseToSprite(pActor, pTargetActor); PlotCourseToSprite(pActor, pTargetActor);
int nHeight = GetActorHeight(pActor) >> 1; 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) if (z <= nHeight)
{ {
@ -386,7 +386,7 @@ void AIFish::Tick(RunListEvent* ev)
pActor->spr.yvel = 0; 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; break;
} }
@ -415,9 +415,9 @@ void AIFish::Tick(RunListEvent* ev)
} }
} }
int x = pActor->spr.pos.X; int x = pActor->int_pos().X;
int y = pActor->spr.pos.Y; int y = pActor->int_pos().Y;
int z = pActor->spr.pos.Z; int z = pActor->int_pos().Z;
auto pSector =pActor->sector(); auto pSector =pActor->sector();
// loc_2EF54 // loc_2EF54
@ -460,7 +460,7 @@ void AIFish::Tick(RunListEvent* ev)
if (pHitAct->spr.statnum == 100) if (pHitAct->spr.statnum == 100)
{ {
pActor->pTarget = coll.actor(); 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) if (nAction != 3)
{ {

View file

@ -59,7 +59,7 @@ void ThrowGrenade(int nPlayer, int, int, int ecx, int push1)
ChangeActorSect(pActor, PlayerList[nPlayer].pPlayerViewSect); ChangeActorSect(pActor, PlayerList[nPlayer].pPlayerViewSect);
pActor->set_int_pos(pPlayerActor->spr.pos); pActor->set_int_pos(pPlayerActor->int_pos());
if (nAngle < 0) { if (nAngle < 0) {
nAngle = pPlayerActor->spr.ang; nAngle = pPlayerActor->spr.ang;
@ -102,7 +102,7 @@ void BuildGrenade(int nPlayer)
auto pPlayerActor = PlayerList[nPlayer].pActor; 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.shade = -64;
pActor->spr.xrepeat = 20; pActor->spr.xrepeat = 20;
pActor->spr.yrepeat = 20; pActor->spr.yrepeat = 20;
@ -152,7 +152,7 @@ void ExplodeGrenade(DExhumedActor* pActor)
} }
else else
{ {
if (pActor->spr.pos.Z < pGrenadeSect->floorz) if (pActor->int_pos().Z < pGrenadeSect->floorz)
{ {
var_20 = 200; var_20 = 200;
var_28 = 36; var_28 = 36;
@ -173,7 +173,7 @@ void ExplodeGrenade(DExhumedActor* pActor)
auto pPlayerActor = PlayerList[nPlayer].pActor; auto pPlayerActor = PlayerList[nPlayer].pActor;
int nAngle = pPlayerActor->spr.ang; 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()); ChangeActorSect(pActor, pPlayerActor->sector());
@ -190,8 +190,8 @@ void ExplodeGrenade(DExhumedActor* pActor)
runlist_RadialDamageEnemy(pActor, nDamage, BulletInfo[kWeaponGrenade].nRadius); 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); 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->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);
DestroyGrenade(pActor); DestroyGrenade(pActor);
} }

View file

@ -614,9 +614,9 @@ loc_flag:
BuildFlash(nPlayer, 512); BuildFlash(nPlayer, 512);
AddFlash( AddFlash(
pPlayerActor->sector(), pPlayerActor->sector(),
pPlayerActor->spr.pos.X, pPlayerActor->int_pos().X,
pPlayerActor->spr.pos.Y, pPlayerActor->int_pos().Y,
pPlayerActor->spr.pos.Z, pPlayerActor->int_pos().Z,
0); 0);
} }
@ -648,9 +648,9 @@ loc_flag:
int nAmmoType = WeaponInfo[nWeapon].nAmmoType; int nAmmoType = WeaponInfo[nWeapon].nAmmoType;
int nAngle = pPlayerActor->spr.ang; int nAngle = pPlayerActor->spr.ang;
int theX = pPlayerActor->spr.pos.X; int theX = pPlayerActor->int_pos().X;
int theY = pPlayerActor->spr.pos.Y; int theY = pPlayerActor->int_pos().Y;
int theZ = pPlayerActor->spr.pos.Z; int theZ = pPlayerActor->int_pos().Z;
int ebp = bcos(nAngle) * (pPlayerActor->spr.clipdist << 3); int ebp = bcos(nAngle) * (pPlayerActor->spr.clipdist << 3);
int ebx = bsin(nAngle) * (pPlayerActor->spr.clipdist << 3); int ebx = bsin(nAngle) * (pPlayerActor->spr.clipdist << 3);
@ -808,7 +808,7 @@ loc_flag:
DExhumedActor* t = sPlayerInput[nPlayer].pTarget; DExhumedActor* t = sPlayerInput[nPlayer].pTarget;
// only autoaim if target is in front of the player. // only autoaim if target is in front of the player.
assert(t->sector()); 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; int anglediff = (pPlayerActor->spr.ang - angletotarget) & 2047;
if (anglediff < 512 || anglediff > 1536) if (anglediff < 512 || anglediff > 1536)
{ {

View file

@ -123,7 +123,7 @@ void BuildItemAnim(DExhumedActor* pActor)
if (nItemAnimInfo[nItem].a >= 0) 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) { if (nItem == 44) {
pAnimActor->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT; pAnimActor->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT;
@ -338,16 +338,16 @@ void DropMagic(DExhumedActor* pActor)
nullptr, nullptr,
64, 64,
0, 0,
pActor->spr.pos.X, pActor->int_pos().X,
pActor->spr.pos.Y, pActor->int_pos().Y,
pActor->spr.pos.Z, pActor->int_pos().Z,
pActor->sector(), pActor->sector(),
48, 48,
4); 4);
if (pAnimActor) 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); ChangeActorStat(pAnimActor, 950);
} }
nMagicCount = RandomSize(2); nMagicCount = RandomSize(2);
@ -401,7 +401,7 @@ void DoRegenerates()
if (pActor->spr.extra <= 0) 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); D3PlayFX(StaticSound[kSoundTorchOn], pActor);
} }
else { else {

View file

@ -41,7 +41,7 @@ DExhumedActor* BuildLavaLimb(DExhumedActor* pActor, int move, int ebx)
{ {
auto pLimbActor = insertActor(pActor->sector(), 118); 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.cstat = 0;
pLimbActor->spr.shade = -127; pLimbActor->spr.shade = -127;
pLimbActor->spr.pal = 1; pLimbActor->spr.pal = 1;
@ -107,8 +107,8 @@ void BuildLava(DExhumedActor* pActor, int x, int y, int, sectortype* pSector, in
{ {
pSector = pActor->sector(); pSector = pActor->sector();
nAngle = pActor->spr.ang; nAngle = pActor->spr.ang;
x = pActor->spr.pos.X; x = pActor->int_pos().X;
y = pActor->spr.pos.Y; y = pActor->int_pos().Y;
ChangeActorStat(pActor, 118); ChangeActorStat(pActor, 118);
} }
@ -278,9 +278,9 @@ void AILavaDude::Tick(RunListEvent* ev)
} }
} }
int x = pActor->spr.pos.X; int x = pActor->int_pos().X;
int y = pActor->spr.pos.Y; int y = pActor->int_pos().Y;
int z = pActor->spr.pos.Z; int z = pActor->int_pos().Z;
auto pSector =pActor->sector(); auto pSector =pActor->sector();
auto coll = movesprite(pActor, pActor->spr.xvel << 8, pActor->spr.yvel << 8, 0, 0, 0, CLIPMASK0); 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) 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) if (AngleDiff(pActor->spr.ang, nAng) < 64)
{ {
pActor->nAction = 2; pActor->nAction = 2;

View file

@ -353,12 +353,12 @@ void AddFlash(sectortype* pSector, int x, int y, int z, int val)
if (!var_18) if (!var_18)
{ {
int xDiff = x - pActor->spr.pos.X; int xDiff = x - pActor->int_pos().X;
if (xDiff < 0) { if (xDiff < 0) {
xDiff = -xDiff; xDiff = -xDiff;
} }
int yDiff = y - pActor->spr.pos.Y; int yDiff = y - pActor->int_pos().Y;
if (yDiff < 0) { if (yDiff < 0) {
yDiff = -yDiff; yDiff = -yDiff;
} }

View file

@ -50,8 +50,8 @@ void BuildLion(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
else else
{ {
ChangeActorStat(pActor, 104); ChangeActorStat(pActor, 104);
x = pActor->spr.pos.X; x = pActor->int_pos().X;
y = pActor->spr.pos.Y; y = pActor->int_pos().Y;
z = pActor->sector()->floorz; z = pActor->sector()->floorz;
nAngle = pActor->spr.ang; nAngle = pActor->spr.ang;
} }
@ -311,7 +311,7 @@ void AILion::Tick(RunListEvent* ev)
} }
else 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) if (AngleDiff(pActor->spr.ang, nAng) < 64)
{ {
@ -382,9 +382,9 @@ void AILion::Tick(RunListEvent* ev)
pActor->spr.zvel = -4000; pActor->spr.zvel = -4000;
pActor->nCount = 0; pActor->nCount = 0;
int x = pActor->spr.pos.X; int x = pActor->int_pos().X;
int y = pActor->spr.pos.Y; int y = pActor->int_pos().Y;
int z = pActor->spr.pos.Z - (GetActorHeight(pActor) >> 1); int z = pActor->int_pos().Z - (GetActorHeight(pActor) >> 1);
int nCheckDist = 0x7FFFFFFF; int nCheckDist = 0x7FFFFFFF;
@ -444,7 +444,7 @@ void AILion::Tick(RunListEvent* ev)
{ {
if (nMov.actor() == pTarget) 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) if (AngleDiff(pActor->spr.ang, nAng) < 64)
{ {
pActor->nAction = 3; pActor->nAction = 3;

View file

@ -59,7 +59,7 @@ void DrawMap(double const smoothratio)
void GetActorExtents(DExhumedActor* actor, int* top, int* bottom) 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) if ((actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_FLOOR)
{ {
int height = tileHeight(actor->spr.picnum); 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 nTile = pPlayerActor->spr.picnum;
int ceilZ, floorZ; int ceilZ, floorZ;
Collision ceilHit, floorHit; 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; int nTop, nBottom;
GetActorExtents(pPlayerActor, &nTop, &nBottom); GetActorExtents(pPlayerActor, &nTop, &nBottom);
int nScale = (pPlayerActor->spr.yrepeat + ((floorZ - nBottom) >> 8)) * z; int nScale = (pPlayerActor->spr.yrepeat + ((floorZ - nBottom) >> 8)) * z;

View file

@ -240,13 +240,13 @@ void clipwall()
int BelowNear(DExhumedActor* pActor, int x, int y, int walldist) int BelowNear(DExhumedActor* pActor, int x, int y, int walldist)
{ {
auto pSector = pActor->sector(); auto pSector = pActor->sector();
int z = pActor->spr.pos.Z; int z = pActor->int_pos().Z;
int z2; int z2;
if (loHit.type == kHitSprite) if (loHit.type == kHitSprite)
{ {
z2 = loHit.actor()->spr.pos.Z; z2 = loHit.actor()->int_pos().Z;
} }
else 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); pActor->set_int_z(z2);
overridesect = pSector; overridesect = pSector;
@ -330,7 +330,7 @@ Collision movespritez(DExhumedActor* pActor, int z, int height, int, int clipdis
z >>= 1; z >>= 1;
} }
int spriteZ = pActor->spr.pos.Z; int spriteZ = pActor->int_pos().Z;
int floorZ = pSector->floorz; int floorZ = pSector->floorz;
int ebp = spriteZ + z; 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 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. // 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; pos.Z -= 256;
getzrange(pos, pActor->sector(), &sprceiling, hiHit, &sprfloor, loHit, 128, CLIPMASK0); 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) 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; return nRet;
@ -491,9 +491,9 @@ Collision movesprite(DExhumedActor* pActor, int dx, int dy, int dz, int ceildist
{ {
bTouchFloor = false; bTouchFloor = false;
int x = pActor->spr.pos.X; int x = pActor->int_pos().X;
int y = pActor->spr.pos.Y; int y = pActor->int_pos().Y;
int z = pActor->spr.pos.Z; int z = pActor->int_pos().Z;
int nSpriteHeight = GetActorHeight(pActor); int nSpriteHeight = GetActorHeight(pActor);
@ -521,7 +521,7 @@ Collision movesprite(DExhumedActor* pActor, int dx, int dy, int dz, int ceildist
int varA = 0; int varA = 0;
int varB = 0; int varB = 0;
CheckSectorFloor(overridesect, pActor->spr.pos.Z, &varB, &varA); CheckSectorFloor(overridesect, pActor->int_pos().Z, &varB, &varA);
if (varB || varA) if (varB || varA)
{ {
@ -534,11 +534,11 @@ Collision movesprite(DExhumedActor* pActor, int dx, int dy, int dz, int ceildist
} }
else else
{ {
CheckSectorFloor(overridesect, pActor->spr.pos.Z, &dx, &dy); CheckSectorFloor(overridesect, pActor->int_pos().Z, &dx, &dy);
} }
Collision coll; Collision coll;
auto pos = pActor->spr.pos; auto pos = pActor->int_pos();
clipmove(pos, &pSector, dx, dy, nClipDist, nSpriteHeight, flordist, clipmask, coll); clipmove(pos, &pSector, dx, dy, nClipDist, nSpriteHeight, flordist, clipmask, coll);
pActor->set_int_pos(pos); 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. 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) Collision MoveCreatureWithCaution(DExhumedActor* pActor)
{ {
int x = pActor->spr.pos.X; int x = pActor->int_pos().X;
int y = pActor->spr.pos.Y; int y = pActor->int_pos().Y;
int z = pActor->spr.pos.Z; int z = pActor->int_pos().Z;
auto pSectorPre = pActor->sector(); auto pSectorPre = pActor->sector();
auto ecx = MoveCreature(pActor); auto ecx = MoveCreature(pActor);
@ -661,7 +661,7 @@ int GetAngleToSprite(DExhumedActor* a1, DExhumedActor* a2)
if (!a1 || !a2) if (!a1 || !a2)
return -1; 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) int PlotCourseToSprite(DExhumedActor* pActor1, DExhumedActor* pActor2)
@ -669,8 +669,8 @@ int PlotCourseToSprite(DExhumedActor* pActor1, DExhumedActor* pActor2)
if (pActor1 == nullptr || pActor2 == nullptr) if (pActor1 == nullptr || pActor2 == nullptr)
return -1; return -1;
int x = pActor2->spr.pos.X - pActor1->spr.pos.X; int x = pActor2->int_pos().X - pActor1->int_pos().X;
int y = pActor2->spr.pos.Y - pActor1->spr.pos.Y; int y = pActor2->int_pos().Y - pActor1->int_pos().Y;
pActor1->spr.ang = GetMyAngle(x, y); pActor1->spr.ang = GetMyAngle(x, y);
@ -695,11 +695,11 @@ DExhumedActor* FindPlayer(DExhumedActor* pActor, int nDistance, bool dontengage)
if (nDistance < 0) if (nDistance < 0)
nDistance = 100; nDistance = 100;
int x = pActor->spr.pos.X; int x = pActor->int_pos().X;
int y = pActor->spr.pos.Y; int y = pActor->int_pos().Y;
auto pSector =pActor->sector(); auto pSector =pActor->sector();
int z = pActor->spr.pos.Z - GetActorHeight(pActor); int z = pActor->int_pos().Z - GetActorHeight(pActor);
nDistance <<= 8; 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))) 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) 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; 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 GetUpAngle(DExhumedActor* pActor1, int nVal, DExhumedActor* pActor2, int ecx)
{ {
int x = pActor2->spr.pos.X - pActor1->spr.pos.X; int x = pActor2->int_pos().X - pActor1->int_pos().X;
int y = pActor2->spr.pos.Y - pActor1->spr.pos.Y; int y = pActor2->int_pos().Y - pActor1->int_pos().Y;
int ebx = (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->spr.pos.Z + ecx) - (pActor1->spr.pos.Z + nVal); int edx = (pActor2->int_pos().Z + ecx) - (pActor1->int_pos().Z + nVal);
ebx >>= 4; ebx >>= 4;
edx >>= 8; edx >>= 8;
@ -981,12 +981,12 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel)
} }
else 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) if ((nSectFlag & kSectUnderwater) || pos.Z != nZVal || pActor->spr.cstat & CSTAT_SPRITE_INVISIBLE)
{ {
pos.X = pActor->spr.pos.X; pos.X = pActor->int_pos().X;
pos.Y = pActor->spr.pos.Y; pos.Y = pActor->int_pos().Y;
pSectorB = pSector; pSectorB = pSector;
clipmove(pos, &pSectorB, -xvect, -yvect, 4 * pActor->spr.clipdist, 0, 0, CLIPMASK0, scratch); 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) if (pActor->spr.statnum >= 99)
{ {
pos = pActor->spr.pos; pos = pActor->int_pos();
pSectorB = pNextSector; pSectorB = pNextSector;
clipmove(pos, &pSectorB, 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 != pNextSector && (pSectorB == pSector || pNextSector == pSector))
{ {
if (pSectorB != pSector || nFloorZ >= pActor->spr.pos.Z) if (pSectorB != pSector || nFloorZ >= pActor->int_pos().Z)
{ {
if (pSectorB) { if (pSectorB) {
ChangeActorSect(pActor, pSectorB); ChangeActorSect(pActor, pSectorB);
@ -1048,10 +1048,10 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel)
ExhumedSectIterator it(pSector); ExhumedSectIterator it(pSector);
while (auto pActor = it.Next()) 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; 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); clipmove(lpos, &pSectorB, xvect, yvect, 4 * pActor->spr.clipdist, 5120, -5120, CLIPMASK0, scratch);
pActor->set_int_pos(lpos); 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? TODO: Might need to be done elsewhere too?
*/ */
auto pActor = PlayerList[nLocalPlayer].pActor; auto pActor = PlayerList[nLocalPlayer].pActor;
initx = pActor->spr.pos.X; initx = pActor->int_pos().X;
inity = pActor->spr.pos.Y; inity = pActor->int_pos().Y;
initz = pActor->spr.pos.Z; initz = pActor->int_pos().Z;
inita = pActor->spr.ang; inita = pActor->spr.ang;
initsectp = pActor->sector(); initsectp = pActor->sector();
} }
void SetQuake(DExhumedActor* pActor, int nVal) void SetQuake(DExhumedActor* pActor, int nVal)
{ {
int x = pActor->spr.pos.X; int x = pActor->int_pos().X;
int y = pActor->spr.pos.Y; int y = pActor->int_pos().Y;
nVal *= 256; nVal *= 256;
@ -1095,8 +1095,8 @@ void SetQuake(DExhumedActor* pActor, int nVal)
auto pPlayerActor = PlayerList[i].pActor; auto pPlayerActor = PlayerList[i].pActor;
uint32_t xDiff = abs((int32_t)((pPlayerActor->spr.pos.X - x) >> 8)); uint32_t xDiff = abs((int32_t)((pPlayerActor->int_pos().X - x) >> 8));
uint32_t yDiff = abs((int32_t)((pPlayerActor->spr.pos.Y - y) >> 8)); uint32_t yDiff = abs((int32_t)((pPlayerActor->int_pos().Y - y) >> 8));
uint32_t sqrtNum = xDiff * xDiff + yDiff * yDiff; 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 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 xDiff = abs(pActor2->int_pos().X - pActor->int_pos().X);
uint32_t yDiff = abs(pActor2->spr.pos.Y - pActor->spr.pos.Y); uint32_t yDiff = abs(pActor2->int_pos().Y - pActor->int_pos().Y);
uint32_t sqrtNum = xDiff * xDiff + yDiff * yDiff; 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 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 nAngDelta = AngleDelta(pActor->spr.ang, nMyAngle, 1024);
int nAngDelta2 = abs(nAngDelta); int nAngDelta2 = abs(nAngDelta);
@ -1239,7 +1239,7 @@ void WheresMyMouth(int nPlayer, vec3_t* pos, sectortype **sectnum)
int height = GetActorHeight(pActor) >> 1; int height = GetActorHeight(pActor) >> 1;
*sectnum = pActor->sector(); *sectnum = pActor->sector();
*pos = pActor->spr.pos; *pos = pActor->int_pos();
pos->Z -= height; pos->Z -= height;
Collision scratch; Collision scratch;
@ -1355,7 +1355,7 @@ DExhumedActor* BuildCreatureChunk(DExhumedActor* pSrc, int nPic, bool bSpecial)
if (pActor == nullptr) { if (pActor == nullptr) {
return nullptr; return nullptr;
} }
pActor->set_int_pos(pSrc->spr.pos); pActor->set_int_pos(pSrc->int_pos());
ChangeActorSect(pActor, pSrc->sector()); 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); 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. // 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(); pSector = pActor->sector();

View file

@ -45,9 +45,9 @@ void BuildMummy(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
} }
else else
{ {
x = pActor->spr.pos.X; x = pActor->int_pos().X;
y = pActor->spr.pos.Y; y = pActor->int_pos().Y;
z = pActor->spr.pos.Z; z = pActor->int_pos().Z;
nAngle = pActor->spr.ang; nAngle = pActor->spr.ang;
ChangeActorStat(pActor, 102); ChangeActorStat(pActor, 102);
@ -97,13 +97,13 @@ void CheckMummyRevive(DExhumedActor* pActor)
if (pOther->nAction != 5) { if (pOther->nAction != 5) {
continue; continue;
} }
int x = abs(pOther->spr.pos.X - pActor->spr.pos.X) >> 8; int x = abs(pOther->int_pos().X - pActor->int_pos().X) >> 8;
int y = abs(pOther->spr.pos.Y - pActor->spr.pos.Y) >> 8; int y = abs(pOther->int_pos().Y - pActor->int_pos().Y) >> 8;
if (x <= 20 && y <= 20) if (x <= 20 && y <= 20)
{ {
if (cansee(pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z - 8192, pActor->sector(), if (cansee(pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z - 8192, pActor->sector(),
pOther->spr.pos.X, pOther->spr.pos.Y, pOther->spr.pos.Z - 8192, pOther->sector())) pOther->int_pos().X, pOther->int_pos().Y, pOther->int_pos().Z - 8192, pOther->sector()))
{ {
pOther->spr.cstat = 0; pOther->spr.cstat = 0;
pOther->nAction = 6; pOther->nAction = 6;
@ -206,8 +206,8 @@ void AIMummy::Tick(RunListEvent* ev)
{ {
if (RandomBit() && pTarget) if (RandomBit() && pTarget)
{ {
if (cansee(pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z - GetActorHeight(pActor), pActor->sector(), if (cansee(pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z - GetActorHeight(pActor), pActor->sector(),
pTarget->spr.pos.X, pTarget->spr.pos.Y, pTarget->spr.pos.Z - GetActorHeight(pTarget), pTarget->sector())) pTarget->int_pos().X, pTarget->int_pos().Y, pTarget->int_pos().Z - GetActorHeight(pTarget), pTarget->sector()))
{ {
pActor->nAction = 3; pActor->nAction = 3;
pActor->nFrame = 0; pActor->nFrame = 0;
@ -274,7 +274,7 @@ void AIMummy::Tick(RunListEvent* ev)
{ {
if (nMov.actor() == pTarget) 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) if (AngleDiff(pActor->spr.ang, nAngle) < 64)
{ {
pActor->nAction = 2; pActor->nAction = 2;

View file

@ -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)) 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 var_28 = actor->int_pos().X;
int ebx = actor->spr.pos.Y; int ebx = actor->int_pos().Y;
if ((var_28 >= var_24) && (esi >= var_28) && (ebx >= ecx) && (ebx <= edi)) 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) if (pActor->spr.statnum == 100 && PlayerList[GetPlayerFromActor(pActor)].nHealth <= 0)
{ {
PlayFXAtXYZ(StaticSound[kSoundJonFDie], PlayFXAtXYZ(StaticSound[kSoundJonFDie],
pActor->spr.pos.X, pActor->int_pos().X,
pActor->spr.pos.Y, pActor->int_pos().Y,
pActor->spr.pos.Z, pActor->int_pos().Z,
CHANF_NONE, 0x4000); CHANF_NONE, 0x4000);
} }
} }
@ -639,7 +639,7 @@ void MoveSectorSprites(sectortype* pSector, int z)
ExhumedSectIterator it(pSector); ExhumedSectIterator it(pSector);
while (auto pActor = it.Next()) 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) if ((pActor->spr.statnum != 200 && actz >= minz && actz <= maxz) || pActor->spr.statnum >= 900)
{ {
pActor->set_int_z(newz); pActor->set_int_z(newz);
@ -834,7 +834,7 @@ void AIElev::Tick(RunListEvent* ev)
SetQuake(pElevSpr, 30); 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) if (var_18 & 0x4)
@ -1353,7 +1353,7 @@ DExhumedActor* BuildSpark(DExhumedActor* pActor, int nVal)
{ {
auto pSpark = insertActor(pActor->sector(), 0); 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.cstat = 0;
pSpark->spr.shade = -127; pSpark->spr.shade = -127;
pSpark->spr.pal = 1; pSpark->spr.pal = 1;
@ -1397,7 +1397,7 @@ DExhumedActor* BuildSpark(DExhumedActor* pActor, int nVal)
pSpark->spr.picnum = kTile985 + 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.lotag = runlist_HeadRun() + 1;
pSpark->spr.clipdist = 1; pSpark->spr.clipdist = 1;
pSpark->spr.hitag = 0; pSpark->spr.hitag = 0;
@ -1581,7 +1581,7 @@ DExhumedActor* BuildEnergyBlock(sectortype* pSector)
pActor->set_int_z(pSector->firstWall()->nextSector()->floorz); pActor->set_int_z(pSector->firstWall()->nextSector()->floorz);
// CHECKME - name of this variable? // 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) { if (nRepeat > 255) {
nRepeat = 255; nRepeat = 255;
} }
@ -1656,9 +1656,9 @@ void ExplodeEnergyBlock(DExhumedActor* pActor)
pSector->floorshade = 50; pSector->floorshade = 50;
pSector->extra = -1; 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); BuildSpark(pActor, 3);
@ -1765,7 +1765,7 @@ void AIEnergyBlock::RadialDamage(RunListEvent* ev)
int nFloorZ = pSector->floorz; int nFloorZ = pSector->floorz;
pSector->setfloorz(pActor->spr.pos.Z); pSector->setfloorz(pActor->int_pos().Z);
pActor->add_int_z(-256); pActor->add_int_z(-256);
ev->nDamage = runlist_CheckRadialDamage(pActor); ev->nDamage = runlist_CheckRadialDamage(pActor);
@ -1824,7 +1824,7 @@ DExhumedActor* BuildObject(DExhumedActor* pActor, int nOjectType, int nHitag)
pActor->nIndex2 = -1; pActor->nIndex2 = -1;
pActor2->spr.cstat = CSTAT_SPRITE_INVISIBLE; pActor2->spr.cstat = CSTAT_SPRITE_INVISIBLE;
pActor2->set_int_pos(pActor->spr.pos); pActor2->set_int_pos(pActor->int_pos());
} }
else else
{ {
@ -1919,7 +1919,7 @@ void AIObject::Tick(RunListEvent* ev)
int var_18; int var_18;
// red branch // 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; var_18 = 36;
} }
@ -1928,8 +1928,8 @@ void AIObject::Tick(RunListEvent* ev)
var_18 = 34; var_18 = 34;
} }
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);
BuildAnim(nullptr, var_18, 0, pActor->spr.pos.X, pActor->spr.pos.Y, pActor->sector()->floorz, pActor->sector(), 240, 4); BuildAnim(nullptr, var_18, 0, pActor->int_pos().X, pActor->int_pos().Y, pActor->sector()->floorz, pActor->sector(), 240, 4);
// int edi = nSprite | 0x4000; // int edi = nSprite | 0x4000;
@ -1961,7 +1961,7 @@ void AIObject::Tick(RunListEvent* ev)
StartRegenerate(pActor); StartRegenerate(pActor);
pActor->nHealth = 120; pActor->nHealth = 120;
pActor->set_int_pos(pActor->pTarget->spr.pos); pActor->set_int_pos(pActor->pTarget->int_pos());
ChangeActorSect(pActor, pActor->pTarget->sector()); ChangeActorSect(pActor, pActor->pTarget->sector());
return; return;
} }
@ -2210,8 +2210,8 @@ void ProcessTrailSprite(DExhumedActor* pActor, int nLotag, int nHitag)
{ {
auto nPoint = sTrailPoint.Reserve(1); auto nPoint = sTrailPoint.Reserve(1);
sTrailPoint[nPoint].x = pActor->spr.pos.X; sTrailPoint[nPoint].x = pActor->int_pos().X;
sTrailPoint[nPoint].y = pActor->spr.pos.Y; sTrailPoint[nPoint].y = pActor->int_pos().Y;
int nTrail = FindTrail(nHitag); int nTrail = FindTrail(nHitag);

View file

@ -38,7 +38,7 @@ void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz)
Player *nPlayer = &PlayerList[nLocalPlayer]; Player *nPlayer = &PlayerList[nLocalPlayer];
nPlayer->pActor->set_int_pos({ x, y, z }); 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) if (ang != INT_MIN)
{ {

View file

@ -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)) if (nStat >= 900 && !(pActor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
{ {
uint32_t xDiff = abs(pActor->spr.pos.X - x); uint32_t xDiff = abs(pActor->int_pos().X - x);
uint32_t yDiff = abs(pActor->spr.pos.Y - y); uint32_t yDiff = abs(pActor->int_pos().Y - y);
int zDiff = pActor->spr.pos.Z - z; int zDiff = pActor->int_pos().Z - z;
if (zDiff < 5120 && zDiff > -25600) if (zDiff < 5120 && zDiff > -25600)
{ {
@ -263,14 +263,14 @@ void RestartPlayer(int nPlayer)
nCurStartSprite = 0; nCurStartSprite = 0;
} }
pActor->set_int_pos(nNStartSprite->spr.pos); pActor->set_int_pos(nNStartSprite->int_pos());
ChangeActorSect(pActor, nNStartSprite->sector()); ChangeActorSect(pActor, nNStartSprite->sector());
plr->angle.ang = buildang(nNStartSprite->spr.ang&kAngleMask); plr->angle.ang = buildang(nNStartSprite->spr.ang&kAngleMask);
pActor->spr.ang = plr->angle.ang.asbuild(); pActor->spr.ang = plr->angle.ang.asbuild();
floorsprt = insertActor(pActor->sector(), 0); 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.yrepeat = 64;
floorsprt->spr.xrepeat = 64; floorsprt->spr.xrepeat = 64;
floorsprt->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR; floorsprt->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR;
@ -311,7 +311,7 @@ void RestartPlayer(int nPlayer)
pActor->spr.extra = -1; pActor->spr.extra = -1;
pActor->spr.lotag = runlist_HeadRun() + 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.xrepeat = pActor->spr.xrepeat;
pDActor->spr.yrepeat = pActor->spr.yrepeat; pDActor->spr.yrepeat = pActor->spr.yrepeat;
pDActor->spr.xoffset = 0; pDActor->spr.xoffset = 0;
@ -454,7 +454,7 @@ void StartDeathSeq(int nPlayer, int nVal)
auto pGunActor = GrabBodyGunSprite(); auto pGunActor = GrabBodyGunSprite();
ChangeActorSect(pGunActor, pSector); 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); ChangeActorStat(pGunActor, nGunLotag[nWeapon] + 900);
@ -773,9 +773,9 @@ void AIPlayer::Tick(RunListEvent* ev)
{ {
nFlashDepth = 5; nFlashDepth = 5;
AddFlash(pPlayerActor->sector(), AddFlash(pPlayerActor->sector(),
pPlayerActor->spr.pos.X, pPlayerActor->int_pos().X,
pPlayerActor->spr.pos.Y, pPlayerActor->int_pos().Y,
pPlayerActor->spr.pos.Z, 0); pPlayerActor->int_pos().Z, 0);
} }
} }
} }
@ -847,8 +847,8 @@ void AIPlayer::Tick(RunListEvent* ev)
auto pSector = pPlayerActor->sector(); auto pSector = pPlayerActor->sector();
int nSectFlag = PlayerList[nPlayer].pPlayerViewSect->Flag; int nSectFlag = PlayerList[nPlayer].pPlayerViewSect->Flag;
int playerX = pPlayerActor->spr.pos.X; int playerX = pPlayerActor->int_pos().X;
int playerY = pPlayerActor->spr.pos.Y; int playerY = pPlayerActor->int_pos().Y;
int x = (sPlayerInput[nPlayer].xVel * 4) >> 2; int x = (sPlayerInput[nPlayer].xVel * 4) >> 2;
int y = (sPlayerInput[nPlayer].yVel * 4) >> 2; int y = (sPlayerInput[nPlayer].yVel * 4) >> 2;
@ -863,9 +863,9 @@ void AIPlayer::Tick(RunListEvent* ev)
y /= 2; y /= 2;
} }
int spr_x = pPlayerActor->spr.pos.X; int spr_x = pPlayerActor->int_pos().X;
int spr_y = pPlayerActor->spr.pos.Y; int spr_y = pPlayerActor->int_pos().Y;
int spr_z = pPlayerActor->spr.pos.Z; int spr_z = pPlayerActor->int_pos().Z;
auto spr_sect = pPlayerActor->sector(); auto spr_sect = pPlayerActor->sector();
// TODO // TODO
@ -879,7 +879,7 @@ void AIPlayer::Tick(RunListEvent* ev)
{ {
pPlayerActor->add_int_pos({ (x >> 14), (y >> 14), 0 }); pPlayerActor->add_int_pos({ (x >> 14), (y >> 14), 0 });
vec3_t pos = pPlayerActor->spr.pos; vec3_t pos = pPlayerActor->int_pos();
SetActor(pPlayerActor, &pos); SetActor(pPlayerActor, &pos);
pPlayerActor->set_int_z(pPlayerActor->sector()->floorz); pPlayerActor->set_int_z(pPlayerActor->sector()->floorz);
@ -897,7 +897,7 @@ void AIPlayer::Tick(RunListEvent* ev)
} }
// loc_1A6E4 // 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); ChangeActorSect(pPlayerActor, spr_sect);
@ -988,7 +988,7 @@ void AIPlayer::Tick(RunListEvent* ev)
pPlayerActor->spr.yvel = 0; pPlayerActor->spr.yvel = 0;
StopActorSound(pPlayerActor); 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 else
{ {
@ -1070,11 +1070,11 @@ void AIPlayer::Tick(RunListEvent* ev)
sectdone: sectdone:
if (!PlayerList[nPlayer].bPlayerPan && !PlayerList[nPlayer].bLockPan) 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; playerX -= pPlayerActor->int_pos().X;
playerY -= pPlayerActor->spr.pos.Y; playerY -= pPlayerActor->int_pos().Y;
uint32_t sqrtNum = playerX * playerX + playerY * playerY; uint32_t sqrtNum = playerX * playerX + playerY * playerY;
@ -1089,7 +1089,7 @@ sectdone:
auto pViewSect = pPlayerActor->sector(); 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) while (1)
{ {
@ -1111,9 +1111,9 @@ sectdone:
{ {
if (nMove.type == kHitWall) if (nMove.type == kHitWall)
{ {
int var_C4 = pPlayerActor->spr.pos.X; int var_C4 = pPlayerActor->int_pos().X;
int var_D4 = pPlayerActor->spr.pos.Y; int var_D4 = pPlayerActor->int_pos().Y;
int var_C8 = pPlayerActor->spr.pos.Z; int var_C8 = pPlayerActor->int_pos().Z;
ChangeActorSect(pPlayerActor, pViewSect); ChangeActorSect(pPlayerActor, pViewSect);
@ -1140,8 +1140,8 @@ sectdone:
// loc_1ADAF // loc_1ADAF
PlayerList[nPlayer].pPlayerViewSect = pViewSect; PlayerList[nPlayer].pPlayerViewSect = pViewSect;
PlayerList[nPlayer].nPlayerD.X = pPlayerActor->spr.pos.X - spr_x; PlayerList[nPlayer].nPlayerD.X = pPlayerActor->int_pos().X - spr_x;
PlayerList[nPlayer].nPlayerD.Y = pPlayerActor->spr.pos.Y - spr_y; PlayerList[nPlayer].nPlayerD.Y = pPlayerActor->int_pos().Y - spr_y;
int var_5C = pViewSect->Flag & kSectUnderwater; int var_5C = pViewSect->Flag & kSectUnderwater;
@ -1223,7 +1223,7 @@ sectdone:
{ {
auto pTmpSect = pPlayerActor->sector(); 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) if (pTmpSect->Depth && !pTmpSect->Speed && !pTmpSect->Damage)
{ {
@ -1258,7 +1258,7 @@ sectdone:
DExhumedActor* pFloorActor = PlayerList[nPlayer].pPlayerFloorSprite; DExhumedActor* pFloorActor = PlayerList[nPlayer].pPlayerFloorSprite;
if (nTotalPlayers > 1 && pFloorActor) 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()) if (pFloorActor->sector() != pPlayerActor->sector())
{ {
@ -1284,10 +1284,10 @@ sectdone:
HitInfo near; HitInfo near;
// neartag finds the nearest sector, wall, and sprite which has its hitag and/or lotag set to a value. // 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; 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 // Item pickup code
if (pActorB != nullptr && pActorB->spr.statnum >= 900) if (pActorB != nullptr && pActorB->spr.statnum >= 900)
@ -2182,7 +2182,7 @@ sectdone:
ChangeActorStat(pActorB, 899); 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; break;
} }
@ -2500,7 +2500,7 @@ sectdone:
case 16: case 16:
PlayerList[nPlayer].nSeqSize = SeqSize[var_AC] - 1; 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); pPlayerActor->add_int_z(256);
} }
@ -2510,7 +2510,7 @@ sectdone:
sectortype* mouthSect; sectortype* mouthSect;
WheresMyMouth(nPlayer, &pos, &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; break;
case 17: case 17:
@ -2526,9 +2526,9 @@ sectdone:
// loc_1C3B4: // loc_1C3B4:
if (nPlayer == nLocalPlayer) if (nPlayer == nLocalPlayer)
{ {
initx = pPlayerActor->spr.pos.X; initx = pPlayerActor->int_pos().X;
inity = pPlayerActor->spr.pos.Y; inity = pPlayerActor->int_pos().Y;
initz = pPlayerActor->spr.pos.Z; initz = pPlayerActor->int_pos().Z;
initsectp = pPlayerActor->sector(); initsectp = pPlayerActor->sector();
inita = pPlayerActor->spr.ang; inita = pPlayerActor->spr.ang;
} }
@ -2572,7 +2572,7 @@ sectdone:
} }
// loc_1C4E1 // loc_1C4E1
pDopple->set_int_pos(pPlayerActor->spr.pos); pDopple->set_int_pos(pPlayerActor->int_pos());
if (pPlayerActor->sector()->pAbove != nullptr) if (pPlayerActor->sector()->pAbove != nullptr)
{ {

View file

@ -249,7 +249,7 @@ void DestroyEgg(int nEgg)
if (QueenEgg[nEgg].nAction != 4) 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 else
{ {
@ -301,12 +301,12 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int val
{ {
int nTileY = (tileHeight(pActor2->spr.picnum) * pActor2->spr.yrepeat) * 2; 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 xDiff = abs(pActor2->int_pos().X - pActor->int_pos().X);
uint32_t yDiff = abs(pActor2->spr.pos.Y - pActor->spr.pos.Y); uint32_t yDiff = abs(pActor2->int_pos().Y - pActor->int_pos().Y);
uint32_t sqrtVal = xDiff * xDiff + yDiff * yDiff; uint32_t sqrtVal = xDiff * xDiff + yDiff * yDiff;
@ -392,9 +392,9 @@ void BuildTail()
{ {
auto head = QueenHead.pActor; auto head = QueenHead.pActor;
int x = head->spr.pos.X; int x = head->int_pos().X;
int y = head->spr.pos.Y; int y = head->int_pos().Y;
int z = head->spr.pos.Z; int z = head->int_pos().Z;
auto pSector =head->sector(); auto pSector =head->sector();
int i; int i;
@ -444,8 +444,8 @@ void BuildQueenEgg(int nQueen, int nVal)
DExhumedActor* pActor = QueenList[nQueen].pActor; DExhumedActor* pActor = QueenList[nQueen].pActor;
if (!pActor) return; if (!pActor) return;
int x = pActor->spr.pos.X; int x = pActor->int_pos().X;
int y = pActor->spr.pos.Y; int y = pActor->int_pos().Y;
auto pSector =pActor->sector(); auto pSector =pActor->sector();
int nFloorZ = pSector->floorz; int nFloorZ = pSector->floorz;
int nAngle = pActor->spr.ang; int nAngle = pActor->spr.ang;
@ -651,8 +651,8 @@ void AIQueenEgg::Tick(RunListEvent* ev)
pEgg->nCounter--; pEgg->nCounter--;
if (pEgg->nCounter <= 0) 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); 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->spr.pos.Z); pActor->set_int_z(pWaspSprite->int_pos().Z);
DestroyEgg(nEgg); DestroyEgg(nEgg);
} }
@ -702,8 +702,8 @@ void BuildQueenHead(int nQueen)
DExhumedActor* pActor = QueenList[nQueen].pActor; DExhumedActor* pActor = QueenList[nQueen].pActor;
if (!pActor) return; if (!pActor) return;
int x = pActor->spr.pos.X; int x = pActor->int_pos().X;
int y = pActor->spr.pos.Y; int y = pActor->int_pos().Y;
int nAngle = pActor->spr.ang; int nAngle = pActor->spr.ang;
auto pSector = pActor->sector(); auto pSector = pActor->sector();
int z = pSector->floorz; int z = pSector->floorz;
@ -862,7 +862,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
[[fallthrough]]; [[fallthrough]];
case 1: 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.nAction = 4;
QueenHead.nFrame = 0; QueenHead.nFrame = 0;
@ -918,9 +918,9 @@ void AIQueenHead::Tick(RunListEvent* ev)
// switch break. MoveQS stuff? // switch break. MoveQS stuff?
__MOVEQS: __MOVEQS:
MoveQX[nQHead] = pActor->spr.pos.X; MoveQX[nQHead] = pActor->int_pos().X;
MoveQY[nQHead] = pActor->spr.pos.Y; MoveQY[nQHead] = pActor->int_pos().Y;
MoveQZ[nQHead] = pActor->spr.pos.Z; MoveQZ[nQHead] = pActor->int_pos().Z;
assert(pActor->sector()); assert(pActor->sector());
MoveQS[nQHead] = pActor->sector(); MoveQS[nQHead] = pActor->sector();
MoveQA[nQHead] = pActor->spr.ang; MoveQA[nQHead] = pActor->spr.ang;
@ -968,9 +968,9 @@ void AIQueenHead::Tick(RunListEvent* ev)
{ {
if (QueenHead.nIndex2 >= 15 || QueenHead.nIndex2 < 10) if (QueenHead.nIndex2 >= 15 || QueenHead.nIndex2 < 10)
{ {
int x = pActor->spr.pos.X; int x = pActor->int_pos().X;
int y = pActor->spr.pos.Y; int y = pActor->int_pos().Y;
int z = pActor->spr.pos.Z; int z = pActor->int_pos().Z;
auto pSector =pActor->sector(); auto pSector =pActor->sector();
int nAngle = RandomSize(11) & kAngleMask; int nAngle = RandomSize(11) & kAngleMask;
@ -1111,8 +1111,8 @@ void BuildQueen(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
else else
{ {
ChangeActorStat(pActor, 121); ChangeActorStat(pActor, 121);
x = pActor->spr.pos.X; x = pActor->int_pos().X;
y = pActor->spr.pos.Y; y = pActor->int_pos().Y;
z = pActor->sector()->floorz; z = pActor->sector()->floorz;
nAngle = pActor->spr.ang; nAngle = pActor->spr.ang;
} }
@ -1398,9 +1398,9 @@ void AIQueen::Tick(RunListEvent* ev)
PlayFXAtXYZ( PlayFXAtXYZ(
StaticSound[kSound40], StaticSound[kSound40],
pActor->spr.pos.X, pActor->int_pos().X,
pActor->spr.pos.Y, pActor->int_pos().Y,
pActor->spr.pos.Z); pActor->int_pos().Z);
BuildQueenHead(nQueen); BuildQueenHead(nQueen);
@ -1463,7 +1463,7 @@ void AIQueen::Damage(RunListEvent* ev)
QueenList[nQueen].nHealth = 4000; QueenList[nQueen].nHealth = 4000;
QueenList[nQueen].nAction = 7; 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; break;
case 2: case 2:
QueenList[nQueen].nHealth = 4000; QueenList[nQueen].nHealth = 4000;

View file

@ -100,7 +100,7 @@ void BuildRa(int nPlayer)
pActor->spr.pal = 1; pActor->spr.pal = 1;
pActor->spr.xrepeat = 64; pActor->spr.xrepeat = 64;
pActor->spr.yrepeat = 64; pActor->spr.yrepeat = 64;
pActor->set_int_pos(pPlayerActor->spr.pos); pActor->set_int_pos(pPlayerActor->int_pos());
// GrabTimeSlot(3); // GrabTimeSlot(3);
@ -163,7 +163,7 @@ void MoveRaToEnemy(int nPlayer)
pTarget = PlayerList[nPlayer].pActor; 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()) { if (pActor->sector() != pTarget->sector()) {
ChangeActorSect(pActor, pTarget->sector()); ChangeActorSect(pActor, pTarget->sector());

View file

@ -426,7 +426,7 @@ void DoSpiritHead()
if (nCount < (15 * nPixels) / 16) { if (nCount < (15 * nPixels) / 16) {
SoundBigEntrance(); SoundBigEntrance();
AddGlow(pSpiritSpr->sector(), 20); 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; nHeadStage = 3;
TintPalette(255, 255, 255); TintPalette(255, 255, 255);
CopyHeadToWorkTile(kTileRamsesNormal); CopyHeadToWorkTile(kTileRamsesNormal);

View file

@ -81,9 +81,9 @@ void BuildRat(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, i
} }
else else
{ {
x = pActor->spr.pos.X; x = pActor->int_pos().X;
y = pActor->spr.pos.Y; y = pActor->int_pos().Y;
z = pActor->spr.pos.Z; z = pActor->int_pos().Z;
nAngle = pActor->spr.ang; nAngle = pActor->spr.ang;
ChangeActorStat(pActor, 108); ChangeActorStat(pActor, 108);
@ -129,9 +129,9 @@ void BuildRat(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, i
DExhumedActor* FindFood(DExhumedActor* pActor) DExhumedActor* FindFood(DExhumedActor* pActor)
{ {
auto pSector = pActor->sector(); auto pSector = pActor->sector();
int x = pActor->spr.pos.X; int x = pActor->int_pos().X;
int y = pActor->spr.pos.Y; int y = pActor->int_pos().Y;
int z = pActor->spr.pos.Z; int z = pActor->int_pos().Z;
int z2 = (z + pSector->ceilingz) / 2; int z2 = (z + pSector->ceilingz) / 2;
@ -140,7 +140,7 @@ DExhumedActor* FindFood(DExhumedActor* pActor)
DExhumedActor* pActor2 = nChunkSprite[RandomSize(7) % nChunkTotal]; DExhumedActor* pActor2 = nChunkSprite[RandomSize(7) % nChunkTotal];
if (pActor2 != nullptr) 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; return pActor2;
} }
} }
@ -155,7 +155,7 @@ DExhumedActor* FindFood(DExhumedActor* pActor)
{ {
if (nPlayerPic == pActor2->spr.picnum) 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; return pActor2;
} }
} }
@ -235,8 +235,8 @@ void AIRat::Tick(RunListEvent* ev)
return; return;
} }
int xVal = abs(pActor->spr.pos.X - pTarget->spr.pos.X); int xVal = abs(pActor->int_pos().X - pTarget->int_pos().X);
int yVal = abs(pActor->spr.pos.Y - pTarget->spr.pos.Y); int yVal = abs(pActor->int_pos().Y - pTarget->int_pos().Y);
if (xVal > 50 || yVal > 50) if (xVal > 50 || yVal > 50)
{ {
@ -288,8 +288,8 @@ void AIRat::Tick(RunListEvent* ev)
MoveCreature(pActor); MoveCreature(pActor);
int xVal = abs(pActor->spr.pos.X - pTarget->spr.pos.X); int xVal = abs(pActor->int_pos().X - pTarget->int_pos().X);
int yVal = abs(pActor->spr.pos.Y - pTarget->spr.pos.Y); int yVal = abs(pActor->int_pos().Y - pTarget->int_pos().Y);
if (xVal >= 50 || yVal >= 50) if (xVal >= 50 || yVal >= 50)
{ {

View file

@ -45,8 +45,8 @@ void BuildRex(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, i
} }
else else
{ {
x = pActor->spr.pos.X; x = pActor->int_pos().X;
y = pActor->spr.pos.Y; y = pActor->int_pos().Y;
z = pActor->sector()->floorz; z = pActor->sector()->floorz;
nAngle = pActor->spr.ang; nAngle = pActor->spr.ang;

View file

@ -44,8 +44,8 @@ void BuildRoach(int nType, DExhumedActor* pActor, int x, int y, int z, sectortyp
else else
{ {
ChangeActorStat(pActor, 105); ChangeActorStat(pActor, 105);
x = pActor->spr.pos.X; x = pActor->int_pos().X;
y = pActor->spr.pos.Y; y = pActor->int_pos().Y;
z = pActor->sector()->floorz; z = pActor->sector()->floorz;
angle = pActor->spr.ang; angle = pActor->spr.ang;
} }
@ -275,7 +275,7 @@ void AIRoach::Tick(RunListEvent* ev)
pActor->spr.xvel = 0; pActor->spr.xvel = 0;
pActor->spr.yvel = 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; pActor->nFrame = 0;
} }
@ -304,7 +304,7 @@ void AIRoach::Tick(RunListEvent* ev)
pActor->spr.xvel = 0; pActor->spr.xvel = 0;
pActor->spr.yvel = 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; pActor->nFrame = 0;
} }

View file

@ -1604,9 +1604,9 @@ int runlist_CheckRadialDamage(DExhumedActor* pActor)
return 0; return 0;
} }
int x = (pActor->spr.pos.X - pRadialActor->spr.pos.X) >> 8; int x = (pActor->int_pos().X - pRadialActor->int_pos().X) >> 8;
int y = (pActor->spr.pos.Y - pRadialActor->spr.pos.Y) >> 8; int y = (pActor->int_pos().Y - pRadialActor->int_pos().Y) >> 8;
int z = (pActor->spr.pos.Z - pRadialActor->spr.pos.Z) >> 12; int z = (pActor->int_pos().Z - pRadialActor->int_pos().Z) >> 12;
if (abs(x) > nDamageRadius) { if (abs(x) > nDamageRadius) {
return 0; return 0;
@ -1641,13 +1641,13 @@ int runlist_CheckRadialDamage(DExhumedActor* pActor)
pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
if (((kStatExplodeTarget - pActor->spr.statnum) <= 1) || if (((kStatExplodeTarget - pActor->spr.statnum) <= 1) ||
cansee(pRadialActor->spr.pos.X, cansee(pRadialActor->int_pos().X,
pRadialActor->spr.pos.Y, pRadialActor->int_pos().Y,
pRadialActor->spr.pos.Z - 512, pRadialActor->int_pos().Z - 512,
pRadialActor->sector(), pRadialActor->sector(),
pActor->spr.pos.X, pActor->int_pos().X,
pActor->spr.pos.Y, pActor->int_pos().Y,
pActor->spr.pos.Z - 8192, pActor->int_pos().Z - 8192,
pActor->sector())) pActor->sector()))
{ {
edi = (nRadialDamage * (nDamageRadius - nDist)) / nDamageRadius; edi = (nRadialDamage * (nDamageRadius - nDist)) / nDamageRadius;

View file

@ -48,8 +48,8 @@ void BuildScorp(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector,
{ {
ChangeActorStat(pActor, 122); ChangeActorStat(pActor, 122);
x = pActor->spr.pos.X; x = pActor->int_pos().X;
y = pActor->spr.pos.Y; y = pActor->int_pos().Y;
z = pActor->sector()->floorz; z = pActor->sector()->floorz;
nAngle = pActor->spr.ang; nAngle = pActor->spr.ang;
} }
@ -248,7 +248,7 @@ void AIScorp::Tick(RunListEvent* ev)
{ {
if (pTarget == nMov.actor()) 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) if (AngleDiff(pActor->spr.ang, nAngle) < 64)
{ {
pActor->nAction = 2; pActor->nAction = 2;
@ -367,7 +367,7 @@ void AIScorp::Tick(RunListEvent* ev)
return; 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) if (pSpiderActor)
{ {
pSpiderActor->spr.ang = RandomSize(11); pSpiderActor->spr.ang = RandomSize(11);
@ -426,12 +426,12 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode)
{ {
pActor->nCount = 45; pActor->nCount = 45;
if (cansee(pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z - GetActorHeight(pActor), pActor->sector(), if (cansee(pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z - GetActorHeight(pActor), pActor->sector(),
pTarget->spr.pos.X, pTarget->spr.pos.Y, pTarget->spr.pos.Z - GetActorHeight(pTarget), pTarget->sector())) pTarget->int_pos().X, pTarget->int_pos().Y, pTarget->int_pos().Z - GetActorHeight(pTarget), pTarget->sector()))
{ {
pActor->spr.xvel = 0; pActor->spr.xvel = 0;
pActor->spr.yvel = 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); pActor->nIndex = RandomSize(2) + RandomSize(3);

View file

@ -48,8 +48,8 @@ void BuildSet(DExhumedActor* pActor, int x, int y, int z, sectortype* pSector, i
else else
{ {
ChangeActorStat(pActor, 120); ChangeActorStat(pActor, 120);
x = pActor->spr.pos.X; x = pActor->int_pos().X;
y = pActor->spr.pos.Y; y = pActor->int_pos().Y;
z = pActor->sector()->floorz; z = pActor->sector()->floorz;
nAngle = pActor->spr.ang; nAngle = pActor->spr.ang;
} }
@ -110,7 +110,7 @@ void BuildSoul(DExhumedActor* pSet)
pActor->spr.xvel = 0; pActor->spr.xvel = 0;
pActor->spr.yvel = 0; pActor->spr.yvel = 0;
pActor->spr.zvel = (-256) - RandomSize(10); 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->spr.hitag = nSet;
pActor->pTarget = pSet; pActor->pTarget = pSet;
@ -150,7 +150,7 @@ void AISoul::Tick(RunListEvent* ev)
pActor->spr.cstat = 0; pActor->spr.cstat = 0;
pActor->spr.yrepeat = 1; pActor->spr.yrepeat = 1;
pActor->spr.xrepeat = 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()); ChangeActorSect(pActor, pSet->sector());
return; return;
} }
@ -406,9 +406,9 @@ void AISet::Tick(RunListEvent* ev)
if (pSector) 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->nIndex = 1;
pActor->nAction = 7; pActor->nAction = 7;
@ -429,7 +429,7 @@ void AISet::Tick(RunListEvent* ev)
{ {
if (pTarget == nMov.actor()) 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) if (AngleDiff(pActor->spr.ang, nAng) < 64)
{ {
pActor->nAction = 4; pActor->nAction = 4;

View file

@ -117,9 +117,9 @@ void ExplodeSnakeSprite(DExhumedActor* pActor, int nPlayer)
pActor->pTarget = nOwner; 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); StopActorSound(pActor);
} }
@ -133,9 +133,9 @@ void BuildSnake(int nPlayer, int zVal)
auto pViewSect = PlayerList[nPlayer].pPlayerViewSect; auto pViewSect = PlayerList[nPlayer].pPlayerViewSect;
int nPic = seq_GetSeqPicnum(kSeqSnakBody, 0, 0); int nPic = seq_GetSeqPicnum(kSeqSnakBody, 0, 0);
int x = pPlayerActor->spr.pos.X; int x = pPlayerActor->int_pos().X;
int y = pPlayerActor->spr.pos.Y; int y = pPlayerActor->int_pos().Y;
int z = (pPlayerActor->spr.pos.Z + zVal) - 2560; int z = (pPlayerActor->int_pos().Z + zVal) - 2560;
int nAngle = pPlayerActor->spr.ang; int nAngle = pPlayerActor->spr.ang;
HitInfo hit{}; HitInfo hit{};
@ -193,7 +193,7 @@ void BuildSnake(int nPlayer, int zVal)
if (i == 0) 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.xrepeat = 32;
pActor->spr.yrepeat = 32; pActor->spr.yrepeat = 32;
pViewSect = pActor->sector(); pViewSect = pActor->sector();
@ -201,7 +201,7 @@ void BuildSnake(int nPlayer, int zVal)
} }
else else
{ {
pActor->set_int_pos(sprt->spr.pos); pActor->set_int_pos(sprt->int_pos());
pActor->spr.xrepeat = 40 - 3 * i; pActor->spr.xrepeat = 40 - 3 * i;
pActor->spr.yrepeat = 40 - 3 * i; pActor->spr.yrepeat = 40 - 3 * i;
} }
@ -337,11 +337,11 @@ void AISnake::Tick(RunListEvent* ev)
goto SEARCH_ENEMY; goto SEARCH_ENEMY;
} }
zVal = pActor->spr.pos.Z; zVal = pActor->int_pos().Z;
nMov = AngleChase(pActor, pEnemySprite, 1200, SnakeList[nSnake].nAngle, 32); 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) if (nMov.type || nMov.exbits)
@ -367,9 +367,9 @@ void AISnake::Tick(RunListEvent* ev)
int var_28 = (nAngle + 512) & kAngleMask; int var_28 = (nAngle + 512) & kAngleMask;
auto pSector = pActor->sector(); auto pSector = pActor->sector();
int x = pActor->spr.pos.X; int x = pActor->int_pos().X;
int y = pActor->spr.pos.Y; int y = pActor->int_pos().Y;
int z = pActor->spr.pos.Z; int z = pActor->int_pos().Z;
for (int i = 7; i > 0; i--) for (int i = 7; i > 0; i--)
{ {

View file

@ -429,7 +429,7 @@ void EXSoundEngine::CalcPosVel(int type, const void* source, const float pt[3],
if (nSnakeCam > -1) if (nSnakeCam > -1)
{ {
Snake* pSnake = &SnakeList[nSnakeCam]; Snake* pSnake = &SnakeList[nSnakeCam];
campos = pSnake->pSprites[0]->spr.pos; campos = pSnake->pSprites[0]->int_pos();
} }
else else
{ {
@ -477,7 +477,7 @@ void EXSoundEngine::CalcPosVel(int type, const void* source, const float pt[3],
assert(actor != nullptr); assert(actor != nullptr);
if (actor != nullptr) if (actor != nullptr)
{ {
*pos = GetSoundPos(actor->spr.pos); *pos = GetSoundPos(actor->int_pos());
} }
} }
if ((chanflags & CHANF_LISTENERZ) && type != SOURCE_None) if ((chanflags & CHANF_LISTENERZ) && type != SOURCE_None)
@ -503,7 +503,7 @@ void GameInterface::UpdateSounds()
if (nSnakeCam > -1) if (nSnakeCam > -1)
{ {
Snake *pSnake = &SnakeList[nSnakeCam]; Snake *pSnake = &SnakeList[nSnakeCam];
pos = pSnake->pSprites[0]->spr.pos; pos = pSnake->pSprites[0]->int_pos();
ang = pSnake->pSprites[0]->spr.ang; ang = pSnake->pSprites[0]->spr.ang;
} }
else else
@ -565,9 +565,9 @@ void PlayFX2(int nSound, DExhumedActor* pActor, int sectf, EChanFlags chanflags,
{ {
fullvol = (sprflags & 0x2000) != 0; fullvol = (sprflags & 0x2000) != 0;
hiprio = (sprflags & 0x4000) != 0; hiprio = (sprflags & 0x4000) != 0;
soundx = pActor->spr.pos.X; soundx = pActor->int_pos().X;
soundy = pActor->spr.pos.Y; soundy = pActor->int_pos().Y;
soundz = pActor->spr.pos.Z; soundz = pActor->int_pos().Z;
} }
int nVolume = 255; int nVolume = 255;
@ -686,7 +686,7 @@ void CheckAmbience(sectortype* sect)
{ {
if (sect == pSector2) if (sect == pSector2)
{ {
amb = GetSoundPos(PlayerList[0].pActor->spr.pos); amb = GetSoundPos(PlayerList[0].pActor->int_pos());
} }
else else
{ {
@ -731,7 +731,7 @@ void UpdateCreepySounds()
if (totalmoves & 2) if (totalmoves & 2)
vax = -vax; 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); creepy = GetSoundPos(sp);
if ((vsi & 0x1ff) >= kMaxSounds || !soundEngine->isValidSoundId((vsi & 0x1ff) + 1)) if ((vsi & 0x1ff) >= kMaxSounds || !soundEngine->isValidSoundId((vsi & 0x1ff) + 1))

View file

@ -46,8 +46,8 @@ DExhumedActor* BuildSpider(DExhumedActor* spp, int x, int y, int z, sectortype*
{ {
ChangeActorStat(spp, 99); ChangeActorStat(spp, 99);
x = spp->spr.pos.X; x = spp->int_pos().X;
y = spp->spr.pos.Y; y = spp->int_pos().Y;
z = spp->sector()->floorz; z = spp->sector()->floorz;
nAngle = spp->spr.ang; nAngle = spp->spr.ang;
} }
@ -310,7 +310,7 @@ void AISpider::Tick(RunListEvent* ev)
{ {
if (nMov.actor() == pTarget) 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) if (AngleDiff(spp->spr.ang, nAng) < 64)
{ {
spp->nAction = 2; spp->nAction = 2;

View file

@ -442,7 +442,7 @@ void AISWPressSector::Use(RunListEvent* ev)
{ {
if (SwitchData[nSwitch].nKeyMask) 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); PlayFXAtXYZ(StaticSound[nSwitchSound], pos.X, pos.Y, 0, CHANF_LISTENERZ);
StatusMessage(300, GStrings("TXT_EX_NEEDKEY")); StatusMessage(300, GStrings("TXT_EX_NEEDKEY"));

View file

@ -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)) if ((pActor->spr.statnum < 150) && (pActor->spr.cstat & CSTAT_SPRITE_BLOCK_ALL) && (pActor != pPlayerActor))
{ {
int xval = pActor->spr.pos.X - x; int xval = pActor->int_pos().X - x;
int yval = pActor->spr.pos.Y - y; int yval = pActor->int_pos().Y - y;
int vcos = bcos(nAngle); int vcos = bcos(nAngle);
int vsin = bsin(nAngle); int vsin = bsin(nAngle);
@ -163,7 +163,7 @@ static void analyzesprites(tspriteArray& tsprites, int x, int y, int z, double c
{ {
nCreepyTimer = kCreepyCount; 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; bestTarget = nullptr;
} }
@ -207,9 +207,9 @@ void DrawView(double smoothRatio, bool sceneonly)
{ {
DExhumedActor* pActor = SnakeList[nSnakeCam].pSprites[0]; DExhumedActor* pActor = SnakeList[nSnakeCam].pSprites[0];
playerX = pActor->spr.pos.X; playerX = pActor->int_pos().X;
playerY = pActor->spr.pos.Y; playerY = pActor->int_pos().Y;
playerZ = pActor->spr.pos.Z; playerZ = pActor->int_pos().Z;
pSector = pActor->sector(); pSector = pActor->sector();
nAngle = buildang(pActor->spr.ang); nAngle = buildang(pActor->spr.ang);
rotscrnang = buildang(0); rotscrnang = buildang(0);

View file

@ -334,7 +334,7 @@ void AIWasp::Tick(RunListEvent* ev)
pActor->add_int_z(pActor->spr.zvel); 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) if (pSector->pBelow != nullptr)
{ {