7#ifndef LIBDRAGON_RDPQ_TEX_H
8#define LIBDRAGON_RDPQ_TEX_H
23#define MIRROR_REPEAT true
25#define MIRROR_NONE false
27#define REPEAT_INFINITE 2048
39typedef struct rdpq_texparms_s {
62typedef struct tex_loader_s {
70 int num_texels, tmem_pitch;
73 int s0fx, t0fx, s1fx, t1fx;
76 enum tex_load_mode load_mode;
77 void (*load_block)(
struct tex_loader_s *tload,
int s0,
int t0,
int s1,
int t1);
78 void (*load_tile)(
struct tex_loader_s *tload,
int s0,
int t0,
int s1,
int t1);
81int tex_loader_load(tex_loader_t *tload,
int s0,
int t0,
int s1,
int t1);
82void tex_loader_set_tmem_addr(tex_loader_t *tload,
int tmem_addr);
83int tex_loader_calc_max_height(tex_loader_t *tload,
int width);
302typedef struct rdpq_blitparms_s {
405__attribute__((deprecated(
"use rdpq_tex_upload instead")))
409__attribute__((deprecated(
"use rdpq_tex_upload_sub instead")))
413__attribute__((deprecated(
"use rdpq_tex_upload_tlut instead")))
414static inline
void rdpq_tex_load_tlut(uint16_t *tlut,
int color_idx,
int num_colors) {
rdpq_tile_t
Tile descriptors.
Definition rdpq.h:249
Tile parameters for rdpq_set_tile.
Definition rdpq.h:271
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:368
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:411
int s0
Source sub-rect top-left X coordinate.
Definition rdpq_tex.h:304
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:688
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:683
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:313
float theta
Rotation angle in radians.
Definition rdpq_tex.h:315
int height
Source sub-rect height. If 0, the height of the surface is used.
Definition rdpq_tex.h:307
int rdpq_tex_multi_end(void)
Finish a multi-texture upload.
Definition rdpq_tex.c:711
int cx
Transformation center (aka "hotspot") X coordinate, relative to (s0, t0). Used for all transformation...
Definition rdpq_tex.h:311
int nx
Texture horizontal repeat count. If 0, no repetition is performed (the same as 1)
Definition rdpq_tex.h:321
int tmem_addr
TMEM address where to load the texture (default: 0)
Definition rdpq_tex.h:40
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:314
int width
Source sub-rect width. If 0, the width of the surface is used.
Definition rdpq_tex.h:306
bool flip_y
Flip vertically. If true, the source sub-rect is treated as vertically flipped (so flipping is perfor...
Definition rdpq_tex.h:309
int ny
Texture vertical repeat count. If 0, no repetition is performed (the same as 1)
Definition rdpq_tex.h:322
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:406
bool filtering
True if texture filtering is enabled (activates workaround for filtering artifacts when splitting tex...
Definition rdpq_tex.h:318
int t0
Source sub-rect top-left Y coordinate.
Definition rdpq_tex.h:305
void rdpq_tex_multi_begin(void)
Begin a multi-texture upload.
Definition rdpq_tex.c:699
int palette
Palette number where TLUT is stored (used only for CI4 textures)
Definition rdpq_tex.h:41
int cy
Transformation center (aka "hotspot") X coordinate, relative to (s0, t0). Used for all transformation...
Definition rdpq_tex.h:312
int rdpq_tex_reuse(rdpq_tile_t tile, const rdpq_texparms_t *parms)
Reuse the previously uploaded texture to TMEM.
Definition rdpq_tex.c:452
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:303
bool flip_x
Flip horizontally. If true, the source sub-rect is treated as horizontally flipped (so flipping is pe...
Definition rdpq_tex.h:308
Blitting parameters for rdpq_tex_blit.
Definition rdpq_tex.h:302
Texture sampling parameters for rdpq_tex_upload.
Definition rdpq_tex.h:39
tex_format_t
Pixel format enum.
Definition surface.h:103
A surface buffer for graphics.
Definition surface.h:138