From 133d07d5e7781c86cc11cd86e80ad1ff5325fc36 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Sun, 6 Apr 2025 18:19:16 +0100 Subject: add nelson transparency --- src/types.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/types.c') diff --git a/src/types.c b/src/types.c index d2a7575..fdb9aa0 100644 --- a/src/types.c +++ b/src/types.c @@ -14,11 +14,17 @@ typedef struct { unsigned char r, g, b, a; } Color; +typedef struct { + char index; + unsigned char opacity; + char padding[2]; +} ImageRef; + typedef struct { int x, y, w, h; Color fill; Color border; - int image; + ImageRef image; } DrawElement; typedef struct { @@ -63,6 +69,14 @@ enum { N_IMAGES, }; +static const char colorImages[N_COLORS] = { + [RED] = IMAGE_NELSON, + [RED_LEFT] = IMAGE_NELSON_LEFT, + [RED_UP] = IMAGE_NELSON_UP, + [RED_RIGHT] = IMAGE_NELSON_RIGHT, + [RED_DOWN] = IMAGE_NELSON_DOWN, +}; + enum { BUTTON_BACK, BUTTON_RETRY, -- cgit v1.2.3