From 75d8988ee88bf1f5654dbaa1064c2edade19d185 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 11 Apr 2020 15:35:44 -0400 Subject: [PATCH] CRandom16: Make constructor explicit Same behavior, minus the implicit conversions upon construction. --- Runtime/CRandom16.hpp | 4 ++-- Runtime/Graphics/CRainSplashGenerator.hpp | 2 +- Runtime/Weapon/CNewFlameThrower.hpp | 2 +- Runtime/Weapon/CWaveBuster.hpp | 2 +- Runtime/World/CMorphBall.hpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Runtime/CRandom16.hpp b/Runtime/CRandom16.hpp index 3d82cd886..4b3354286 100644 --- a/Runtime/CRandom16.hpp +++ b/Runtime/CRandom16.hpp @@ -9,7 +9,7 @@ class CRandom16 { static CRandom16* g_randomNumber; public: - CRandom16(s32 p = 99) : m_seed(p) {} + explicit CRandom16(s32 seed = 99) : m_seed(seed) {} s32 Next() { m_seed = (m_seed * 0x41c64e6d) + 0x00003039; @@ -18,7 +18,7 @@ public: s32 GetSeed() const { return m_seed; } - void SetSeed(s32 p) { m_seed = p; } + void SetSeed(s32 seed) { m_seed = seed; } float Float() { return Next() * 0.000015259022f; } diff --git a/Runtime/Graphics/CRainSplashGenerator.hpp b/Runtime/Graphics/CRainSplashGenerator.hpp index 7a63534ab..5f2f9e514 100644 --- a/Runtime/Graphics/CRainSplashGenerator.hpp +++ b/Runtime/Graphics/CRainSplashGenerator.hpp @@ -44,7 +44,7 @@ class CRainSplashGenerator { void SetPoint(const zeus::CVector3f& pos); }; std::vector x0_rainSplashes; - CRandom16 x10_random = {99}; + CRandom16 x10_random{99}; zeus::CVector3f x14_scale; float x20_generateTimer = 0.0f; float x24_generateInterval = 0.0f; diff --git a/Runtime/Weapon/CNewFlameThrower.hpp b/Runtime/Weapon/CNewFlameThrower.hpp index 29f8af7a9..953a86615 100644 --- a/Runtime/Weapon/CNewFlameThrower.hpp +++ b/Runtime/Weapon/CNewFlameThrower.hpp @@ -10,7 +10,7 @@ namespace urde { class CNewFlameThrower : public CGameProjectile { - CRandom16 x2e8_rand = {99}; + CRandom16 x2e8_rand{99}; float x2ec_ = 0.f; float x2f0_ = 0.f; bool x300_ = false; diff --git a/Runtime/Weapon/CWaveBuster.hpp b/Runtime/Weapon/CWaveBuster.hpp index d15269cca..c46c471d0 100644 --- a/Runtime/Weapon/CWaveBuster.hpp +++ b/Runtime/Weapon/CWaveBuster.hpp @@ -26,7 +26,7 @@ class CWaveBuster : public CGameProjectile { std::unique_ptr x388_busterSwoosh2Gen; std::unique_ptr x38c_busterSparksGen; std::unique_ptr x390_busterLightGen; - CRandom16 x394_rand = {99}; + CRandom16 x394_rand{99}; float x39c_ = 0.5f; float x3a0_ = 0.5f; float x3a4_ = 0.f; diff --git a/Runtime/World/CMorphBall.hpp b/Runtime/World/CMorphBall.hpp index bc52fcc17..4fceccab6 100644 --- a/Runtime/World/CMorphBall.hpp +++ b/Runtime/World/CMorphBall.hpp @@ -111,7 +111,7 @@ private: std::unique_ptr x19e0_effect_morphBallIceBreakGen; rstl::reserved_vector, bool>, 32> x19e4_spiderElectricGens; std::list x1b6c_activeSpiderElectricList; - CRandom16 x1b80_rand = {99}; + CRandom16 x1b80_rand{99}; rstl::reserved_vector, 8> x1b84_wakeEffects; rstl::reserved_vector, 8> x1bc8_wakeEffectGens; s32 x1c0c_wakeEffectIdx = -1;