libdragon
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
sprite_internal.h File Reference

Go to the source code of this file.

Data Structures

struct  sprite_ext_t
 Internal structure used as additional sprite header. More...
 
struct  sprite_ext_t::sprite_lod_s
 Information on LODs. More...
 
struct  sprite_ext_t::texparms_s
 RDP texture parameters. More...
 
struct  sprite_ext_t::detail_s
 Detail texture parameters. More...
 
struct  sprite_ext_t::texparms_s.s
 
struct  sprite_ext_t::texparms_s.t
 
struct  sprite_ext_t.__unnamed38__
 

Macros

#define SPRITE_FLAG_NUMLODS   0x0007
 Number of LODs, including detail texture if any (0 = no LODs)
 
#define SPRITE_FLAG_HAS_TEXPARMS   0x0008
 Sprite contains texture parameters.
 
#define SPRITE_FLAG_HAS_DETAIL   0x0010
 Sprite contains detail texture.
 
#define SPRITE_FLAG_FITS_TMEM   0x0020
 Set if the sprite does fit TMEM without splitting.
 

Functions

bool __sprite_upgrade (sprite_t *sprite)
 Convert a sprite from the old format with implicit texture format.
 

Detailed Description

Author
Giovanni Bajo giova.nosp@m.nnib.nosp@m.ajo@g.nosp@m.mail.nosp@m..com

Data Structure Documentation

◆ sprite_ext_t

struct sprite_ext_t

Internal structure used as additional sprite header.

This data is put at the end of the main image data of the sprite. This allows the library to stay backward compatible with old sprites created before this structure existed.

The existence of the structure in the sprite can be checked via SPRITE_FLAGS_EXT.

Data Fields
uint16_t size Size of the structure itself (for forward compatibility)
uint16_t version Version of the structure (currently 1)
uint32_t pal_file_pos

Position of the palette in the file

struct sprite_lod_s lods[7] Information on the available LODs (if detail is present, it's always at position 6)
struct sprite_ext_t.__unnamed38__ __unnamed__
struct texparms_s texparms

RDP texture parameters

struct detail_s detail Detail texture parameters.

◆ sprite_ext_t::sprite_lod_s

struct sprite_ext_t::sprite_lod_s

Information on LODs.

Data Fields
uint16_t width Width of this LOD.
uint16_t height Height of this LOD.
uint32_t fmt_file_pos Top 8 bits: format; lowest 24 bits: absolute offset in the file.

◆ sprite_ext_t::texparms_s

struct sprite_ext_t::texparms_s

RDP texture parameters.

Data Fields
struct texparms_s.s s
struct texparms_s.t t

◆ sprite_ext_t::detail_s

struct sprite_ext_t::detail_s

Detail texture parameters.

Data Fields
struct texparms_s texparms Detail LOD RDP texture parameters.
float blend_factor Blending factor for the detail texture at maximum zoom (0=hidden, 1=opaque)
bool use_main_texture True if the detail texture is the same as the LOD0 of the main texture.
uint8_t padding[3] Padding.

◆ sprite_ext_t::texparms_s.s

struct sprite_ext_t::texparms_s.s
Data Fields
float translate Translate the texture in pixels.
float repeats Number of repetitions (default: 1)
int16_t scale_log Power of 2 scale modifier of the texture (default: 0)
bool mirror Repetition mode (default: MIRROR_NONE)
int8_t padding

◆ sprite_ext_t::texparms_s.t

struct sprite_ext_t::texparms_s.t
Data Fields
float translate Translate the texture in pixels.
float repeats Number of repetitions (default: 1)
int16_t scale_log Power of 2 scale modifier of the texture (default: 0)
bool mirror Repetition mode (default: MIRROR_NONE)
int8_t padding

◆ sprite_ext_t.__unnamed38__

struct sprite_ext_t.__unnamed38__
Data Fields
uint16_t flags Generic Flags for the sprite.
uint16_t padding Padding.