Sprite, Sprite-sheet, Frame, Cel, and FrameTag.
More...
|
#define | sm2_Slice(T) |
| Macro for defining anonymous slice type of array.
|
|
#define | SM2_SLICE(a) |
|
|
typedef struct sm2_Cel | sm2_Cel |
| Cel - The image of the sprite animation layer.
|
|
typedef struct sm2_Frame | sm2_Frame |
| Frame - The frame of the sprite animation.
|
|
typedef struct sm2_SpriteSheet | sm2_SpriteSheet |
| SpriteSheet - Whole animation frames and cels of a sprite sheet.
|
|
typedef struct sm2_FrameTag | sm2_FrameTag |
| FrameTag - Definition of a range of animation frames.
|
|
typedef struct sm2_Sprite | sm2_Sprite |
| Sprite - Animation state of a sprite.
|
|
Sprite, Sprite-sheet, Frame, Cel, and FrameTag.
◆ sm2_Cel
Cel - The image of the sprite animation layer.
Definition at line 57 of file sm2.h.
Data Fields |
uint8_t |
depth |
Number of sprite planes required to display the sprite cel. |
uint32_t |
addr |
Base address of image data (pattern, color table, and layout information). |
◆ sm2_Frame
Frame - The frame of the sprite animation.
Definition at line 72 of file sm2.h.
Data Fields |
size_t |
duration |
Duration of animation frame in milliseconds. |
struct sm2_Frame.cel_ids |
cel_ids |
List of cel numbers for each layer. |
◆ sm2_SpriteSheet
SpriteSheet - Whole animation frames and cels of a sprite sheet.
Definition at line 82 of file sm2.h.
◆ sm2_FrameTag
FrameTag - Definition of a range of animation frames.
Definition at line 102 of file sm2.h.
Data Fields |
uint8_t |
from |
1st frame number. |
uint8_t |
to |
last frame number. |
uint8_t |
direction |
Animation direction. |
size_t |
repeats |
Number of repeats; 0 means inf. |
◆ sm2_Sprite
Sprite - Animation state of a sprite.
Definition at line 112 of file sm2.h.
Data Fields |
const sm2_SpriteSheet * |
sheet |
Sprite sheet. |
const sm2_FrameTag * |
tag |
Current range of animation frames. |
uint8_t |
curr_frame |
Index of current frame. |
uint8_t |
curr_direction |
Current animation direction; forward/reverse. |
size_t |
remaining_duration |
Remaining duration of the current frame. |
size_t |
repeats |
Repeat count; Number of loops finished. |
◆ sm2_Frame.cel_ids
List of cel numbers for each layer.
Definition at line 76 of file sm2.h.
Data Fields |
const uint8_t * |
ptr |
|
uint8_t |
len |
|
◆ sm2_SpriteSheet.frames
struct sm2_SpriteSheet.frames |
List of animation frames.
Definition at line 84 of file sm2.h.
Data Fields |
const sm2_Frame * |
ptr |
|
uint8_t |
len |
|
◆ sm2_SpriteSheet.cels
struct sm2_SpriteSheet.cels |
List of whole cels.
Definition at line 86 of file sm2.h.
Data Fields |
const sm2_Cel * |
ptr |
|
uint8_t |
len |
|
◆ sm2_Slice
Value: struct { \
T * ptr; \
uint8_t len; \
}
Macro for defining anonymous slice type of array.
- Parameters
-
Definition at line 46 of file sm2.h.
◆ SM2_SLICE
Value:{.ptr = (a), .len = sizeof(a)/sizeof((a)[0])}
Definition at line 52 of file sm2.h.
◆ sm2_Cel
typedef struct sm2_Cel sm2_Cel |
Cel - The image of the sprite animation layer.
◆ sm2_Frame
typedef struct sm2_Frame sm2_Frame |
Frame - The frame of the sprite animation.
◆ sm2_SpriteSheet
typedef struct sm2_SpriteSheet sm2_SpriteSheet |
SpriteSheet - Whole animation frames and cels of a sprite sheet.
◆ sm2_FrameTag
typedef struct sm2_FrameTag sm2_FrameTag |
FrameTag - Definition of a range of animation frames.
◆ sm2_Sprite
typedef struct sm2_Sprite sm2_Sprite |
Sprite - Animation state of a sprite.
◆ SM2_Direction
Enumeration of animation direction.
Enumerator |
---|
SM2_FORWARD | |
SM2_REVERSE | |
SM2_PINGPONG | |
SM2_PINGPONG_REVERSE | |
Definition at line 92 of file sm2.h.