summaryrefslogtreecommitdiff
path: root/include/sprite.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sprite.h')
-rw-r--r--include/sprite.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/include/sprite.h b/include/sprite.h
index 7a2dd8494..2725d0bab 100644
--- a/include/sprite.h
+++ b/include/sprite.h
@@ -45,6 +45,9 @@ struct AnimJumpCmd
u32 target:6;
};
+// The first halfword of this union specifies the type of command.
+// If it -2, then it is a jump command. If it is -1, then it is the end of the script.
+// Otherwise, it is the imageValue for a frame command.
union AnimCmd
{
s16 type;
@@ -53,8 +56,8 @@ union AnimCmd
struct AnimJumpCmd jump;
};
-#define ANIMCMD_FRAME(_imageValue, _duration) \
- {.frame = {.imageValue = _imageValue, .duration = _duration}}
+#define ANIMCMD_FRAME(...) \
+ {.frame = {__VA_ARGS__}}
#define ANIMCMD_JUMP(_target) \
{.jump = {.type = -2, .target = _target}}
#define ANIMCMD_END \
@@ -68,11 +71,6 @@ struct AffineAnimFrameCmd
u8 duration;
};
-#define AFFINEANIMCMD_FRAME(_xScale, _yScale, _rotation, _duration) \
- {.frame = {.xScale = _xScale, .yScale = _yScale, .rotation = _rotation, .duration = _duration}}
-#define AFFINEANIMCMD_END \
- {.type = 0x7FFF}
-
struct AffineAnimLoopCmd
{
s16 type;
@@ -93,6 +91,11 @@ union AffineAnimCmd
struct AffineAnimJumpCmd jump;
};
+#define AFFINEANIMCMD_FRAME(_xScale, _yScale, _rotation, _duration) \
+ {.frame = {.xScale = _xScale, .yScale = _yScale, .rotation = _rotation, .duration = _duration}}
+#define AFFINEANIMCMD_END \
+ {.type = 0x7FFF}
+
struct AffineAnimState
{
u8 animNum;