From 866a71ffd576fd10c4e309195016d86f0c8ed635 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 3 Sep 2012 21:58:08 +0300 Subject: Add const to more classes. --- src/rotationalparticle.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/rotationalparticle.cpp') 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(PI) + static_cast(PI) + rad; - float range = static_cast(PI / size); + const float range = static_cast(PI / size); // Determines which frame the particle should play if (rad < range || rad > ((static_cast(PI)*2) - range)) -- cgit v1.2.3-60-g2f50