From 4500fe63253c91cf9c9388dc4332f5ce5a30a472 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 26 Sep 2022 18:25:53 +0200 Subject: [PATCH] - Blood: replaced all calls to randomAngle with RandomAngle --- source/games/blood/src/callback.cpp | 4 ++-- source/games/blood/src/misc.cpp | 5 ----- source/games/blood/src/misc.h | 1 - source/games/blood/src/nnexts.cpp | 2 +- source/games/blood/src/view.cpp | 6 +++--- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/source/games/blood/src/callback.cpp b/source/games/blood/src/callback.cpp index cc50a5667..fe451f60d 100644 --- a/source/games/blood/src/callback.cpp +++ b/source/games/blood/src/callback.cpp @@ -448,7 +448,7 @@ void fxBloodBits(DBloodActor* actor, sectortype*) // 14 double top, bottom; GetActorExtents(actor, &top, &bottom); actor->spr.pos.Z += floorZ - bottom; - DAngle nAngle = randomAngle(); + DAngle nAngle = RandomAngle(); int nDist = Random(16); auto pos = nAngle.ToVector() * nDist * 4; gFX.fxSpawnActor(FX_48, actor->sector(), DVector3(pos, actor->spr.pos.Z), 0); @@ -638,7 +638,7 @@ void fxPodBloodSplat(DBloodActor* actor, sectortype*) // 19 double top, bottom; GetActorExtents(actor, &top, &bottom); actor->spr.pos.Z += floorZ - bottom; - DAngle nAngle = randomAngle(); + DAngle nAngle = RandomAngle(); int nDist = Random(16); auto pos = actor->spr.pos.XY() + nAngle.ToVector() * nDist * 4; diff --git a/source/games/blood/src/misc.cpp b/source/games/blood/src/misc.cpp index ed6b091b1..d335d3241 100644 --- a/source/games/blood/src/misc.cpp +++ b/source/games/blood/src/misc.cpp @@ -52,10 +52,5 @@ void wsrand(int seed) wRandSeed = seed; } -DAngle randomAngle() -{ - return DAngle::fromQ16(wrand()); -} - END_BLD_NS diff --git a/source/games/blood/src/misc.h b/source/games/blood/src/misc.h index 08341e6be..750aa0a71 100644 --- a/source/games/blood/src/misc.h +++ b/source/games/blood/src/misc.h @@ -35,7 +35,6 @@ void playlogos(); unsigned int qrand(void); int wrand(void); void wsrand(int); -DAngle randomAngle(); void FireInit(void); void FireProcess(void); diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index cd019b0f1..d68e83532 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -3057,7 +3057,7 @@ void useVelocityChanger(DBloodActor* actor, sectortype* sect, DBloodActor* initi { auto tempang = nAng; while (tempang == nAng) - nAng = randomAngle(); + nAng = RandomAngle(); } if (chgDstAng) diff --git a/source/games/blood/src/view.cpp b/source/games/blood/src/view.cpp index 27fefc64f..26df96c23 100644 --- a/source/games/blood/src/view.cpp +++ b/source/games/blood/src/view.cpp @@ -160,9 +160,9 @@ void viewInit(void) for (int i = 0; i < 16; i++) { - random_angles[i][0] = randomAngle(); - random_angles[i][1] = randomAngle(); - random_angles[i][2] = randomAngle(); + random_angles[i][0] = RandomAngle(); + random_angles[i][1] = RandomAngle(); + random_angles[i][2] = RandomAngle(); } }