CRandom16: Make constructor explicit

Same behavior, minus the implicit conversions upon construction.
This commit is contained in:
Lioncash 2020-04-11 15:35:44 -04:00
parent 01bb0f3840
commit 065c908bc5
5 changed files with 6 additions and 6 deletions

View File

@ -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; }

View File

@ -44,7 +44,7 @@ class CRainSplashGenerator {
void SetPoint(const zeus::CVector3f& pos);
};
std::vector<SRainSplash> x0_rainSplashes;
CRandom16 x10_random = {99};
CRandom16 x10_random{99};
zeus::CVector3f x14_scale;
float x20_generateTimer = 0.0f;
float x24_generateInterval = 0.0f;

View File

@ -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;

View File

@ -26,7 +26,7 @@ class CWaveBuster : public CGameProjectile {
std::unique_ptr<CParticleSwoosh> x388_busterSwoosh2Gen;
std::unique_ptr<CElementGen> x38c_busterSparksGen;
std::unique_ptr<CElementGen> x390_busterLightGen;
CRandom16 x394_rand = {99};
CRandom16 x394_rand{99};
float x39c_ = 0.5f;
float x3a0_ = 0.5f;
float x3a4_ = 0.f;

View File

@ -111,7 +111,7 @@ private:
std::unique_ptr<CElementGen> x19e0_effect_morphBallIceBreakGen;
rstl::reserved_vector<std::pair<std::unique_ptr<CParticleSwoosh>, bool>, 32> x19e4_spiderElectricGens;
std::list<CSpiderBallElectricityManager> x1b6c_activeSpiderElectricList;
CRandom16 x1b80_rand = {99};
CRandom16 x1b80_rand{99};
rstl::reserved_vector<TToken<CGenDescription>, 8> x1b84_wakeEffects;
rstl::reserved_vector<std::unique_ptr<CElementGen>, 8> x1bc8_wakeEffectGens;
s32 x1c0c_wakeEffectIdx = -1;