summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-03-20 01:48:55 +0300
committerAndrei Karas <akaras@inbox.ru>2012-03-20 01:48:55 +0300
commit66d5da1cb7e1551ac019a08075896ba04b172e36 (patch)
tree4e574c152b7094ee10ce91c25ce2a1750d6abda2 /src/map.cpp
parentd8505394ee7e109c3fd1d35450ed106a5ceefcfb (diff)
downloadplus-66d5da1cb7e1551ac019a08075896ba04b172e36.tar.gz
plus-66d5da1cb7e1551ac019a08075896ba04b172e36.tar.bz2
plus-66d5da1cb7e1551ac019a08075896ba04b172e36.tar.xz
plus-66d5da1cb7e1551ac019a08075896ba04b172e36.zip
Fix tiles animation in opengl mode in non fringe layers.
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/map.cpp b/src/map.cpp
index d983508b1..b649922ae 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -95,13 +95,14 @@ TileAnimation::~TileAnimation()
mAnimation = nullptr;
}
-void TileAnimation::update(int ticks)
+bool TileAnimation::update(int ticks)
{
if (!mAnimation)
- return;
+ return false;
// update animation
- mAnimation->update(ticks);
+ if (!mAnimation->update(ticks))
+ return false;
// exchange images
Image *img = mAnimation->getCurrentImage();
@@ -115,6 +116,7 @@ void TileAnimation::update(int ticks)
}
mLastImage = img;
}
+ return true;
}
Map::Map(int width, int height, int tileWidth, int tileHeight):
@@ -306,8 +308,8 @@ void Map::update(int ticks)
iAni = mTileAnimations.begin();
iAni != mTileAnimations.end(); ++iAni)
{
- if (iAni->second)
- iAni->second->update(ticks);
+ if (iAni->second && iAni->second->update(ticks))
+ mRedrawMap = true;
}
}