Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
Loading...
Searching...
No Matches
wsg.h
Go to the documentation of this file.
1
46#ifndef _WSG_H_
47#define _WSG_H_
48
49#include <stdint.h>
50#include <palette.h>
51#include <stdbool.h>
52
56typedef struct
57{
59 uint16_t w;
60 uint16_t h;
61} wsg_t;
62
63void rotatePixel(int16_t* x, int16_t* y, int16_t rotateDeg, int16_t width, int16_t height);
64void drawWsg(const wsg_t* wsg, int16_t xOff, int16_t yOff, bool flipLR, bool flipUD, int16_t rotateDeg);
65void drawWsgSimple(const wsg_t* wsg, int16_t xOff, int16_t yOff);
66void drawWsgSimpleScaled(const wsg_t* wsg, int16_t xOff, int16_t yOff, int16_t xScale, int16_t yScale);
67void drawWsgTile(const wsg_t* wsg, int32_t xOff, int32_t yOff);
68void drawWsgSimpleHalf(const wsg_t* wsg, int16_t xOff, int16_t yOff);
69
70#endif
paletteColor_t
All 216 possible colors, named like cRGB.
Definition palette.h:23
paletteColor_t * px
The row-order array of pixels in the image.
Definition wsg.h:58
void drawWsgSimpleScaled(const wsg_t *wsg, int16_t xOff, int16_t yOff, int16_t xScale, int16_t yScale)
Draw a WSG to the display without flipping or rotation.
Definition wsg.c:330
void rotatePixel(int16_t *x, int16_t *y, int16_t rotateDeg, int16_t width, int16_t height)
Definition wsg.c:27
void drawWsgSimple(const wsg_t *wsg, int16_t xOff, int16_t yOff)
Draw a WSG to the display without flipping or rotation.
Definition wsg.c:280
uint16_t w
The width of the image.
Definition wsg.h:59
uint16_t h
The height of the image.
Definition wsg.h:60
void drawWsg(const wsg_t *wsg, int16_t xOff, int16_t yOff, bool flipLR, bool flipUD, int16_t rotateDeg)
Draw a WSG to the display.
Definition wsg.c:105
void drawWsgSimpleHalf(const wsg_t *wsg, int16_t xOff, int16_t yOff)
Draw a WSG to the display without flipping or rotation at half size.
Definition wsg.c:401
void drawWsgTile(const wsg_t *wsg, int32_t xOff, int32_t yOff)
Quickly copy a WSG to the display without flipping or rotation or transparency.
Definition wsg.c:451
A sprite using paletteColor_t colors that can be drawn to the display.
Definition wsg.h:57