8#ifndef __LIBDRAGON_SPRITE_H
9#define __LIBDRAGON_SPRITE_H
41typedef struct sprite_s
48 uint8_t bitdepth __attribute__((deprecated(
"use TEX_FORMAT_BITDEPTH(sprite->format) instead")));
51 uint8_t format __attribute__((deprecated(
"use sprite_get_format() instead")));
80typedef struct sprite_detail_s
88#define SPRITE_FLAGS_TEXFORMAT 0x1F
89#define SPRITE_FLAGS_OWNEDBUFFER 0x20
90#define SPRITE_FLAGS_EXT 0x80
Texture sampling parameters for rdpq_tex_upload.
Definition rdpq_tex.h:40
uint16_t height
Height in pixels.
Definition sprite.h:46
surface_t sprite_get_lod_pixels(sprite_t *sprite, int num_level)
Create a surface_t pointing to the contents of a LOD level.
Definition sprite.c:102
int sprite_get_lod_count(sprite_t *sprite)
Return the number of LOD levels stored within the sprite (including the main image).
Definition sprite.c:210
surface_t sprite_get_detail_pixels(sprite_t *sprite, sprite_detail_t *info, rdpq_texparms_t *infoparms)
Create a surface_t pointing to the contents of a detail texture.
Definition sprite.c:142
uint8_t vslices
Number of vertical sub-tiles.
Definition sprite.h:58
float blend_factor
Blend factor of the detail texture in range of 0 to 1.
Definition sprite.h:85
surface_t sprite_get_pixels(sprite_t *sprite)
Create a surface_t pointing to the full sprite contents.
Definition sprite.c:97
bool sprite_fits_tmem(sprite_t *sprite)
Return true if the sprite fits in TMEM without splitting.
Definition sprite.c:222
sprite_t * sprite_load_buf(void *buf, int sz)
Load a sprite from a buffer.
Definition sprite.c:64
sprite_t * sprite_load(const char *fn)
Load a sprite from a filesystem (eg: ROM)
Definition sprite.c:74
#define SPRITE_FLAGS_TEXFORMAT
Pixel format of the sprite.
Definition sprite.h:88
tex_format_t sprite_get_format(sprite_t *sprite)
Get the sprite texture format.
Definition sprite.h:136
uint8_t hslices
Number of horizontal sub-tiles
Definition sprite.h:56
uint16_t width
Width in pixels.
Definition sprite.h:44
void sprite_free(sprite_t *sprite)
Deallocate a sprite.
Definition sprite.c:83
bool use_main_tex
Is the detail texture the same as the main surface of the sprite, used for fractal detailing.
Definition sprite.h:83
surface_t sprite_get_tile(sprite_t *sprite, int h, int v)
Return a surface_t pointing to a specific tile of the spritemap.
Definition sprite.c:171
uint16_t * sprite_get_palette(sprite_t *sprite)
Access the sprite palette (if any)
Definition sprite.c:164
bool sprite_get_texparms(sprite_t *sprite, rdpq_texparms_t *parms)
Get a copy of the RDP texparms, optionally stored within the sprite.
Definition sprite.c:190
Sprite detail texture information structure.
Definition sprite.h:81
Sprite structure.
Definition sprite.h:42
Surface buffers used to draw images.
tex_format_t
Pixel format enum.
Definition surface.h:105
A surface buffer for graphics.
Definition surface.h:140