summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-08-07 01:25:14 +0300
committerAndrei Karas <akaras@inbox.ru>2016-08-07 01:25:14 +0300
commit1740b281aa32ba2c30a2a6203f7748af6a21fd39 (patch)
tree2cc63714431f7ddebb5af57e71926cde419be4b5 /src/being
parent2b6564dcd936825853727fa256e5da7f84f933da (diff)
downloadplus-1740b281aa32ba2c30a2a6203f7748af6a21fd39.tar.gz
plus-1740b281aa32ba2c30a2a6203f7748af6a21fd39.tar.bz2
plus-1740b281aa32ba2c30a2a6203f7748af6a21fd39.tar.xz
plus-1740b281aa32ba2c30a2a6203f7748af6a21fd39.zip
Extend horses.xml with separate offset for each direction for rider, up and down sprites.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 8ce14bc40..e3a690441 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -3513,23 +3513,24 @@ void Being::drawPlayer(Graphics *restrict const graphics,
const int py = mPixelY - mapTileSize + offsetY;
if (mHorseInfo)
{
+ HorseOffset &offset = mHorseInfo->offsets[mSpriteDirection];
for_each_horses(mDownHorseSprites)
{
(*it)->draw(graphics,
- px + mHorseInfo->downOffsetX,
- py + mHorseInfo->downOffsetY);
+ px + offset.downOffsetX,
+ py + offset.downOffsetY);
}
drawBeingCursor(graphics, px, py);
drawPlayerSpriteAt(graphics,
- px + mHorseInfo->riderOffsetX,
- py + mHorseInfo->riderOffsetY);
+ px + offset.riderOffsetX,
+ py + offset.riderOffsetY);
for_each_horses(mUpHorseSprites)
{
(*it)->draw(graphics,
- px + mHorseInfo->upOffsetX,
- py + mHorseInfo->upOffsetY);
+ px + offset.upOffsetX,
+ py + offset.upOffsetY);
}
}
else