mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 18:59:09 +00:00
Remove hsRand--we have rand support in the Cstdlib
This commit is contained in:
@ -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[])
|
||||
{
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user