Minor fixes

*Seed is uint instead of int
*Permutation table is uint instead of int, could lead before to program
crash with negative seeds


Former-commit-id: 49ad04987a09a5f5b4bcab6ee3916db9818172b6
This commit is contained in:
Remi Beges
2012-12-01 10:07:41 +01:00
parent a0b7364eed
commit d0545eb760
30 changed files with 46 additions and 134 deletions

View File

@@ -19,21 +19,23 @@ enum nzNoises
class NAZARA_API NzNoiseBase
{
public:
NzNoiseBase(int seed = 0);
NzNoiseBase(unsigned int seed = 0);
~NzNoiseBase() = default;
void SetNewSeed(int seed);
int GetUniformRandomValue();
void SetNewSeed(unsigned int seed);
void ShufflePermutationTable();
unsigned int GetUniformRandomValue();
int fastfloor(float n);
int JenkinsHash(int a, int b, int c);
protected:
int perm[512];
unsigned int perm[512];
private:
int Ua, Uc, Um;
int UcurrentSeed;
int Uprevious, Ulast;
unsigned int Ua, Uc, Um;
unsigned int UcurrentSeed;
unsigned int Uprevious, Ulast;
};