libmsx
C library for MSX
Loading...
Searching...
No Matches

Sprite, Sprite-sheet, Frame, Cel, and FrameTag. More...

+ Collaboration diagram for SM2 Data Types:

Data Structures

struct  sm2_Cel
 Cel - The image of the sprite animation layer. More...
 
struct  sm2_Frame
 Frame - The frame of the sprite animation. More...
 
struct  sm2_SpriteSheet
 SpriteSheet - Whole animation frames and cels of a sprite sheet. More...
 
struct  sm2_FrameTag
 FrameTag - Definition of a range of animation frames. More...
 
struct  sm2_Sprite
 Sprite - Animation state of a sprite. More...
 
struct  sm2_Frame.cel_ids
 List of cel numbers for each layer. More...
 
struct  sm2_SpriteSheet.frames
 List of animation frames. More...
 
struct  sm2_SpriteSheet.cels
 List of whole cels. More...
 

Macros

#define sm2_Slice(T)
 Macro for defining anonymous slice type of array.
 
#define SM2_SLICE(a)
 

Typedefs

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.
 

Enumerations

enum  SM2_Direction { SM2_FORWARD , SM2_REVERSE , SM2_PINGPONG , SM2_PINGPONG_REVERSE }
 Enumeration of animation direction. More...
 

Detailed Description

Sprite, Sprite-sheet, Frame, Cel, and FrameTag.


Data Structure Documentation

◆ sm2_Cel

struct sm2_Cel

Cel - The image of the sprite animation layer.

Definition at line 58 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

struct sm2_Frame

Frame - The frame of the sprite animation.

Definition at line 73 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

struct sm2_SpriteSheet

SpriteSheet - Whole animation frames and cels of a sprite sheet.

Definition at line 83 of file sm2.h.

Data Fields
struct sm2_SpriteSheet.frames frames List of animation frames.
struct sm2_SpriteSheet.cels cels List of whole cels.

◆ sm2_FrameTag

struct sm2_FrameTag

FrameTag - Definition of a range of animation frames.

Definition at line 103 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 repeat Number of repeats; 0 means inf.

◆ sm2_Sprite

struct sm2_Sprite

Sprite - Animation state of a sprite.

Definition at line 113 of file sm2.h.

+ Collaboration diagram for sm2_Sprite:
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 repeat Repeat count; Number of loops finished.

◆ sm2_Frame.cel_ids

struct sm2_Frame.cel_ids

List of cel numbers for each layer.

Definition at line 77 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 85 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 87 of file sm2.h.

Data Fields
const sm2_Cel * ptr
uint8_t len

Macro Definition Documentation

◆ sm2_Slice

#define sm2_Slice ( T)
Value:
struct { \
T * ptr; \
uint8_t len; \
}

Macro for defining anonymous slice type of array.

Parameters
Telement type

Definition at line 47 of file sm2.h.

◆ SM2_SLICE

#define SM2_SLICE ( a)
Value:
{.ptr = (a), .len = sizeof(a)/sizeof((a)[0])}

Definition at line 53 of file sm2.h.

Typedef Documentation

◆ 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.

Enumeration Type Documentation

◆ SM2_Direction

Enumeration of animation direction.

Enumerator
SM2_FORWARD 
SM2_REVERSE 
SM2_PINGPONG 
SM2_PINGPONG_REVERSE 

Definition at line 93 of file sm2.h.