summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-11 07:01:32 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-11 07:01:32 +0300
commit56807a19c2414934b405658da99b67fb53a129a3 (patch)
tree76882418b2de3d3c105a62e2c6a4fa5339fd21e5 /src/map.cpp
parentaabbfa8483a13958d27a24c9b1e4fcad288fad8c (diff)
downloadmanaplus-56807a19c2414934b405658da99b67fb53a129a3.tar.gz
manaplus-56807a19c2414934b405658da99b67fb53a129a3.tar.bz2
manaplus-56807a19c2414934b405658da99b67fb53a129a3.tar.xz
manaplus-56807a19c2414934b405658da99b67fb53a129a3.zip
Change being sorting from function to functuator.
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp21
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