mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-02 08:19:19 +00:00
COMMON: Remove unused RandomSource destructor, clarify comments, cleanup
This commit is contained in:
parent
fc9b8d2a71
commit
d165292234
@ -33,15 +33,12 @@ RandomSource::RandomSource(const String &name) {
|
||||
uint32 seed = g_system->getMillis();
|
||||
setSeed(seed);
|
||||
|
||||
// Register this random source with the event recorder. This might
|
||||
// reset the seed, so call it *after* the initial seed has been set.
|
||||
// Register this random source with the event recorder. This may end
|
||||
// up querying or resetting the current seed, so we must call it
|
||||
// *after* the initial seed has been set.
|
||||
g_eventRec.registerRandomSource(*this, name);
|
||||
}
|
||||
|
||||
RandomSource::~RandomSource() {
|
||||
// TODO: Unregister with g_eventRec
|
||||
}
|
||||
|
||||
void RandomSource::setSeed(uint32 seed) {
|
||||
_randSeed = seed;
|
||||
}
|
||||
|
@ -45,11 +45,9 @@ public:
|
||||
*/
|
||||
RandomSource(const String &name);
|
||||
|
||||
~RandomSource();
|
||||
|
||||
void setSeed(uint32 seed);
|
||||
|
||||
uint32 getSeed() {
|
||||
uint32 getSeed() const {
|
||||
return _randSeed;
|
||||
}
|
||||
|
||||
@ -59,12 +57,14 @@ public:
|
||||
* @return a random number in the interval [0, max]
|
||||
*/
|
||||
uint getRandomNumber(uint max);
|
||||
|
||||
/**
|
||||
* Generates a random bit, i.e. either 0 or 1.
|
||||
* Identical to getRandomNumber(1), but faster, hopefully.
|
||||
* Identical to getRandomNumber(1), but potentially faster.
|
||||
* @return a random bit, either 0 or 1
|
||||
*/
|
||||
uint getRandomBit();
|
||||
|
||||
/**
|
||||
* Generates a random unsigned integer in the interval [min, max].
|
||||
* @param min the lower bound
|
||||
|
Loading…
x
Reference in New Issue
Block a user