summaryrefslogtreecommitdiff
path: root/src/resources/animation.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-13 03:36:00 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-13 03:36:00 +0300
commitc978b7f0d9de1bb6bd84cd299ed80c27c5147927 (patch)
tree8f1edc2be0816693761ba58aa7c7c554040a7db6 /src/resources/animation.h
parentda1b2d8311ca78eccd3e9875598562ce6bf05cab (diff)
downloadmanaplus-c978b7f0d9de1bb6bd84cd299ed80c27c5147927.tar.gz
manaplus-c978b7f0d9de1bb6bd84cd299ed80c27c5147927.tar.bz2
manaplus-c978b7f0d9de1bb6bd84cd299ed80c27c5147927.tar.xz
manaplus-c978b7f0d9de1bb6bd84cd299ed80c27c5147927.zip
Impliment new tags in sprites animations and random condition.
Tags: <label>, <goto>
Diffstat (limited to 'src/resources/animation.h')
-rw-r--r--src/resources/animation.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/resources/animation.h b/src/resources/animation.h
index 5130bc8dd..0c6f45681 100644
--- a/src/resources/animation.h
+++ b/src/resources/animation.h
@@ -39,12 +39,14 @@ struct Frame
{
ANIMATION = 0,
JUMP,
+ GOTO,
LABEL
};
Image *image;
int delay;
int offsetX;
int offsetY;
+ int rand;
FrameType type;
std::string nextAction;
};
@@ -61,13 +63,14 @@ class Animation
/**
* Appends a new animation at the end of the sequence.
*/
- void addFrame(Image *image, int delay, int offsetX, int offsetY);
+ void addFrame(Image *image, int delay, int offsetX, int offsetY,
+ int rand);
/**
* Appends an animation terminator that states that the animation
* should not loop.
*/
- void addTerminator();
+ void addTerminator(int rand);
/**
* Returns the frame at the specified index.
@@ -87,7 +90,11 @@ class Animation
int getDuration() const
{ return mDuration; }
- void addJump(std::string name);
+ void addJump(std::string name, int rand);
+
+ void addLabel(std::string name);
+
+ void addGoto(std::string name, int rand);
/**
* Determines whether the given animation frame is a terminator.