From 56807a19c2414934b405658da99b67fb53a129a3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 11 Sep 2011 07:01:32 +0300 Subject: Change being sorting from function to functuator. --- src/map.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/map.cpp') 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 -- cgit v1.2.3-60-g2f50