From 1740b281aa32ba2c30a2a6203f7748af6a21fd39 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Aug 2016 01:25:14 +0300 Subject: Extend horses.xml with separate offset for each direction for rider, up and down sprites. --- src/resources/horseinfo.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src/resources/horseinfo.h') diff --git a/src/resources/horseinfo.h b/src/resources/horseinfo.h index 4ff1dfb09..97bcdcc6f 100644 --- a/src/resources/horseinfo.h +++ b/src/resources/horseinfo.h @@ -24,6 +24,8 @@ #include "resources/sprite/spritereference.h" +#include "resources/horseoffset.h" + #include "localconsts.h" struct HorseInfo final @@ -31,24 +33,24 @@ struct HorseInfo final HorseInfo() : downSprites(), upSprites(), - downOffsetX(0), - downOffsetY(0), - upOffsetX(0), - upOffsetY(0), - riderOffsetX(0), - riderOffsetY(0) - { } + offsets() + { + for (int f = 0; f < 10; f ++) + { + offsets[f].upOffsetX = 0; + offsets[f].upOffsetY = 0; + offsets[f].downOffsetX = 0; + offsets[f].downOffsetY = 0; + offsets[f].riderOffsetX = 0; + offsets[f].riderOffsetY = 0; + } + } A_DELETE_COPY(HorseInfo) std::vector downSprites; std::vector upSprites; - int downOffsetX; - int downOffsetY; - int upOffsetX; - int upOffsetY; - int riderOffsetX; - int riderOffsetY; + HorseOffset offsets[10]; // by direction }; #endif // RESOURCES_HORSEINFO_H -- cgit v1.2.3-70-g09d2