12345678910111213141516171819202122232425262728 |
- #ifndef CORE_RANDOM_H
- #define CORE_RANDOM_H
- #include "core/Types.h"
- typedef struct {
- u32 data[25];
- size_t index;
- } CoreRandom;
- void coreInitRandom(CoreRandom* r, u32 seed);
- u32 coreRandomU32(CoreRandom* r, u32 min, u32 exclusiveMax);
- i32 coreRandomI32(CoreRandom* r, i32 min, i32 exclusiveMax);
- size_t coreRandomSize(CoreRandom* r, size_t min, size_t exclusiveMax);
- bool coreRandomBool(CoreRandom* r);
- float coreRandomFloat(CoreRandom* r);
- #ifdef IMPORT_CORE
- #define Random CoreRandom
- #define initRandom coreInitRandom
- #define randomU32 coreRandomU32
- #define randomI32 coreRandomI32
- #define randomSize coreRandomSize
- #define randomBool coreRandomBool
- #define randomFloat coreRandomFloat
- #endif
- #endif
|