summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-08-27 18:48:13 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-08-27 18:48:13 +0000
commita5d45f2fa5b0042e2d08a2bfed060dfb0417e75e (patch)
tree576815fd394d8d7bee804aaf46e9ff59f8eeb512 /src
parent2cdb3c70b062014d9e96ff778c3bdee8796ecf5e (diff)
downloadMana-a5d45f2fa5b0042e2d08a2bfed060dfb0417e75e.tar.gz
Mana-a5d45f2fa5b0042e2d08a2bfed060dfb0417e75e.tar.bz2
Mana-a5d45f2fa5b0042e2d08a2bfed060dfb0417e75e.tar.xz
Mana-a5d45f2fa5b0042e2d08a2bfed060dfb0417e75e.zip
Renamed "randomnes" to "randomness", so that it won't show up as part of Fate's
patch.
Diffstat (limited to 'src')
-rw-r--r--src/particle.cpp10
-rw-r--r--src/particle.h6
-rw-r--r--src/particleemitter.cpp14
-rw-r--r--src/particleemitter.h2
4 files changed, 16 insertions, 16 deletions
diff --git a/src/particle.cpp b/src/particle.cpp
index 3b3f5116..8591838f 100644
--- a/src/particle.cpp
+++ b/src/particle.cpp
@@ -61,7 +61,7 @@ Particle::Particle(Map *map):
mAutoDelete(true),
mMap(map),
mGravity(0.0f),
- mRandomnes(0),
+ mRandomness(0),
mBounce(0.0f),
mFollow(false),
mTarget(NULL),
@@ -139,11 +139,11 @@ Particle::update()
}
}
- if (mRandomnes > 0)
+ if (mRandomness > 0)
{
- mVelocity.x += (rand()%mRandomnes - rand()%mRandomnes) / 1000.0f;
- mVelocity.y += (rand()%mRandomnes - rand()%mRandomnes) / 1000.0f;
- mVelocity.z += (rand()%mRandomnes - rand()%mRandomnes) / 1000.0f;
+ mVelocity.x += (rand()%mRandomness - rand()%mRandomness) / 1000.0f;
+ mVelocity.y += (rand()%mRandomness - rand()%mRandomness) / 1000.0f;
+ mVelocity.z += (rand()%mRandomness - rand()%mRandomness) / 1000.0f;
}
mVelocity.z -= mGravity;
diff --git a/src/particle.h b/src/particle.h
index 88a38417..d9b8c6b7 100644
--- a/src/particle.h
+++ b/src/particle.h
@@ -227,8 +227,8 @@ class Particle : public Sprite
* Sets the ammount of random vector changes
*/
void
- setRandomnes(int r)
- { mRandomnes = r; }
+ setRandomness(int r)
+ { mRandomness = r; }
/**
* Sets the ammount of velocity particles retain after
@@ -303,7 +303,7 @@ class Particle : public Sprite
// dynamic particle
Vector mVelocity; /**< Speed in pixels per game-tick. */
float mGravity; /**< Downward acceleration in pixels per game-tick. */
- int mRandomnes; /**< Ammount of random vector change */
+ int mRandomness; /**< Ammount of random vector change */
float mBounce; /**< How much the particle bounces off when hitting the ground */
bool mFollow; /**< is this particle moved when its parent particle moves? */
diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp
index b2cc16c7..545936f0 100644
--- a/src/particleemitter.cpp
+++ b/src/particleemitter.cpp
@@ -39,8 +39,8 @@
#define DEG_RAD_FACTOR 0.017453293f
ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map *map):
- mParticleImage(0),
- mOutputPauseLeft(0)
+ mOutputPauseLeft(0),
+ mParticleImage(0)
{
mMap = map;
mParticleTarget = target;
@@ -53,7 +53,7 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map *
mParticleAngleVertical.set(0.0f);
mParticlePower.set(0.0f);
mParticleGravity.set(0.0f);
- mParticleRandomnes.set(0);
+ mParticleRandomness.set(0);
mParticleBounce.set(0.0f);
mParticleFollow = false;
mParticleAcceleration.set(0.0f);
@@ -119,9 +119,9 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map *
{
mParticleGravity = readMinMax(propertyNode, 0.0f);
}
- else if (name == "randomnes")
+ else if (name == "randomnes" || name == "randomness") // legacy bug
{
- mParticleRandomnes = readMinMax(propertyNode, 0);
+ mParticleRandomness = readMinMax(propertyNode, 0);
}
else if (name == "bounce")
{
@@ -268,7 +268,7 @@ ParticleEmitter & ParticleEmitter::operator=(const ParticleEmitter &o)
mParticleAngleVertical = o.mParticleAngleVertical;
mParticlePower = o.mParticlePower;
mParticleGravity = o.mParticleGravity;
- mParticleRandomnes = o.mParticleRandomnes;
+ mParticleRandomness = o.mParticleRandomness;
mParticleBounce = o.mParticleBounce;
mParticleFollow = o.mParticleFollow;
mParticleTarget = o.mParticleTarget;
@@ -356,7 +356,7 @@ ParticleEmitter::createParticles()
sin(angleH) * cos(angleV) * power,
sin(angleV) * power);
- newParticle->setRandomnes(mParticleRandomnes.value());
+ newParticle->setRandomness(mParticleRandomness.value());
newParticle->setGravity(mParticleGravity.value());
newParticle->setBounce(mParticleBounce.value());
newParticle->setFollow(mParticleFollow);
diff --git a/src/particleemitter.h b/src/particleemitter.h
index 54341018..5cf3fd46 100644
--- a/src/particleemitter.h
+++ b/src/particleemitter.h
@@ -97,7 +97,7 @@ class ParticleEmitter
* Vector changing of particles:
*/
MinMax<float> mParticleGravity;
- MinMax<int> mParticleRandomnes;
+ MinMax<int> mParticleRandomness;
MinMax<float> mParticleBounce;
bool mParticleFollow;