diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-11 14:22:50 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-11 14:22:50 +0300 |
commit | 47ac70cdddac59f6fcaf339295801191aef5b50b (patch) | |
tree | 7a89975482b2a83a518da1ffa6b4d71e7f3fa1cb /src/resources/map/map.cpp | |
parent | dcac10d557a1e6e0b5854a1400d02fe106d5c027 (diff) | |
download | mv-47ac70cdddac59f6fcaf339295801191aef5b50b.tar.gz mv-47ac70cdddac59f6fcaf339295801191aef5b50b.tar.bz2 mv-47ac70cdddac59f6fcaf339295801191aef5b50b.tar.xz mv-47ac70cdddac59f6fcaf339295801191aef5b50b.zip |
Move tileanimation into separate file.
Diffstat (limited to 'src/resources/map/map.cpp')
-rw-r--r-- | src/resources/map/map.cpp | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp index 1a95fced8..ee401c2fb 100644 --- a/src/resources/map/map.cpp +++ b/src/resources/map/map.cpp @@ -44,6 +44,7 @@ #include "resources/subimage.h" #include "resources/map/location.h" +#include "resources/map/tileanimation.h" #include "utils/delete2.h" #include "utils/dtor.h" @@ -69,41 +70,6 @@ class ActorFunctuator final } } actorCompare; -TileAnimation::TileAnimation(Animation *const ani): - mAffected(), - mAnimation(new SimpleAnimation(ani)), - mLastImage(nullptr) -{ -} - -TileAnimation::~TileAnimation() -{ - delete2(mAnimation); -} - -bool TileAnimation::update(const int ticks) -{ - if (!mAnimation) - return false; - - // update animation - if (!mAnimation->update(ticks)) - return false; - - // exchange images - Image *const img = mAnimation->getCurrentImage(); - if (img != mLastImage) - { - FOR_EACH (TilePairVectorCIter, i, mAffected) - { - if (i->first) - i->first->setTile(i->second, img); - } - mLastImage = img; - } - return true; -} - Map::Map(const int width, const int height, const int tileWidth, const int tileHeight) : Properties(), |