Changed love.math.randomnormal([mean], stddev) to love.math.randomNormal(stddev, [mean]);

Changed love.math.randomseed(seed) to love.math.setRandomState(state) and love.math.setRandomState(low, high). Added low, high = love.math.getRandomState().

love.math.setRandomState(state) can set the random state to an integer of up to 53 bits, love.math.setRandomState(low, high) can set the random state to a 64 bit integer by using the first argument as the lower 32 bits and the second argument as the higher 32 bits.
This allows for reliable setting and saving of the state of a RNG.

--HG--
branch : RandomGenerator-2
This commit is contained in:
Alex Szpakowski
2013-08-01 18:32:44 -03:00
parent dfba650575
commit 0447d1e7c5
8 changed files with 143 additions and 90 deletions
@@ -217,8 +217,8 @@ void ParticleSystem::initParticle(particle *p)
p->position[1] += (float) rng.random(-areaSpread.getY(), areaSpread.getY());
break;
case DISTRIBUTION_NORMAL:
p->position[0] += (float) rng.randomnormal(areaSpread.getX());
p->position[1] += (float) rng.randomnormal(areaSpread.getY());
p->position[0] += (float) rng.randomNormal(areaSpread.getX());
p->position[1] += (float) rng.randomNormal(areaSpread.getY());
break;
case DISTRIBUTION_NONE:
default: