summaryrefslogtreecommitdiff
path: root/src/resources/map/map.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-11 14:22:50 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-11 14:22:50 +0300
commit47ac70cdddac59f6fcaf339295801191aef5b50b (patch)
tree7a89975482b2a83a518da1ffa6b4d71e7f3fa1cb /src/resources/map/map.cpp
parentdcac10d557a1e6e0b5854a1400d02fe106d5c027 (diff)
downloadmv-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.cpp36
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(),