6#ifndef __LIBDRAGON_SPRITE_H
7#define __LIBDRAGON_SPRITE_H
39typedef struct sprite_s
46 uint8_t bitdepth __attribute__((deprecated(
"use TEX_FORMAT_BITDEPTH(sprite->format) instead")));
49 uint8_t format __attribute__((deprecated(
"use sprite_get_format() instead")));
78typedef struct sprite_detail_s
86#define SPRITE_FLAGS_TEXFORMAT 0x1F
87#define SPRITE_FLAGS_OWNEDBUFFER 0x20
88#define SPRITE_FLAGS_EXT 0x80
Texture sampling parameters for rdpq_tex_upload.
Definition rdpq_tex.h:39
uint16_t height
Height in pixels.
Definition sprite.h:44
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:97
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:205
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:137
uint8_t vslices
Number of vertical sub-tiles.
Definition sprite.h:56
float blend_factor
Blend factor of the detail texture in range of 0 to 1.
Definition sprite.h:83
surface_t sprite_get_pixels(sprite_t *sprite)
Create a surface_t pointing to the full sprite contents.
Definition sprite.c:92
bool sprite_fits_tmem(sprite_t *sprite)
Return true if the sprite fits in TMEM without splitting.
Definition sprite.c:217
sprite_t * sprite_load_buf(void *buf, int sz)
Load a sprite from a buffer.
Definition sprite.c:59
sprite_t * sprite_load(const char *fn)
Load a sprite from a filesystem (eg: ROM)
Definition sprite.c:69
#define SPRITE_FLAGS_TEXFORMAT
Pixel format of the sprite.
Definition sprite.h:86
tex_format_t sprite_get_format(sprite_t *sprite)
Get the sprite texture format.
Definition sprite.h:134
uint8_t hslices
Number of horizontal sub-tiles
Definition sprite.h:54
uint16_t width
Width in pixels.
Definition sprite.h:42
void sprite_free(sprite_t *sprite)
Deallocate a sprite.
Definition sprite.c:78
bool use_main_tex
Is the detail texture the same as the main surface of the sprite, used for fractal detailing.
Definition sprite.h:81
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:166
uint16_t * sprite_get_palette(sprite_t *sprite)
Access the sprite palette (if any)
Definition sprite.c:159
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:185
Sprite detail texture information structure.
Definition sprite.h:79
Sprite structure.
Definition sprite.h:40
Surface buffers used to draw images.
tex_format_t
Pixel format enum.
Definition surface.h:103
A surface buffer for graphics.
Definition surface.h:138