diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-07-25 21:44:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-07-25 22:18:16 +0300 |
commit | badba244423ba8fccb246afaa8b1dd0c1448b370 (patch) | |
tree | d2f72ed78b3a3c9be195a2b33036c207b551066f /src/being.cpp | |
parent | 24e2ae34bfc9e6b96b890893ece422170fb7d42f (diff) | |
download | plus-badba244423ba8fccb246afaa8b1dd0c1448b370.tar.gz plus-badba244423ba8fccb246afaa8b1dd0c1448b370.tar.bz2 plus-badba244423ba8fccb246afaa8b1dd0c1448b370.tar.xz plus-badba244423ba8fccb246afaa8b1dd0c1448b370.zip |
Reorders sprites now depend on player direction.
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/being.cpp b/src/being.cpp index 904a59390..40c41cb64 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -2141,15 +2141,16 @@ void Being::recalcSpritesOrder() } } - if (info.getDrawBefore() > 0) + if (info.getDrawBefore(mSpriteDirection) > 0) { - int id2 = mSpriteIDs[info.getDrawBefore()]; + int id2 = mSpriteIDs[info.getDrawBefore(mSpriteDirection)]; std::map<int, int>::iterator orderIt = itemSlotRemap.find(id2); if (orderIt != itemSlotRemap.end()) { // logger->log("found duplicate (before)"); const ItemInfo &info2 = ItemDB::get(id2); - if (info.getDrawPriority() < info2.getDrawPriority()) + if (info.getDrawPriority(mSpriteDirection) + < info2.getDrawPriority(mSpriteDirection)) { // logger->log("old more priority"); continue; @@ -2161,18 +2162,19 @@ void Being::recalcSpritesOrder() } } - itemSlotRemap[id] = -info.getDrawBefore(); + itemSlotRemap[id] = -info.getDrawBefore(mSpriteDirection); // logger->log("item slot->slot %d %d->%d", id, slot, itemSlotRemap[id]); } - else if (info.getDrawAfter() > 0) + else if (info.getDrawAfter(mSpriteDirection) > 0) { - int id2 = mSpriteIDs[info.getDrawAfter()]; + int id2 = mSpriteIDs[info.getDrawAfter(mSpriteDirection)]; std::map<int, int>::iterator orderIt = itemSlotRemap.find(id2); if (orderIt != itemSlotRemap.end()) { // logger->log("found duplicate (after)"); const ItemInfo &info2 = ItemDB::get(id2); - if (info.getDrawPriority() < info2.getDrawPriority()) + if (info.getDrawPriority(mSpriteDirection) + < info2.getDrawPriority(mSpriteDirection)) { // logger->log("old more priority"); continue; @@ -2184,7 +2186,7 @@ void Being::recalcSpritesOrder() } } - itemSlotRemap[id] = info.getDrawAfter(); + itemSlotRemap[id] = info.getDrawAfter(mSpriteDirection); // logger->log("item slot->slot %d %d->%d", id, slot, itemSlotRemap[id]); } } |