Remove array globals from OxStd, as they were causing section overlaps
on GBA
This commit is contained in:
parent
08c7647298
commit
539aa1e7eb
11
deps/ox/src/ox/std/random.cpp
vendored
11
deps/ox/src/ox/std/random.cpp
vendored
@ -11,7 +11,10 @@
|
|||||||
|
|
||||||
namespace ox {
|
namespace ox {
|
||||||
|
|
||||||
RandomSeed Random::DEFAULT_SEED = {540932923848, 540932540932};
|
Random::Random() {
|
||||||
|
m_seed[0] = 540932923848;
|
||||||
|
m_seed[1] = 540932540932;
|
||||||
|
}
|
||||||
|
|
||||||
Random::Random(RandomSeed seed) {
|
Random::Random(RandomSeed seed) {
|
||||||
m_seed[0] = seed[0];
|
m_seed[0] = seed[0];
|
||||||
@ -32,9 +35,3 @@ uint64_t Random::gen() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint64_t ox_rand() {
|
|
||||||
static ox::Random rand;
|
|
||||||
return rand.gen();
|
|
||||||
}
|
|
||||||
|
5
deps/ox/src/ox/std/random.hpp
vendored
5
deps/ox/src/ox/std/random.hpp
vendored
@ -16,13 +16,14 @@ typedef uint64_t RandomSeed[2];
|
|||||||
|
|
||||||
class Random {
|
class Random {
|
||||||
public:
|
public:
|
||||||
static RandomSeed DEFAULT_SEED;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RandomSeed m_seed;
|
RandomSeed m_seed;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Random(RandomSeed seed = DEFAULT_SEED);
|
Random();
|
||||||
|
|
||||||
|
Random(RandomSeed seed);
|
||||||
|
|
||||||
uint64_t gen();
|
uint64_t gen();
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user