From 0534847df83047f1ce2605187d45a762ffeae11e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 2 Sep 2012 21:25:21 +0300 Subject: Add const to more classes. --- src/resources/animation.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/resources/animation.cpp') diff --git a/src/resources/animation.cpp b/src/resources/animation.cpp index 63e73df55..7c69e1372 100644 --- a/src/resources/animation.cpp +++ b/src/resources/animation.cpp @@ -33,8 +33,9 @@ Animation::Animation(): { } -void Animation::addFrame(Image *image, int delay, int offsetX, int offsetY, - int rand) +void Animation::addFrame(Image *const image, const int delay, + const int offsetX, const int offsetY, + const int rand) { Frame frame = { image, delay, offsetX, offsetY, rand, Frame::ANIMATION, "" }; @@ -42,7 +43,7 @@ void Animation::addFrame(Image *image, int delay, int offsetX, int offsetY, mDuration += delay; } -void Animation::addTerminator(int rand) +void Animation::addTerminator(const int rand) { addFrame(nullptr, 0, 0, 0, rand); } @@ -52,31 +53,31 @@ bool Animation::isTerminator(const Frame &candidate) return (!candidate.image && candidate.type == Frame::ANIMATION); } -void Animation::addJump(std::string name, int rand) +void Animation::addJump(const std::string &name, const int rand) { Frame frame = { nullptr, 0, 0, 0, rand, Frame::JUMP, name }; mFrames.push_back(frame); } -void Animation::addLabel(std::string name) +void Animation::addLabel(const std::string &name) { Frame frame = { nullptr, 0, 0, 0, 100, Frame::LABEL, name }; mFrames.push_back(frame); } -void Animation::addGoto(std::string name, int rand) +void Animation::addGoto(const std::string &name, const int rand) { Frame frame = { nullptr, 0, 0, 0, rand, Frame::GOTO, name }; mFrames.push_back(frame); } -void Animation::addPause(int delay, int rand) +void Animation::addPause(const int delay, const int rand) { Frame frame = { nullptr, delay, 0, 0, rand, Frame::PAUSE, "" }; mFrames.push_back(frame); } -void Animation::setLastFrameDelay(int delay) +void Animation::setLastFrameDelay(const int delay) { for (FramesRevIter it = mFrames.rbegin(), it_end = mFrames.rend(); it != it_end; ++ it) -- cgit v1.2.3-60-g2f50