diff --git a/Sources/Plasma/CoreLib/HeadSpin.cpp b/Sources/Plasma/CoreLib/HeadSpin.cpp index caff9906..ad9bcc71 100644 --- a/Sources/Plasma/CoreLib/HeadSpin.cpp +++ b/Sources/Plasma/CoreLib/HeadSpin.cpp @@ -377,20 +377,6 @@ int hsMessageBox(const wchar_t message[], const wchar_t caption[], int kind, int return hsMessageBoxWithOwner((hsWindowHndl)nil,message,caption,kind,icon); } -/* Generic psuedo RNG used in ANSI C. */ -static unsigned long SEED = 1; -int hsRand() -{ - register int temp; - SEED = SEED * 1103515245 + 12345; - temp = (int)((SEED/65536)&32767); - return (temp); -} - -void hsRandSeed(int seed) -{ - SEED = seed; -} /**************************************/ char* hsStrcpy(char dst[], const char src[]) { diff --git a/Sources/Plasma/CoreLib/HeadSpin.h b/Sources/Plasma/CoreLib/HeadSpin.h index c5d13732..37e039c3 100644 --- a/Sources/Plasma/CoreLib/HeadSpin.h +++ b/Sources/Plasma/CoreLib/HeadSpin.h @@ -520,11 +520,6 @@ inline float hsRadiansToDegrees(float rad) { return float(rad * (180 / M_PI)); } # define ALIGN(n) __atribute__(aligned(n)) #endif -inline int hsRandMax() { return 32767; } -inline float hsRandNorm() { return 1.f / 32767.f; } // multiply by hsRand to get randoms ranged [0..1] -int hsRand(void); -void hsRandSeed(int seed); - #define hsFopen(name, mode) fopen(name, mode) char** DisplaySystemVersion(); diff --git a/Sources/Plasma/FeatureLib/pfAnimation/plRandomCommandMod.cpp b/Sources/Plasma/FeatureLib/pfAnimation/plRandomCommandMod.cpp index 3601316c..5597752b 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/plRandomCommandMod.cpp +++ b/Sources/Plasma/FeatureLib/pfAnimation/plRandomCommandMod.cpp @@ -128,7 +128,7 @@ int plRandomCommandMod::IExcludeSelections(int ncmds) float plRandomCommandMod::IGetDelay(float len) const { - float r = float(hsRand() * kRandNormalize); + float r = float(rand() * kRandNormalize); float delay = fMinDelay + (fMaxDelay - fMinDelay) * r; @@ -156,7 +156,7 @@ hsBool plRandomCommandMod::ISelectNext(int ncmds) } return true; } - float r = float(hsRand() * kRandNormalize); + float r = float(rand() * kRandNormalize); int nSelect = ncmds; diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plSpaceTreeMaker.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plSpaceTreeMaker.cpp index c5d8c47c..587b1d91 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plSpaceTreeMaker.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plSpaceTreeMaker.cpp @@ -435,7 +435,7 @@ int32_t plSpaceTreeMaker::AddLeaf(const hsBounds3Ext& worldBnd, hsBool disable) #define MF_DO_3D #ifdef MF_DO_RAND -#define MF_SETPOINT(pt,a,b,c) pt.Set(hsRand()/32767.f, hsRand()/32767.f, hsRand()/32767.f) +#define MF_SETPOINT(pt,a,b,c) pt.Set(rand()/32767.f, rand()/32767.f, rand()/32767.f) #else // MF_DO_RAND #define MF_SETPOINT(pt,a,b,c) pt.Set(a,b,c) #endif // MF_DO_RAND diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.h b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.h index 666f3e2c..908f96cb 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.h +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.h @@ -65,7 +65,7 @@ public: static void ComputeDirection(float pitch, float yaw, hsVector3 &direction); static void ComputePitchYaw(float &pitch, float &yaw, const hsVector3 &dir); - static inline float GetRandomVar() { return 2.0f * (float)hsRand() / RAND_MAX - 1; } // returns a num between +/- 1.0 + static inline float GetRandomVar() { return 2.0f * rand() / RAND_MAX - 1; } // returns a num between +/- 1.0 }; class plSimpleParticleGenerator : public plParticleGenerator