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

struct 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

struct sm2_SpriteSheet

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

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

struct sm2_Sprite

Sprite - Animation state of a sprite.

Definition at line 112 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 repeats 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 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

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 46 of file sm2.h.

◆ SM2_SLICE

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

Definition at line 52 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 92 of file sm2.h.