|
libmsx
C library for MSX
|
Meta-sprite interface. More...
Collaboration diagram for Meta-sprite interface.:Data Structures | |
| struct | vec2i |
| struct | metasprite |
| Meta-sprite ; an aggregate of sprites. More... | |
Typedefs | |
| typedef struct vec2i | vec2i_t |
| typedef struct metasprite | metasprite_t |
| Meta-sprite ; an aggregate of sprites. | |
Functions | |
| void | vmem_set_metasprite_s (vmemptr_t base, uint8_t plane, int x, int y, const metasprite_t *ms, const tagged_color_t tagged_color) |
MSX Display / Move single colored metasprite. | |
| void | vmem_set_metasprite_m (vmemptr_t base, uint8_t plane, int x, int y, const metasprite_t *ms, const tagged_color_t *tagged_colors) |
MSX Display / Move multi colored metasprite. | |
| void | vmem_set_metasprite_a (vmemptr_t base, uint8_t plane, int x, int y, const metasprite_t *ms) |
MSX Display / Move metasprite. | |
Meta-sprite interface.
| struct vec2i |
Definition at line 35 of file metasprite.h.
| Data Fields | ||
|---|---|---|
| int | x | |
| int | y | |
| struct metasprite |
Meta-sprite ; an aggregate of sprites.
A meta-sprite is an aggregate of sprites, that could be layered, tiled, layered tiled sprites, or various layout of sprites.
A struct metasprite defines:
The below is not a member of the struct metasprite:
Definition at line 60 of file metasprite.h.
Collaboration diagram for metasprite:| Data Fields | ||
|---|---|---|
| uint8_t | n | Number of sprites, of that the metasprite consists. |
| vec2i_t | anchor | the anchor point of the metasprite, in the metasprite local coordinate system. |
| vec2i_t * | layouts |
n element array of sprite positions, in the metasprite local coordinate system. |
| uint8_t * | pats |
n element array of the sprite pattern numbers. |
| typedef struct metasprite metasprite_t |
Meta-sprite ; an aggregate of sprites.
A meta-sprite is an aggregate of sprites, that could be layered, tiled, layered tiled sprites, or various layout of sprites.
A struct metasprite defines:
The below is not a member of the struct metasprite:
| void vmem_set_metasprite_s | ( | vmemptr_t | base, |
| uint8_t | plane, | ||
| int | x, | ||
| int | y, | ||
| const metasprite_t * | ms, | ||
| const tagged_color_t | tagged_color ) |
MSX Display / Move single colored metasprite.
| base | Base address of the sprite attribute table in VRAM. |
| plane | The plane number on which the 1st sprite of the metasprite is displayed. |
| x | The x-coordinate in the screen coordinate system. |
| y | The y-coordinate in the screen coordinate system. |
| ms | Pointer to the metasprite structure. |
| tagged_color | A color code and sprite attribute tags, that is applied for all sprites in the metasprite. |
| void vmem_set_metasprite_m | ( | vmemptr_t | base, |
| uint8_t | plane, | ||
| int | x, | ||
| int | y, | ||
| const metasprite_t * | ms, | ||
| const tagged_color_t * | tagged_colors ) |
MSX Display / Move multi colored metasprite.
| base | Base address of the sprite attribute table in VRAM. |
| plane | The plane number on which the 1st sprite of the metasprite is displayed. |
| x | The x-coordinate in the screen coordinate system. |
| y | The y-coordinate in the screen coordinate system. |
| ms | Pointer to the metasprite structure. |
| tagged_colors | Array of color code and sprite attribute tags, that is applied for each sprite in the metasprite, one by one. |
| void vmem_set_metasprite_a | ( | vmemptr_t | base, |
| uint8_t | plane, | ||
| int | x, | ||
| int | y, | ||
| const metasprite_t * | ms ) |
MSX Display / Move metasprite.
This function is supposed to be used together with vmem_set_sprite_color() in sprite mode 2.
In sprite mode 1 (MSX1 compatible sprite mode), you may want to use vmem_set_metasprite_s() or vmem_set_metasprite_m(). These are fast enough and convenient.
In sprite mode 2, vmem_set_metasprite_s() and vmem_set_metasprite_m() are also useful. However, they are a bit slower because they need to copy the color and tag bits to the color table element of each sprite.
The function vmem_set_metasprite_a() does not set the EC bit. If there is a sprite whose x-coordinate would to be less than 0 on the screen, that sprite is hidden (unshown) simply, instead of setting the EC bit.
| base | Base address of the sprite attribute table in VRAM. |
| plane | The plane number on which the 1st sprite of the metasprite is displayed. |
| x | The x-coordinate in the screen coordinate system. |
| y | The y-coordinate in the screen coordinate system. |
| ms | Pointer to the metasprite structure. |