summaryrefslogtreecommitdiff
path: root/src/particle/particle.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-18 20:34:04 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-18 20:41:06 +0300
commitb5fead8f53a555b62c9de2dc23b0f2ce9a136e8e (patch)
treeb4b3be6ca5dec68b68cabf83dd21626b70707c08 /src/particle/particle.cpp
parent5b293feb5367ccabd3edf49783511c895807876b (diff)
downloadmanaplus-b5fead8f53a555b62c9de2dc23b0f2ce9a136e8e.tar.gz
manaplus-b5fead8f53a555b62c9de2dc23b0f2ce9a136e8e.tar.bz2
manaplus-b5fead8f53a555b62c9de2dc23b0f2ce9a136e8e.tar.xz
manaplus-b5fead8f53a555b62c9de2dc23b0f2ce9a136e8e.zip
Add custom rand function implimentation, based on precreated random sequence.
Diffstat (limited to 'src/particle/particle.cpp')
-rw-r--r--src/particle/particle.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp
index 4bf01207c..eb2456306 100644
--- a/src/particle/particle.cpp
+++ b/src/particle/particle.cpp
@@ -42,6 +42,7 @@
#include "utils/delete2.h"
#include "utils/dtor.h"
#include "utils/mathutils.h"
+#include "utils/mrand.h"
#include "debug.h"
@@ -161,11 +162,11 @@ void Particle::updateSelf() restrict2
if (mRandomness >= 10) // reduce useless calculations
{
const int rand2 = mRandomness * 2;
- mVelocity.x += static_cast<float>(std::rand() % rand2 - mRandomness)
+ mVelocity.x += static_cast<float>(mrand() % rand2 - mRandomness)
/ 1000.0F;
- mVelocity.y += static_cast<float>(std::rand() % rand2 - mRandomness)
+ mVelocity.y += static_cast<float>(mrand() % rand2 - mRandomness)
/ 1000.0F;
- mVelocity.z += static_cast<float>(std::rand() % rand2 - mRandomness)
+ mVelocity.z += static_cast<float>(mrand() % rand2 - mRandomness)
/ 1000.0F;
}