summaryrefslogtreecommitdiff
path: root/include/sprite.h
diff options
context:
space:
mode:
authorCameron Hall <camthesaxman@users.noreply.github.com>2017-01-28 01:31:09 -0500
committerYamaArashi <YamaArashi@users.noreply.github.com>2017-01-27 22:31:09 -0800
commitb9f1143d3e9b32120cc62fcc7a822d3bca8ef976 (patch)
tree0eab82b1e5172ae6491c619a23b728031c00defe /include/sprite.h
parent0de796fad05702592c841b692e91506a94428752 (diff)
define more data in C (#220)
* define more data in C * correct typo in comments
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;