coastline 0.0.4
Loading...
Searching...
No Matches
sprite.h
Go to the documentation of this file.
1#ifndef COASTLINE_SPRITE_H
2#define COASTLINE_SPRITE_H
3
9
10#include <PR/ultratypes.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
17#define SPRITE_STYLE_TINTED 99
18
39
51
53#if TGR_REGION == TGR_REGION_JP || TGR_REGION == TGR_REGION_EU
54#define WITH_PALETTE(value, palette) (value), (palette)
55#else
56#define WITH_PALETTE(value, palette) (value)
57#endif
58
69#if TGR_REGION == TGR_REGION_JP || TGR_REGION == TGR_REGION_EU
71void DrawSpriteAtOrigin(Sprite *sprite, u16 *palette);
72#else
73void DrawSpriteAtOrigin(Sprite *sprite);
74#endif
75
87void DrawTexturedSprite(Sprite *sprite, s32 x, s32 y);
88
102void DrawSpriteTinted(Sprite *sprite, u8 red, u8 green, u8 blue);
103
121 Sprite *sprite, s32 x, s32 y, s32 width, s32 height, u8 red, u8 green, u8 blue);
122
146#if TGR_REGION == TGR_REGION_JP || TGR_REGION == TGR_REGION_EU
148#endif
150 u8 *pixels,
151#if TGR_REGION == TGR_REGION_JP || TGR_REGION == TGR_REGION_EU
152 u16 *palette,
153#endif
154 s32 width,
155 s32 height,
156 s32 x,
157 s32 y,
158 s32 drawWidth,
159 s32 drawHeight,
160 u8 red,
161 u8 green,
162 u8 blue);
163
186 s32 srcX,
187 s32 srcY,
188 s32 srcWidth,
189 s32 srcHeight,
190 s32 x,
191 s32 y,
192 s32 width,
193 s32 height,
194 u8 red,
195 u8 green,
196 u8 blue);
197
209void DrawPixel(s32 x, s32 y, u8 shade);
210
227void DrawRectOutline(s32 x, s32 y, s32 width, s32 height, s32 thickness, u8 red, u8 green, u8 blue);
228
244void DrawFilledRectHiRes(s32 x, s32 y, s32 width, s32 height, u8 red, u8 green, u8 blue);
245
266 s32 y,
267 s32 width,
268 s32 height,
269 s32 border,
270 u8 transparent,
271 u8 sunken,
272 u8 red,
273 u8 green,
274 u8 blue);
275
276#ifdef __cplusplus
277}
278#endif
279
280#endif /* COASTLINE_SPRITE_H */
void DrawSpriteRegion(Sprite *sprite, s32 x, s32 y, s32 width, s32 height, u8 red, u8 green, u8 blue)
Draw a sprite stretched over a rectangle in a colour.
void DrawScaledTexturedRect(Sprite *sprite, s32 srcX, s32 srcY, s32 srcWidth, s32 srcHeight, s32 x, s32 y, s32 width, s32 height, u8 red, u8 green, u8 blue)
Draw a rectangle of the texels of a 4-bit sprite stretched over a rectangle of the screen in a colour...
void DrawFilledRectHiRes(s32 x, s32 y, s32 width, s32 height, u8 red, u8 green, u8 blue)
Fill a rectangle in a colour.
void DrawRectOutline(s32 x, s32 y, s32 width, s32 height, s32 thickness, u8 red, u8 green, u8 blue)
Draw the outline of a rectangle in a colour, inside its edges.
void DrawSpriteStrip(Sprite *sprite, u8 *pixels, u16 *palette, s32 width, s32 height, s32 x, s32 y, s32 drawWidth, s32 drawHeight, u8 red, u8 green, u8 blue)
Draw one strip of a sprite stretched over a rectangle, upside down to match the bottom-up rows.
void DrawTexturedSprite(Sprite *sprite, s32 x, s32 y)
Draw a sprite at a position.
void DrawSpriteTinted(Sprite *sprite, u8 red, u8 green, u8 blue)
Draw a sprite at its origin in a colour.
void DrawPixel(s32 x, s32 y, u8 shade)
Fill one pixel in a grey.
void DrawSpriteAtOrigin(Sprite *sprite, u16 *palette)
Draw a sprite at its origin, at its size on the screen.
void DrawRectBorder(s32 x, s32 y, s32 width, s32 height, s32 border, u8 transparent, u8 sunken, u8 red, u8 green, u8 blue)
Draw a box with a bevelled border outside its edges, light at the top and the left and dark at the bo...
void LoadTextureFromRom(Sprite *sprite)
Allocate memory for a sprite and decompress it there from the cartridge.
A picture of the menus.
Definition sprite.h:23
u8 bitsPerTexel
Definition sprite.h:27
s32 originY
Definition sprite.h:33
s32 originX
Definition sprite.h:32
u32 romOffset
Definition sprite.h:25
u8 style
Definition sprite.h:36
u32 stripHeight
Definition sprite.h:31
u8 * pixels
Definition sprite.h:24
u32 width
Definition sprite.h:29
s32 drawWidth
Definition sprite.h:34
u32 romEnd
Definition sprite.h:26
s32 drawHeight
Definition sprite.h:35
u32 height
Definition sprite.h:30
Integer and floating-point types of libultra.
unsigned int u32
Definition ultratypes.h:20
unsigned short u16
Definition ultratypes.h:19
int s32
Definition ultratypes.h:25
unsigned char u8
Definition ultratypes.h:18