libdragon
Loading...
Searching...
No Matches
sprite_internal.h
1#ifndef __LIBDRAGON_SPRITE_INTERNAL_H
2#define __LIBDRAGON_SPRITE_INTERNAL_H
3
4#include <stdbool.h>
5#include <surface.h>
6
7#define SPRITE_FLAG_NUMLODS 0x0007
8#define SPRITE_FLAG_HAS_TEXPARMS 0x0008
9#define SPRITE_FLAG_HAS_DETAIL 0x0010
10#define SPRITE_FLAG_FITS_TMEM 0x0020
11
21typedef struct sprite_ext_s {
22 uint16_t size;
23 uint16_t version;
24 uint32_t pal_file_pos;
26 struct sprite_lod_s {
27 uint16_t width;
28 uint16_t height;
29 uint32_t fmt_file_pos;
30 } lods[7];
31 struct {
32 uint16_t flags;
33 uint16_t padding;
34 };
36 struct texparms_s {
37 struct {
38 float translate;
39 float repeats;
40 int16_t scale_log;
41 bool mirror;
42 int8_t padding;
43 } s, t; // S/T directions of texture parameters
44 } texparms;
46 struct detail_s {
47 struct texparms_s texparms;
50 uint8_t padding[3];
51 } detail;
53
54_Static_assert(sizeof(sprite_ext_t) == 124, "invalid sizeof(sprite_ext_t)");
55
57bool __sprite_upgrade(sprite_t *sprite);
58
59#endif
Sprite structure.
Definition sprite.h:40
Internal structure used as additional sprite header.
Definition sprite_internal.h:21
uint32_t pal_file_pos
Definition sprite_internal.h:24
uint32_t fmt_file_pos
Top 8 bits: format; lowest 24 bits: absolute offset in the file.
Definition sprite_internal.h:29
bool use_main_texture
True if the detail texture is the same as the LOD0 of the main texture.
Definition sprite_internal.h:49
uint16_t version
Version of the structure (currently 1)
Definition sprite_internal.h:23
uint16_t height
Height of this LOD.
Definition sprite_internal.h:28
uint16_t size
Size of the structure itself (for forward compatibility)
Definition sprite_internal.h:22
float blend_factor
Blending factor for the detail texture at maximum zoom (0=hidden, 1=opaque)
Definition sprite_internal.h:48
uint16_t width
Width of this LOD.
Definition sprite_internal.h:27
Detail texture parameters.
Definition sprite_internal.h:46
Information on LODs.
Definition sprite_internal.h:26
RDP texture parameters.
Definition sprite_internal.h:36
Surface buffers used to draw images.