diff options
author | scnorton <scnorton@biociphers.org> | 2017-06-28 17:37:17 -0400 |
---|---|---|
committer | scnorton <scnorton@biociphers.org> | 2017-06-28 17:37:17 -0400 |
commit | 26a48d7e926d3c7841a28b2af8cbbd170923469e (patch) | |
tree | fa83e9a7105769c66e3a66b3c6871984293db329 /include/sprite.h | |
parent | 39efcb2a6d169fba0ff33f1bd25e2947b74881a0 (diff) | |
parent | 06b6cada0ddedc62063171703ba6607019751a9a (diff) |
Merge branch 'master' into use_pokeblock
Diffstat (limited to 'include/sprite.h')
-rw-r--r-- | include/sprite.h | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/include/sprite.h b/include/sprite.h index bda635885..a65e71bd9 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -5,20 +5,35 @@ struct SpriteSheet { - const u8 *data; + const u8 *data; // Raw uncompressed pixel data u16 size; u16 tag; }; +struct CompressedSpriteSheet +{ + const u8 *data; // LZ77 compressed pixel data + u16 size; // Uncompressed size of pixel data + u16 tag; +}; + struct SpriteFrameImage { u8 *data; u16 size; }; +#define obj_frame_tiles(ptr) {.data = (u8 *)ptr, .size = sizeof ptr} + struct SpritePalette { - const u16 *data; + const u16 *data; // Raw uncompressed palette data + u16 tag; +}; + +struct CompressedSpritePalette +{ + const u8 *data; // LZ77 compressed palette data u16 tag; }; @@ -58,6 +73,8 @@ union AnimCmd #define ANIMCMD_FRAME(...) \ {.frame = {__VA_ARGS__}} +#define ANIMCMD_LOOP(_count) \ + {.loop = {.type = -3, .count = _count}} #define ANIMCMD_JUMP(_target) \ {.jump = {.type = -2, .target = _target}} #define ANIMCMD_END \ @@ -97,8 +114,16 @@ union AffineAnimCmd #define AFFINEANIMCMD_FRAME(_xScale, _yScale, _rotation, _duration) \ {.frame = {.xScale = _xScale, .yScale = _yScale, .rotation = _rotation, .duration = _duration}} +#define AFFINEANIMCMD_LOOP(_count) \ + {.loop = {.type = AFFINEANIMCMDTYPE_LOOP, .count = _count}} +#define AFFINEANIMCMD_JUMP(_target) \ + {.jump = {.type = AFFINEANIMCMDTYPE_JUMP, .target = _target}} #define AFFINEANIMCMD_END \ {.type = AFFINEANIMCMDTYPE_END} +#define AFFINEANIMCMD_LOOP(_count) \ + {.loop = {.type = AFFINEANIMCMDTYPE_LOOP, .count = _count}} +#define AFFINEANIMCMD_JUMP(_target) \ + {.jump = {.type = AFFINEANIMCMDTYPE_JUMP, .target = _target}} struct AffineAnimState { @@ -131,7 +156,7 @@ struct Subsprite struct SubspriteTable { u8 subspriteCount; - struct Subsprite *subsprites; + const struct Subsprite *subsprites; }; struct Sprite; @@ -142,7 +167,7 @@ struct SpriteTemplate u16 paletteTag; const struct OamData *oam; const union AnimCmd *const *anims; - struct SpriteFrameImage *images; + const struct SpriteFrameImage *images; const union AffineAnimCmd *const *affineAnims; void (*callback)(struct Sprite *); }; |