From fce956f83e9b9cb982f8fd993a0470ccf5fd8710 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 2 Sep 2022 23:54:12 +0200 Subject: [PATCH] - move stuff around --- source/games/blood/src/animatesprite.cpp | 7 +++++++ source/games/blood/src/misc.h | 1 - source/games/blood/src/trig.cpp | 7 ------- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index 344a97f82..bfe47b742 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -515,6 +515,13 @@ static void viewApplyDefaultPal(tspritetype* pTSprite, sectortype const* pSector // //--------------------------------------------------------------------------- +static int GetOctant(int x, int y) +{ + static const uint8_t OctantTable[8] = { 5, 6, 2, 1, 4, 7, 3, 0 }; + int vc = abs(x) - abs(y); + return OctantTable[7 - (x < 0) - (y < 0) * 2 - (vc < 0) * 4]; +} + void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t cZ, DAngle cA, int32_t smoothratio) { int nViewSprites = tsprites.Size(); diff --git a/source/games/blood/src/misc.h b/source/games/blood/src/misc.h index d9f569a7e..225e79c57 100644 --- a/source/games/blood/src/misc.h +++ b/source/games/blood/src/misc.h @@ -68,7 +68,6 @@ void warpInit(TArray& actors); int CheckLink(DBloodActor* pSprite); int CheckLink(int* x, int* y, int* z, sectortype** pSector); -int GetOctant(int x, int y); void RotateVector(int* dx, int* dy, int nAngle); #include "m_fixed.h" diff --git a/source/games/blood/src/trig.cpp b/source/games/blood/src/trig.cpp index 37e05ab1d..d917d6b10 100644 --- a/source/games/blood/src/trig.cpp +++ b/source/games/blood/src/trig.cpp @@ -27,13 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_BLD_NS -int OctantTable[8] = { 5, 6, 2, 1, 4, 7, 3, 0 }; - -int GetOctant(int x, int y) -{ - int vc = abs(x) - abs(y); - return OctantTable[7 - (x < 0) - (y < 0) * 2 - (vc < 0) * 4]; -} void RotateVector(int* dx, int* dy, int nAngle) {