MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / GenerateInt

Function GenerateInt

TombEngine/Math/Random.cpp:32–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 }
31
32 int GenerateInt(int low, int high)
33 {
34 if (low == high)
35 return low;
36
37 if (low > high)
38 std::swap(low, high);
39
40 return (Xorshift32() / (UINT_MAX / (high - low + 1) + 1) + low);
41 }
42
43 float GenerateFloat(float low, float high)
44 {

Callers 15

PrepareParticlesMethod · 0.85
SpawnSpearGuardianEffectFunction · 0.85
MercenaryUziControlFunction · 0.85
SpawnSwordGuardianEffectFunction · 0.85
DoVehicleWaterMovementFunction · 0.85
TriggerPendulumFlameFunction · 0.85
ControlTwinAutoGunFunction · 0.85
RaptorControlFunction · 0.85

Calls 2

Xorshift32Function · 0.85
swapFunction · 0.50

Tested by 1

TestProjectileNewRoomFunction · 0.68