Remove array globals from OxStd, as they were causing section overlaps

on GBA
This commit is contained in:
Gary Talent 2017-11-09 20:14:25 -06:00
parent 08c7647298
commit 539aa1e7eb
2 changed files with 7 additions and 9 deletions

View File

@ -11,7 +11,10 @@
namespace ox {
RandomSeed Random::DEFAULT_SEED = {540932923848, 540932540932};
Random::Random() {
m_seed[0] = 540932923848;
m_seed[1] = 540932540932;
}
Random::Random(RandomSeed seed) {
m_seed[0] = seed[0];
@ -32,9 +35,3 @@ uint64_t Random::gen() {
}
}
uint64_t ox_rand() {
static ox::Random rand;
return rand.gen();
}

View File

@ -16,13 +16,14 @@ typedef uint64_t RandomSeed[2];
class Random {
public:
static RandomSeed DEFAULT_SEED;
private:
RandomSeed m_seed;
public:
Random(RandomSeed seed = DEFAULT_SEED);
Random();
Random(RandomSeed seed);
uint64_t gen();
};