diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-02 21:25:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-02 21:25:21 +0300 |
commit | 0534847df83047f1ce2605187d45a762ffeae11e (patch) | |
tree | 92365ee5ec086b3c65f024096df9d63bd05b31d4 /src/resources/animation.cpp | |
parent | 4f390339f8107c376a10151a2cae889c0ec01089 (diff) | |
download | manaplus-0534847df83047f1ce2605187d45a762ffeae11e.tar.gz manaplus-0534847df83047f1ce2605187d45a762ffeae11e.tar.bz2 manaplus-0534847df83047f1ce2605187d45a762ffeae11e.tar.xz manaplus-0534847df83047f1ce2605187d45a762ffeae11e.zip |
Add const to more classes.
Diffstat (limited to 'src/resources/animation.cpp')
-rw-r--r-- | src/resources/animation.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
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) |