mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
U32 MRandomLCG::randI() was using longs
32 and 64 bit windows can handle that. 64 bit linux no likey mixing longs and ints.
This commit is contained in:
parent
82bafd9f35
commit
58ae331609
2 changed files with 3 additions and 3 deletions
|
|
@ -88,13 +88,13 @@ void MRandomLCG::setSeed(S32 s)
|
|||
U32 MRandomLCG::randI()
|
||||
{
|
||||
if ( mSeed <= msQuotient )
|
||||
mSeed = (mSeed * 16807L) % S32_MAX;
|
||||
mSeed = (mSeed * 16807) % S32_MAX;
|
||||
else
|
||||
{
|
||||
S32 high_part = mSeed / msQuotient;
|
||||
S32 low_part = mSeed % msQuotient;
|
||||
|
||||
S32 test = (16807L * low_part) - (msRemainder * high_part);
|
||||
S32 test = (16807 * low_part) - (msRemainder * high_part);
|
||||
|
||||
if ( test > 0 )
|
||||
mSeed = test;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue