From 489f45ef996da3f20c56a815b6fceca2b3d45bdf Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 10 Sep 2022 20:30:04 +0200 Subject: [PATCH] - floatified AddFlow --- source/games/exhumed/src/aistuff.h | 4 ++-- source/games/exhumed/src/gun.cpp | 2 -- source/games/exhumed/src/init.cpp | 4 ++-- source/games/exhumed/src/lighting.cpp | 8 ++++---- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/source/games/exhumed/src/aistuff.h b/source/games/exhumed/src/aistuff.h index b1677a9ac..3a1101f6b 100644 --- a/source/games/exhumed/src/aistuff.h +++ b/source/games/exhumed/src/aistuff.h @@ -178,8 +178,8 @@ void AddFlash(sectortype* pSector, const DVector3& pos, int val); void SetTorch(int nPlayer, int bTorchOnOff); void UndoFlashes(); void DoLights(); -void AddFlow(sectortype* pSect, int nSpeed, int b, int ang = -1); -void AddFlow(walltype* pWall, int nSpeed, int b, int ang = -1); +void AddFlow(sectortype* pSect, int nSpeed, int b, DAngle ang = -minAngle); +void AddFlow(walltype* pWall, int nSpeed, int b); void BuildFlash(int nPlayer, int nVal); void AddGlow(sectortype* pSector, int nVal); void AddFlicker(sectortype* pSector, int nVal); diff --git a/source/games/exhumed/src/gun.cpp b/source/games/exhumed/src/gun.cpp index 6a9af0c20..1044d5dc0 100644 --- a/source/games/exhumed/src/gun.cpp +++ b/source/games/exhumed/src/gun.cpp @@ -245,8 +245,6 @@ Collision CheckCloseRange(int nPlayer, DVector3& pos, sectortype* *ppSector) { auto pActor = PlayerList[nPlayer].pActor; - int ang = pActor->int_ang(); - HitInfo hit{}; hitscan(pos, *ppSector, DVector3(pActor->spr.angle.ToVector() * 1024, 0 ), hit, CLIPMASK1); diff --git a/source/games/exhumed/src/init.cpp b/source/games/exhumed/src/init.cpp index 86cc14930..80a494e08 100644 --- a/source/games/exhumed/src/init.cpp +++ b/source/games/exhumed/src/init.cpp @@ -634,7 +634,7 @@ void ProcessSpriteTag(DExhumedActor* pActor, int nLotag, int nHitag) } case 88: { - AddFlow(pActor->sector(), nSpeed, 0, pActor->int_ang()); + AddFlow(pActor->sector(), nSpeed, 0, pActor->spr.angle); DeleteActor(pActor); return; @@ -649,7 +649,7 @@ void ProcessSpriteTag(DExhumedActor* pActor, int nLotag, int nHitag) } case 78: { - AddFlow(pActor->sector(), nSpeed, 1, pActor->int_ang()); + AddFlow(pActor->sector(), nSpeed, 1, pActor->spr.angle); auto pSector = pActor->sector(); pSector->Flag |= 0x8000; diff --git a/source/games/exhumed/src/lighting.cpp b/source/games/exhumed/src/lighting.cpp index 3f887892f..23f410200 100644 --- a/source/games/exhumed/src/lighting.cpp +++ b/source/games/exhumed/src/lighting.cpp @@ -617,7 +617,7 @@ void DoFlickers() } } -void AddFlow(sectortype* pSector, int nSpeed, int b, int nAngle) +void AddFlow(sectortype* pSector, int nSpeed, int b, DAngle nAngle) { if (nFlowCount >= kMaxFlows || b >= 2) return; @@ -627,8 +627,8 @@ void AddFlow(sectortype* pSector, int nSpeed, int b, int nAngle) int nPic = pSector->floorpicnum; - sFlowInfo[nFlow].angcos = float(-cos(nAngle * BAngRadian) * nSpeed); - sFlowInfo[nFlow].angsin = float(sin(nAngle * BAngRadian) * nSpeed); + sFlowInfo[nFlow].angcos = float(-nAngle.Cos() * nSpeed); + sFlowInfo[nFlow].angsin = float(nAngle.Sin() * nSpeed); sFlowInfo[nFlow].pSector = pSector; StartInterpolation(pSector, b ? Interp_Sect_CeilingPanX : Interp_Sect_FloorPanX); @@ -638,7 +638,7 @@ void AddFlow(sectortype* pSector, int nSpeed, int b, int nAngle) } -void AddFlow(walltype* pWall, int nSpeed, int b, int nAngle) +void AddFlow(walltype* pWall, int nSpeed, int b) { if (nFlowCount >= kMaxFlows || b < 2) return;