Update C sources
This commit is contained in:
parent
2a66186c7d
commit
1868520849
27 changed files with 4582 additions and 2234 deletions
16
raylib/external/rprand.h
vendored
16
raylib/external/rprand.h
vendored
|
@ -147,8 +147,13 @@ RPRANDAPI void rprand_unload_sequence(int *sequence); // Unload pseudo
|
|||
//----------------------------------------------------------------------------------
|
||||
// Global Variables Definition
|
||||
//----------------------------------------------------------------------------------
|
||||
static uint64_t rprand_seed = 0; // SplitMix64 actual seed
|
||||
static uint32_t rprand_state[4] = { 0 }; // Xoshiro128** state, nitialized by SplitMix64
|
||||
static uint64_t rprand_seed = 0xAABBCCDD; // SplitMix64 default seed (aligned to rprand_state)
|
||||
static uint32_t rprand_state[4] = { // Xoshiro128** state, initialized by SplitMix64
|
||||
0x96ea83c1,
|
||||
0x218b21e5,
|
||||
0xaa91febd,
|
||||
0x976414d4
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Module internal functions declaration
|
||||
|
@ -200,10 +205,9 @@ int *rprand_load_sequence(unsigned int count, int min, int max)
|
|||
|
||||
for (unsigned int i = 0; i < count;)
|
||||
{
|
||||
value = ((int)rprand_xoshiro()%(abs(max - min) + 1)) + min;
|
||||
value_is_dup = false;
|
||||
value = ((unsigned int)rprand_xoshiro()%(abs(max - min) + 1)) + min;
|
||||
|
||||
for (int j = 0; j < i; j++)
|
||||
for (unsigned int j = 0; j < i; j++)
|
||||
{
|
||||
if (sequence[j] == value)
|
||||
{
|
||||
|
@ -217,6 +221,8 @@ int *rprand_load_sequence(unsigned int count, int min, int max)
|
|||
sequence[i] = value;
|
||||
i++;
|
||||
}
|
||||
|
||||
value_is_dup = false;
|
||||
}
|
||||
|
||||
return sequence;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue