28 #include "render/graphics.h"
44 mAnimation(animation),
47 mCurrentFrame(mAnimation !=
nullptr ? &mAnimation->mFrames[0] :
nullptr),
54 const std::string& dyePalettes) :
80 const int posX,
const int posY)
const
149 const std::string &dyePalettes)
153 if (animationNode ==
nullptr)
157 animationNode,
"imageset",
"");
160 if (!imagePath.empty() && !dyePalettes.empty())
168 if (imageset ==
nullptr)
178 frameNode,
"delay", 0, 0, 100000);
183 if (xmlNameEqual(frameNode,
"frame"))
193 Image *
const img = imageset->
get(index);
204 else if (xmlNameEqual(frameNode,
"sequence"))
209 if (
start < 0 || end < 0)
230 else if (xmlNameEqual(frameNode,
"end"))
#define reportAlways(...)
void addTerminator(const int rand)
void addFrame(Image *const image, const int delay, const int offsetX, const int offsetY, const int rand)
static void instantiate(std::string &target, const std::string &palettes)
virtual void drawImage(const Image *const image, int dstX, int dstY)=0
Image * get(const size_type i) const
bool update(const int timePassed)
const Frame * mCurrentFrame
Image * getCurrentImage() const
void draw(Graphics *const graphics, const int posX, const int posY) const
void initializeAnimation(const xmlNodePtr animationNode, const std::string &dyePalettes)
SimpleAnimation(Animation *const animation)
static const int mapTileSize
#define for_each_xml_child_node(var, parent)
ImageSet * getImageSet(const std::string &imagePath, const int w, const int h)
int getProperty(const xmlNodePtr node, const char *const name, int def)
int getIntProperty(const xmlNodePtr node, const char *const name, int def, const int min, const int max)
#define FUNC_BLOCK(name, id)