diff options
author | Tametomo <irarice@gmail.com> | 2009-04-15 20:08:21 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-15 20:10:13 +0200 |
commit | 9c2139f8b11f554cbc884bbb52278399e6994074 (patch) | |
tree | b9b71740adb94bf9fd37d75dfb750cf34312806d /src/map.cpp | |
parent | dcca13ea04fd7aa9b1539c1325cd0e465f9b545a (diff) | |
download | mana-9c2139f8b11f554cbc884bbb52278399e6994074.tar.gz mana-9c2139f8b11f554cbc884bbb52278399e6994074.tar.bz2 mana-9c2139f8b11f554cbc884bbb52278399e6994074.tar.xz mana-9c2139f8b11f554cbc884bbb52278399e6994074.zip |
Moved tile animations outside of the clock time polling loop. There's no
need to poll the CPU for them, when they already can compensate for
missed clock ticks.
Signed-off-by: Tametomo <irarice@gmail.com>
Signed-off-by: Bjørn Lindeijer <bjorn@lindeijer.nl>
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/map.cpp b/src/map.cpp index 0dc4759e..472c136f 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -75,13 +75,13 @@ TileAnimation::~TileAnimation() delete mAnimation; } -void TileAnimation::update() +void TileAnimation::update(int ticks) { if (!mAnimation) return; - //update animation - mAnimation->update(1); + // update animation + mAnimation->update(ticks); // exchange images Image *img = mAnimation->getCurrentImage(); @@ -248,14 +248,14 @@ bool spriteCompare(const Sprite *a, const Sprite *b) return a->getPixelY() < b->getPixelY(); } -void Map::update() +void Map::update(int ticks) { //update animated tiles for (std::map<int, TileAnimation*>::iterator iAni = mTileAnimations.begin(); iAni != mTileAnimations.end(); iAni++) { - iAni->second->update(); + iAni->second->update(ticks); } } |