diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-03 21:58:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-04 03:06:57 +0300 |
commit | 866a71ffd576fd10c4e309195016d86f0c8ed635 (patch) | |
tree | 21bbec175afc181cada529598267d62f12fcb671 /src/rotationalparticle.cpp | |
parent | ebecb0cf42f2066943908fa158ac91527e0e6629 (diff) | |
download | plus-866a71ffd576fd10c4e309195016d86f0c8ed635.tar.gz plus-866a71ffd576fd10c4e309195016d86f0c8ed635.tar.bz2 plus-866a71ffd576fd10c4e309195016d86f0c8ed635.tar.xz plus-866a71ffd576fd10c4e309195016d86f0c8ed635.zip |
Add const to more classes.
Diffstat (limited to 'src/rotationalparticle.cpp')
-rw-r--r-- | src/rotationalparticle.cpp | 10 |
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)) |