diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-11 07:01:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-11 07:01:32 +0300 |
commit | 56807a19c2414934b405658da99b67fb53a129a3 (patch) | |
tree | 76882418b2de3d3c105a62e2c6a4fa5339fd21e5 /src/map.cpp | |
parent | aabbfa8483a13958d27a24c9b1e4fcad288fad8c (diff) | |
download | manaverse-56807a19c2414934b405658da99b67fb53a129a3.tar.gz manaverse-56807a19c2414934b405658da99b67fb53a129a3.tar.bz2 manaverse-56807a19c2414934b405658da99b67fb53a129a3.tar.xz manaverse-56807a19c2414934b405658da99b67fb53a129a3.zip |
Change being sorting from function to functuator.
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/map.cpp b/src/map.cpp index 3e83f2e6c..ee4aae14a 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -54,8 +54,6 @@ #include "debug.h" -bool actorCompare(const Actor *a, const Actor *b); - /** * A location on a tile map. Used for pathfinding, open list. */ @@ -80,6 +78,17 @@ struct Location MetaTile *tile; }; +class ActorFunctuator +{ + public: + bool operator()(const Actor *a, const Actor *b) const + { + if (!a || !b) + return false; + return a->getPixelY() < b->getPixelY(); + } +} actorCompare; + TileAnimation::TileAnimation(Animation *ani): mLastImage(NULL) { @@ -779,14 +788,6 @@ void Map::addTileset(Tileset *tileset) mMaxTileHeight = tileset->getHeight(); } -bool actorCompare(const Actor *a, const Actor *b) -{ - if (!a || !b) - return false; - - return a->getPixelY() < b->getPixelY(); -} - void Map::update(int ticks) { // Update animated tiles |