aboutsummaryrefslogtreecommitdiff
path: root/src/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/debug.c b/src/debug.c
index f232490..f9248c1 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -19,7 +19,7 @@ struct pw_debug *pw_debug_init(SDL_Renderer *renderer) {
SDL_Palette *palette = NULL;
SDL_Surface *surface = NULL;
- union pw_png_pixel *image = NULL;
+ pw_png image = NULL;
SDL_Texture *font = NULL;
struct pw_debug *debug = NULL;
@@ -47,10 +47,14 @@ struct pw_debug *pw_debug_init(SDL_Renderer *renderer) {
if (!image) {
goto error;
}
+
union pw_png_pixel mask = {.ch = {0xff, 0xff, 0xff, 0x00}};
uint8_t *pixels = surface->pixels;
for (size_t i = 0; i < PW_FONT_WIDTH * PW_FONT_HEIGHT; ++i) {
- pixels[i] = !!(image[i].raw & mask.raw);
+ union pw_png_pixel px;
+ pw_png_pixel(image, i, &px);
+
+ pixels[i] = !!(px.raw & mask.raw);
}
SDL_free(image);
image = NULL;