From 49c1163a336bdf16ab9101a239c3cf431bb05af7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 21 Oct 2021 19:57:46 +0200 Subject: [PATCH] - eliminated AngleChase inline. --- source/games/exhumed/src/aistuff.h | 6 +----- source/games/exhumed/src/move.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/source/games/exhumed/src/aistuff.h b/source/games/exhumed/src/aistuff.h index 9964dac83..b75d4ab4f 100644 --- a/source/games/exhumed/src/aistuff.h +++ b/source/games/exhumed/src/aistuff.h @@ -277,11 +277,7 @@ int GetUpAngle(DExhumedActor* nSprite1, int nVal, DExhumedActor* nSprite2, int e return GetUpAngle(nSprite1->GetSpriteIndex(), nVal, nSprite2->GetSpriteIndex(), ecx); } void MoveSector(short nSector, int nAngle, int *nXVel, int *nYVel); -int AngleChase(int nSprite, int nSprite2, int ebx, int ecx, int push1); -inline Collision AngleChase(DExhumedActor* nSprite, DExhumedActor* nSprite2, int ebx, int ecx, int push1) -{ - return Collision(AngleChase(nSprite->GetSpriteIndex(), nSprite2? nSprite2->GetSpriteIndex() : -1, ebx, ecx, push1)); -} +Collision AngleChase(DExhumedActor* nSprite, DExhumedActor* nSprite2, int ebx, int ecx, int push1); void SetQuake(short nSprite, int nVal); void SetQuake(DExhumedActor* nSprite, int nVal) { diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index ac83fdcdc..7f51d5373 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -1207,9 +1207,9 @@ void SetQuake(short nSprite, int nVal) } } -int AngleChase(int nSprite, int nSprite2, int ebx, int ecx, int push1) +Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int ebx, int ecx, int push1) { - auto pSprite = &sprite[nSprite]; + auto pSprite = &pActor->s(); int nClipType = pSprite->statnum != 107; /* bjd - need to handle cliptype to clipmask change that occured in later build engine version */ @@ -1222,14 +1222,14 @@ int AngleChase(int nSprite, int nSprite2, int ebx, int ecx, int push1) short nAngle; - if (nSprite2 < 0) + if (pActor2 == nullptr) { pSprite->zvel = 0; nAngle = pSprite->ang; } else { - auto pSprite2 = &sprite[nSprite2]; + auto pSprite2 = &pActor2->s(); int nHeight = tileHeight(pSprite2->picnum) * pSprite2->yrepeat * 2; @@ -1300,7 +1300,7 @@ int AngleChase(int nSprite, int nSprite2, int ebx, int ecx, int push1) int z = bsin(pSprite->zvel) * ksqrt(sqrtNum); - return movesprite(nSprite, x >> 2, y >> 2, (z >> 13) + bsin(ecx, -5), 0, 0, nClipType); + return movesprite(pActor, x >> 2, y >> 2, (z >> 13) + bsin(ecx, -5), 0, 0, nClipType); } int GetWallNormal(short nWall)