summaryrefslogtreecommitdiff
path: root/src/actorsprite.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-02-12 16:25:24 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-02-12 22:12:24 +0100
commit6bb16f951b460c6378dbf1b5d39acfd64eb81354 (patch)
tree79af508017e7665cb9e1c624e27b44f5e82230e9 /src/actorsprite.h
parent9d2f44ee9c2a026d353c00836441f1c47b3dfa33 (diff)
downloadmana-6bb16f951b460c6378dbf1b5d39acfd64eb81354.tar.gz
mana-6bb16f951b460c6378dbf1b5d39acfd64eb81354.tar.bz2
mana-6bb16f951b460c6378dbf1b5d39acfd64eb81354.tar.xz
mana-6bb16f951b460c6378dbf1b5d39acfd64eb81354.zip
Fixes to actor drawing order
On the fringe layer, actors are drawn 'sorted' together with the tiles. When the sorting order was separated from the actual Y position of the actor, the tile drawing loop was not adapted to take this drawOrder into account rather than the plain Y position. Also, ActorSprite::draw was applying a half-tile offset to position the sprite at the bottom while the logical position of the actor is at the center of the tile. However, it failed to override getDrawOrder to account for this offset, causing actors to get drawn earlier than they should (and thus being overlapped by fringe layer tiles when they actually shouldn't). This fixes drawing glitches with the paths around Hurnscald and reduces the glitches when walking up/down through grass. Reviewed-by: Erik Schilling
Diffstat (limited to 'src/actorsprite.h')
-rw-r--r--src/actorsprite.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/actorsprite.h b/src/actorsprite.h
index cb9ea851..ab327e16 100644
--- a/src/actorsprite.h
+++ b/src/actorsprite.h
@@ -75,6 +75,8 @@ public:
*/
virtual Type getType() const { return UNKNOWN; }
+ virtual int getDrawOrder() const;
+
virtual bool draw(Graphics *graphics, int offsetX, int offsetY) const;
virtual bool drawSpriteAt(Graphics *graphics, int x, int y) const;