summaryrefslogtreecommitdiff
path: root/src/particleemitter.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-18 17:48:29 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-18 17:49:00 +0200
commitf98d003e354a1792117b7cbc771d1dd91475a156 (patch)
treedc2a297f7c4026394c9954ae4bfd4abd22ef9612 /src/particleemitter.cpp
parentbb0a6cb25b2985fd1f74c9d27d5a46f6863e2dee (diff)
downloadmv-f98d003e354a1792117b7cbc771d1dd91475a156.tar.gz
mv-f98d003e354a1792117b7cbc771d1dd91475a156.tar.bz2
mv-f98d003e354a1792117b7cbc771d1dd91475a156.tar.xz
mv-f98d003e354a1792117b7cbc771d1dd91475a156.zip
Fix most old style cast except manaserv and libxml2 defines.
Diffstat (limited to 'src/particleemitter.cpp')
-rw-r--r--src/particleemitter.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp
index ad4fd2989..f1bb81d59 100644
--- a/src/particleemitter.cpp
+++ b/src/particleemitter.cpp
@@ -353,7 +353,8 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target,
}
else if (xmlStrEqual(propertyNode->name, BAD_CAST "deatheffect"))
{
- mDeathEffect = (const char*)propertyNode->xmlChildrenNode->content;
+ mDeathEffect = reinterpret_cast<const char*>(
+ propertyNode->xmlChildrenNode->content);
mDeathEffectConditions = 0x00;
if (XML::getBoolProperty(propertyNode, "on-floor", true))
mDeathEffectConditions += Particle::DEAD_FLOOR;
@@ -425,13 +426,16 @@ ParticleEmitter::readParticleEmitterProp(xmlNodePtr propertyNode, T def)
{
ParticleEmitterProp<T> retval;
- def = (T) XML::getFloatProperty(propertyNode, "value", (double) def);
- retval.set((T) XML::getFloatProperty(propertyNode, "min", (double) def),
- (T) XML::getFloatProperty(propertyNode, "max", (double) def));
+ def = static_cast<T>(XML::getFloatProperty(propertyNode, "value",
+ static_cast<double>(def)));
+ retval.set(static_cast<T>(XML::getFloatProperty(propertyNode, "min",
+ static_cast<double>(def))), static_cast<T>(XML::getFloatProperty(
+ propertyNode, "max", static_cast<double>(def))));
std::string change = XML::getProperty(propertyNode, "change-func", "none");
- T amplitude = (T) XML::getFloatProperty(propertyNode,
- "change-amplitude", 0.0);
+ T amplitude = static_cast<T>(XML::getFloatProperty(propertyNode,
+ "change-amplitude", 0.0));
+
int period = XML::getProperty(propertyNode, "change-period", 0);
int phase = XML::getProperty(propertyNode, "change-phase", 0);
if (change == "saw" || change == "sawtooth")
@@ -564,7 +568,8 @@ void ParticleEmitter::adjustSize(int w, int h)
mParticlePosY.set(0, static_cast<float>(h));
int newArea = w * h;
// adjust the output so that the particle density stays the same
- float outputFactor = (float)newArea / (float)oldArea;
+ float outputFactor = static_cast<float>(newArea)
+ / static_cast<float>(oldArea);
mOutput.minVal *= static_cast<float>(outputFactor);
mOutput.maxVal *= static_cast<float>(outputFactor);
}