summaryrefslogtreecommitdiff
path: root/src/rotationalparticle.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-03 21:58:08 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-04 03:06:57 +0300
commit866a71ffd576fd10c4e309195016d86f0c8ed635 (patch)
tree21bbec175afc181cada529598267d62f12fcb671 /src/rotationalparticle.cpp
parentebecb0cf42f2066943908fa158ac91527e0e6629 (diff)
downloadmv-866a71ffd576fd10c4e309195016d86f0c8ed635.tar.gz
mv-866a71ffd576fd10c4e309195016d86f0c8ed635.tar.bz2
mv-866a71ffd576fd10c4e309195016d86f0c8ed635.tar.xz
mv-866a71ffd576fd10c4e309195016d86f0c8ed635.zip
Add const to more classes.
Diffstat (limited to 'src/rotationalparticle.cpp')
-rw-r--r--src/rotationalparticle.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/rotationalparticle.cpp b/src/rotationalparticle.cpp
index 8c024c4fa..84fe07d62 100644
--- a/src/rotationalparticle.cpp
+++ b/src/rotationalparticle.cpp
@@ -29,13 +29,15 @@
static const double PI = 3.14159265;
-RotationalParticle::RotationalParticle(Map *map, Animation *animation):
+RotationalParticle::RotationalParticle(Map *const map,
+ Animation *const animation) :
ImageParticle(map, nullptr),
mAnimation(new SimpleAnimation(animation))
{
}
-RotationalParticle::RotationalParticle(Map *map, XmlNodePtr animationNode,
+RotationalParticle::RotationalParticle(Map *const map,
+ const XmlNodePtr animationNode,
const std::string& dyePalettes):
ImageParticle(map, nullptr),
mAnimation(new SimpleAnimation(animationNode, dyePalettes))
@@ -56,7 +58,7 @@ bool RotationalParticle::update()
// TODO: cache velocities to avoid spamming atan2()
- int size = mAnimation->getLength();
+ const int size = mAnimation->getLength();
if (!size)
return false;
@@ -64,7 +66,7 @@ bool RotationalParticle::update()
if (rad < 0)
rad = static_cast<float>(PI) + static_cast<float>(PI) + rad;
- float range = static_cast<float>(PI / size);
+ const float range = static_cast<const float>(PI / size);
// Determines which frame the particle should play
if (rad < range || rad > ((static_cast<float>(PI)*2) - range))