8#ifndef LIBDRAGON_RDPQ_TEX_H
9#define LIBDRAGON_RDPQ_TEX_H
24#define MIRROR_REPEAT true
26#define MIRROR_NONE false
28#define REPEAT_INFINITE 2048
40typedef struct rdpq_texparms_s {
63typedef struct tex_loader_s {
71 int num_texels, tmem_pitch;
74 int s0fx, t0fx, s1fx, t1fx;
77 enum tex_load_mode load_mode;
78 void (*load_block)(
struct tex_loader_s *tload,
int s0,
int t0,
int s1,
int t1);
79 void (*load_tile)(
struct tex_loader_s *tload,
int s0,
int t0,
int s1,
int t1);
82int tex_loader_load(tex_loader_t *tload,
int s0,
int t0,
int s1,
int t1);
83void tex_loader_set_tmem_addr(tex_loader_t *tload,
int tmem_addr);
84int tex_loader_calc_max_height(tex_loader_t *tload,
int s0,
int s1);
303typedef struct rdpq_blitparms_s {
406__attribute__((deprecated(
"use rdpq_tex_upload instead")))
410__attribute__((deprecated(
"use rdpq_tex_upload_sub instead")))
414__attribute__((deprecated(
"use rdpq_tex_upload_tlut instead")))
415static inline
void rdpq_tex_load_tlut(uint16_t *tlut,
int color_idx,
int num_colors) {
rdpq_tile_t
Tile descriptors.
Definition rdpq.h:250
Tile parameters for rdpq_set_tile.
Definition rdpq.h:272
int rdpq_tex_upload_sub(rdpq_tile_t tile, const surface_t *tex, const rdpq_texparms_t *parms, int s0, int t0, int s1, int t1)
Load a portion of texture into TMEM.
Definition rdpq_tex.c:369
int rdpq_tex_reuse_sub(rdpq_tile_t tile, const rdpq_texparms_t *parms, int s0, int t0, int s1, int t1)
Reuse a portion of the previously uploaded texture to TMEM.
Definition rdpq_tex.c:412
int s0
Source sub-rect top-left X coordinate.
Definition rdpq_tex.h:305
void rdpq_tex_upload_tlut(uint16_t *tlut, int color_idx, int num_colors)
Load one or more palettes into TMEM.
Definition rdpq_tex.c:689
void rdpq_tex_blit(const surface_t *surf, float x0, float y0, const rdpq_blitparms_t *parms)
Blit a surface to the active framebuffer.
Definition rdpq_tex.c:684
float scale_x
Horizontal scale factor to apply to the surface. If 0, no scaling is performed (the same as 1....
Definition rdpq_tex.h:314
float theta
Rotation angle in radians.
Definition rdpq_tex.h:316
int height
Source sub-rect height. If 0, the height of the surface is used.
Definition rdpq_tex.h:308
int rdpq_tex_multi_end(void)
Finish a multi-texture upload.
Definition rdpq_tex.c:712
int cx
Transformation center (aka "hotspot") X coordinate, relative to (s0, t0). Used for all transformation...
Definition rdpq_tex.h:312
int nx
Texture horizontal repeat count. If 0, no repetition is performed (the same as 1)
Definition rdpq_tex.h:322
int tmem_addr
TMEM address where to load the texture (default: 0)
Definition rdpq_tex.h:41
float scale_y
Vertical scale factor to apply to the surface. If 0, no scaling is performed (the same as 1....
Definition rdpq_tex.h:315
int width
Source sub-rect width. If 0, the width of the surface is used.
Definition rdpq_tex.h:307
bool flip_y
Flip vertically. If true, the source sub-rect is treated as vertically flipped (so flipping is perfor...
Definition rdpq_tex.h:310
int ny
Texture vertical repeat count. If 0, no repetition is performed (the same as 1)
Definition rdpq_tex.h:323
int rdpq_tex_upload(rdpq_tile_t tile, const surface_t *tex, const rdpq_texparms_t *parms)
Load a texture into TMEM.
Definition rdpq_tex.c:407
bool filtering
True if texture filtering is enabled (activates workaround for filtering artifacts when splitting tex...
Definition rdpq_tex.h:319
int t0
Source sub-rect top-left Y coordinate.
Definition rdpq_tex.h:306
void rdpq_tex_multi_begin(void)
Begin a multi-texture upload.
Definition rdpq_tex.c:700
int palette
Palette number where TLUT is stored (used only for CI4 textures)
Definition rdpq_tex.h:42
int cy
Transformation center (aka "hotspot") X coordinate, relative to (s0, t0). Used for all transformation...
Definition rdpq_tex.h:313
int rdpq_tex_reuse(rdpq_tile_t tile, const rdpq_texparms_t *parms)
Reuse the previously uploaded texture to TMEM.
Definition rdpq_tex.c:453
rdpq_tile_t tile
Base tile descriptor to use (default: TILE_0); notice that two tiles will often be used to do the upl...
Definition rdpq_tex.h:304
bool flip_x
Flip horizontally. If true, the source sub-rect is treated as horizontally flipped (so flipping is pe...
Definition rdpq_tex.h:309
Blitting parameters for rdpq_tex_blit.
Definition rdpq_tex.h:303
Texture sampling parameters for rdpq_tex_upload.
Definition rdpq_tex.h:40
tex_format_t
Pixel format enum.
Definition surface.h:105
A surface buffer for graphics.
Definition surface.h:140