From b5c315978c74fc053dec4e5ba558b807a255fd7e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 10 Sep 2022 21:24:40 +0200 Subject: [PATCH] - rename GetActorHeightF (no edits here, just one replace.) --- source/games/exhumed/src/aistuff.h | 2 +- source/games/exhumed/src/anubis.cpp | 4 ++-- source/games/exhumed/src/bullet.cpp | 8 ++++---- source/games/exhumed/src/fish.cpp | 2 +- source/games/exhumed/src/gun.cpp | 2 +- source/games/exhumed/src/lion.cpp | 2 +- source/games/exhumed/src/move.cpp | 10 +++++----- source/games/exhumed/src/mummy.cpp | 4 ++-- source/games/exhumed/src/object.cpp | 4 ++-- source/games/exhumed/src/player.cpp | 2 +- source/games/exhumed/src/queen.cpp | 8 ++++---- source/games/exhumed/src/ra.cpp | 2 +- source/games/exhumed/src/scorp.cpp | 4 ++-- source/games/exhumed/src/set.cpp | 8 ++++---- source/games/exhumed/src/spider.cpp | 6 +++--- source/games/exhumed/src/view.cpp | 2 +- 16 files changed, 35 insertions(+), 35 deletions(-) diff --git a/source/games/exhumed/src/aistuff.h b/source/games/exhumed/src/aistuff.h index f49150206..c338b275b 100644 --- a/source/games/exhumed/src/aistuff.h +++ b/source/games/exhumed/src/aistuff.h @@ -214,7 +214,7 @@ DExhumedActor* UpdateEnemy(DExhumedActor** ppEnemy); Collision MoveCreature(DExhumedActor* nSprite); Collision MoveCreatureWithCaution(DExhumedActor* actor); DVector3 WheresMyMouth(int nPlayer, sectortype** sectnum); -double GetActorHeightF(DExhumedActor* nSprite); +double GetActorHeight(DExhumedActor* nSprite); DExhumedActor* insertActor(sectortype* s, int st); DExhumedActor* GrabBody(); DExhumedActor* GrabBodyGunSprite(); diff --git a/source/games/exhumed/src/anubis.cpp b/source/games/exhumed/src/anubis.cpp index d43ada535..09aa0c61c 100644 --- a/source/games/exhumed/src/anubis.cpp +++ b/source/games/exhumed/src/anubis.cpp @@ -207,8 +207,8 @@ 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.plusZ(-GetActorHeightF(ap)), ap->sector(), - pTarget->spr.pos.plusZ(-GetActorHeightF(pTarget)), pTarget->sector())) + if (cansee(ap->spr.pos.plusZ(-GetActorHeight(ap)), ap->sector(), + pTarget->spr.pos.plusZ(-GetActorHeight(pTarget)), pTarget->sector())) { ap->vel.X = 0; ap->vel.Y = 0; diff --git a/source/games/exhumed/src/bullet.cpp b/source/games/exhumed/src/bullet.cpp index 5ad2ddca4..d593a5603 100644 --- a/source/games/exhumed/src/bullet.cpp +++ b/source/games/exhumed/src/bullet.cpp @@ -398,7 +398,7 @@ MOVEEND: if (BulletList[nBullet].pEnemy) { hitactor = BulletList[nBullet].pEnemy; - pos = hitactor->spr.pos.plusZ(-GetActorHeightF(hitactor) * 0.5); + pos = hitactor->spr.pos.plusZ(-GetActorHeight(hitactor) * 0.5); pHitSect = hitactor->sector(); } else @@ -535,7 +535,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, double fZOffset, DA sBullet.pActor = insertActor(pActor->sector(), 200); sBullet.pActor->spr.angle = nAngle; - double nHeight = GetActorHeightF(pTarget); + double nHeight = GetActorHeight(pTarget); assert(pTarget->sector()); @@ -567,7 +567,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, double fZOffset, DA } auto pBulletActor = insertActor(pSector, 200); - double fHeight = GetActorHeightF(pActor) * 0.75; + double fHeight = GetActorHeight(pActor) * 0.75; if (fZOffset == INT_MAX) { fZOffset = -fHeight; @@ -674,7 +674,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, double fZOffset, DA } else { - fHeight = GetActorHeightF(pTarget); + fHeight = GetActorHeight(pTarget); if (pTarget->spr.statnum == 100) { diff --git a/source/games/exhumed/src/fish.cpp b/source/games/exhumed/src/fish.cpp index 8ba382296..c1385a0d5 100644 --- a/source/games/exhumed/src/fish.cpp +++ b/source/games/exhumed/src/fish.cpp @@ -367,7 +367,7 @@ void AIFish::Tick(RunListEvent* ev) else { PlotCourseToSprite(pActor, pTargetActor); - double nHeight = GetActorHeightF(pActor) * 0.5; + double nHeight = GetActorHeight(pActor) * 0.5; double z = fabs(pTargetActor->spr.pos.Z - pActor->spr.pos.Z); if (z <= nHeight) diff --git a/source/games/exhumed/src/gun.cpp b/source/games/exhumed/src/gun.cpp index 4a286a616..1812da346 100644 --- a/source/games/exhumed/src/gun.cpp +++ b/source/games/exhumed/src/gun.cpp @@ -651,7 +651,7 @@ loc_flag: ebx += angle.Sin() * (1 << 3) * ecx; } - double nHeight = GetActorHeightF(pPlayerActor) * -0.5; + double nHeight = GetActorHeight(pPlayerActor) * -0.5; if (nAction < 6) { diff --git a/source/games/exhumed/src/lion.cpp b/source/games/exhumed/src/lion.cpp index f1e86f65c..4e903b1bf 100644 --- a/source/games/exhumed/src/lion.cpp +++ b/source/games/exhumed/src/lion.cpp @@ -380,7 +380,7 @@ void AILion::Tick(RunListEvent* ev) { HitInfo hit{}; - hitscan(pActor->spr.pos.plusZ(-GetActorHeightF(pActor) * 0.5), pActor->sector(), DVector3(nScanAngle.ToVector() * 1024, 0), hit, CLIPMASK1); + hitscan(pActor->spr.pos.plusZ(-GetActorHeight(pActor) * 0.5), pActor->sector(), DVector3(nScanAngle.ToVector() * 1024, 0), hit, CLIPMASK1); if (hit.hitWall) { diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index d766f1cb3..09158bfb0 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -382,7 +382,7 @@ Collision movespritez(DExhumedActor* pActor, double z, double height, int clipdi return nRet; } -double GetActorHeightF(DExhumedActor* actor) +double GetActorHeight(DExhumedActor* actor) { return tileHeight(actor->spr.picnum) * actor->spr.yrepeat * REPEAT_SCALE; } @@ -400,7 +400,7 @@ Collision movesprite(DExhumedActor* pActor, int dx, int dy, int dz, int ceildist bTouchFloor = false; auto spos = pActor->spr.pos; - double nSpriteHeight = GetActorHeightF(pActor); + double nSpriteHeight = GetActorHeight(pActor); int nClipDist = pActor->int_clipdist(); auto pSector = pActor->sector(); assert(pSector); @@ -592,7 +592,7 @@ DExhumedActor* FindPlayer(DExhumedActor* pActor, int nDistance, bool dontengage) { int v10 = abs(pPlayerActor->spr.pos.Y - pActor->spr.pos.Y); - if (v10 < nDistance && cansee(pPlayerActor->spr.pos.plusZ(-30), pPlayerActor->sector(), pActor->spr.pos.plusZ(-GetActorHeightF(pActor)), pSector)) + if (v10 < nDistance && cansee(pPlayerActor->spr.pos.plusZ(-30), pPlayerActor->sector(), pActor->spr.pos.plusZ(-GetActorHeight(pActor)), pSector)) { break; } @@ -913,7 +913,7 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int threshol } else { - double nHeight = GetActorHeightF(pActor2) / 2; + double nHeight = GetActorHeight(pActor2) / 2; auto vect = pActor2->spr.pos.XY() - pActor->spr.pos.XY(); DAngle nMyAngle = VecToAngle(vect); double nSqrt = vect.Length(); @@ -957,7 +957,7 @@ DAngle GetWallNormal(walltype* pWall) DVector3 WheresMyMouth(int nPlayer, sectortype **sectnum) { auto pActor = PlayerList[nPlayer].pActor; - double height = GetActorHeightF(pActor) * 0.5; + double height = GetActorHeight(pActor) * 0.5; *sectnum = pActor->sector(); auto pos = pActor->spr.pos.plusZ(-height); diff --git a/source/games/exhumed/src/mummy.cpp b/source/games/exhumed/src/mummy.cpp index 1b26286e7..a59e0994f 100644 --- a/source/games/exhumed/src/mummy.cpp +++ b/source/games/exhumed/src/mummy.cpp @@ -200,8 +200,8 @@ void AIMummy::Tick(RunListEvent* ev) { if (RandomBit() && pTarget) { - if (cansee(pActor->spr.pos.plusZ(-GetActorHeightF(pActor)), pActor->sector(), - pTarget->spr.pos.plusZ(-GetActorHeightF(pTarget)), pTarget->sector())) + if (cansee(pActor->spr.pos.plusZ(-GetActorHeight(pActor)), pActor->sector(), + pTarget->spr.pos.plusZ(-GetActorHeight(pTarget)), pTarget->sector())) { pActor->nAction = 3; pActor->nFrame = 0; diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index e77105be0..cfb8ab0f7 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -565,7 +565,7 @@ int CheckSectorSprites(sectortype* pSector, int nVal) ExhumedSectIterator it(pSector); while (auto pActor= it.Next()) { - if ((pActor->spr.cstat & CSTAT_SPRITE_BLOCK_ALL) && (nZDiff < GetActorHeightF(pActor))) + if ((pActor->spr.cstat & CSTAT_SPRITE_BLOCK_ALL) && (nZDiff < GetActorHeight(pActor))) { if (nVal != 1) { return 1; @@ -1776,7 +1776,7 @@ DExhumedActor* BuildObject(DExhumedActor* pActor, int nOjectType, int nHitag) // in-game destructable wall mounted screen void ExplodeScreen(DExhumedActor* pActor) { - pActor->spr.pos.Z -= GetActorHeightF(pActor) * 0.5; + pActor->spr.pos.Z -= GetActorHeight(pActor) * 0.5; for (int i = 0; i < 30; i++) { BuildSpark(pActor, 0); // shoot out blue orbs diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 950f66a85..1c0ce604e 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -293,7 +293,7 @@ void RestartPlayer(int nPlayer) pActor->vel.Y = 0; pActor->vel.Z = 0; - nStandHeight = GetActorHeightF(pActor); + nStandHeight = GetActorHeight(pActor); pActor->spr.hitag = 0; pActor->spr.extra = -1; diff --git a/source/games/exhumed/src/queen.cpp b/source/games/exhumed/src/queen.cpp index 5b7806c34..c2772c996 100644 --- a/source/games/exhumed/src/queen.cpp +++ b/source/games/exhumed/src/queen.cpp @@ -294,7 +294,7 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int thr { auto vect = pActor2->spr.pos.XY() - pActor->spr.pos.XY(); - double nTileY = GetActorHeightF(pActor2) / 2; + double nTileY = GetActorHeight(pActor2) / 2; double edx = ((pActor2->spr.pos.Z - nTileY) - pActor->spr.pos.Z); double nSqrt = vect.Length(); @@ -349,7 +349,7 @@ int DestroyTailPart() for (int i = 0; i < 5; i++) { - double nHeight = GetActorHeightF(pActor); + double nHeight = GetActorHeight(pActor); BuildLavaLimb(pActor, i, nHeight); } @@ -945,7 +945,7 @@ void AIQueenHead::Tick(RunListEvent* ev) if (QueenHead.nIndex2 < 10) { for (int i = (10 - QueenHead.nIndex2) * 2; i > 0; i--) { - BuildLavaLimb(pActor, i, GetActorHeightF(pActor)); + BuildLavaLimb(pActor, i, GetActorHeight(pActor)); } } } @@ -963,7 +963,7 @@ void AIQueenHead::Tick(RunListEvent* ev) for (i = 0; i < 20; i++) { - BuildLavaLimb(pActor, i, GetActorHeightF(pActor)); + BuildLavaLimb(pActor, i, GetActorHeight(pActor)); } runlist_SubRunRec(pActor->spr.intowner); diff --git a/source/games/exhumed/src/ra.cpp b/source/games/exhumed/src/ra.cpp index 71f206486..e4e26932d 100644 --- a/source/games/exhumed/src/ra.cpp +++ b/source/games/exhumed/src/ra.cpp @@ -163,7 +163,7 @@ void MoveRaToEnemy(int nPlayer) pTarget = PlayerList[nPlayer].pActor; } - pActor->spr.pos = pTarget->spr.pos.plusZ(-GetActorHeightF(pTarget)); + pActor->spr.pos = pTarget->spr.pos.plusZ(-GetActorHeight(pTarget)); if (pActor->sector() != pTarget->sector()) { ChangeActorSect(pActor, pTarget->sector()); diff --git a/source/games/exhumed/src/scorp.cpp b/source/games/exhumed/src/scorp.cpp index 876840ccf..7deec9608 100644 --- a/source/games/exhumed/src/scorp.cpp +++ b/source/games/exhumed/src/scorp.cpp @@ -419,8 +419,8 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode) { pActor->nCount = 45; - if (cansee(pActor->spr.pos.plusZ(-GetActorHeightF(pActor)), pActor->sector(), - pTarget->spr.pos.plusZ(-GetActorHeightF(pTarget)), pTarget->sector())) + if (cansee(pActor->spr.pos.plusZ(-GetActorHeight(pActor)), pActor->sector(), + pTarget->spr.pos.plusZ(-GetActorHeight(pTarget)), pTarget->sector())) { pActor->vel.X = 0; pActor->vel.Y = 0; diff --git a/source/games/exhumed/src/set.cpp b/source/games/exhumed/src/set.cpp index 44af3d151..64a27a7e0 100644 --- a/source/games/exhumed/src/set.cpp +++ b/source/games/exhumed/src/set.cpp @@ -108,7 +108,7 @@ void BuildSoul(DExhumedActor* pSet) pActor->vel.X = 0; pActor->vel.Y = 0; pActor->vel.Z = -1 - RandomSize(10) / 256.; - pActor->spr.pos = DVector3(pSet->spr.pos.XY(), RandomSize(8) + 32 + pActor->sector()->ceilingz - GetActorHeightF(pActor)); + pActor->spr.pos = DVector3(pSet->spr.pos.XY(), RandomSize(8) + 32 + pActor->sector()->ceilingz - GetActorHeight(pActor)); //pActor->spr.hitag = nSet; pActor->pTarget = pSet; @@ -149,7 +149,7 @@ void AISoul::Tick(RunListEvent* ev) pActor->spr.cstat = 0; pActor->spr.yrepeat = 1; pActor->spr.xrepeat = 1; - pActor->spr.pos = pSet->spr.pos.plusZ(-GetActorHeightF(pSet) * 0.5); + pActor->spr.pos = pSet->spr.pos.plusZ(-GetActorHeight(pSet) * 0.5); ChangeActorSect(pActor, pSet->sector()); return; } @@ -566,9 +566,9 @@ void AISet::Tick(RunListEvent* ev) { if (nFlag & 0x80) { - pActor->spr.pos.Z -= GetActorHeightF(pActor); + pActor->spr.pos.Z -= GetActorHeight(pActor); BuildCreatureChunk(pActor, seq_GetSeqPicnum(kSeqSet, 76, 0)); - pActor->spr.pos.Z += GetActorHeightF(pActor); + pActor->spr.pos.Z += GetActorHeight(pActor); } if (bVal) diff --git a/source/games/exhumed/src/spider.cpp b/source/games/exhumed/src/spider.cpp index 57edcf4b9..037c36afb 100644 --- a/source/games/exhumed/src/spider.cpp +++ b/source/games/exhumed/src/spider.cpp @@ -98,7 +98,7 @@ void AISpider::Tick(RunListEvent* ev) { if (spp->spr.cstat & CSTAT_SPRITE_YFLIP) { - spp->spr.pos.Z = spp->sector()->ceilingz + GetActorHeightF(spp); + spp->spr.pos.Z = spp->sector()->ceilingz + GetActorHeight(spp); } else { @@ -206,7 +206,7 @@ void AISpider::Tick(RunListEvent* ev) { spp->spr.cstat ^= CSTAT_SPRITE_YFLIP; spp->vel.Z = 1./256.; - spp->spr.pos.Z = spp->sector()->ceilingz+ GetActorHeightF(spp); + spp->spr.pos.Z = spp->sector()->ceilingz+ GetActorHeight(spp); } else { @@ -284,7 +284,7 @@ void AISpider::Tick(RunListEvent* ev) && !((spp->sector()->ceilingstat) & CSTAT_SECTOR_SKY)) { spp->spr.cstat |= CSTAT_SPRITE_YFLIP; - spp->spr.pos.Z = spp->sector()->ceilingz + GetActorHeightF(spp); + spp->spr.pos.Z = spp->sector()->ceilingz + GetActorHeight(spp); spp->vel.Z = 0; spp->nAction = 1; diff --git a/source/games/exhumed/src/view.cpp b/source/games/exhumed/src/view.cpp index 611d62bb2..22e9fe86d 100644 --- a/source/games/exhumed/src/view.cpp +++ b/source/games/exhumed/src/view.cpp @@ -151,7 +151,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& view, double { nCreepyTimer = kCreepyCount; - if (!cansee(view, pSector, targ->spr.pos.plusZ(-GetActorHeightF(targ)), targ->sector())) + if (!cansee(view, pSector, targ->spr.pos.plusZ(-GetActorHeight(targ)), targ->sector())) { bestTarget = nullptr; }