Back to shtanton's homepage
summaryrefslogtreecommitdiff
path: root/src/types.c
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2025-04-06 18:19:16 +0100
committerCharlie Stanton <charlie@shtanton.xyz>2025-04-06 18:19:16 +0100
commit133d07d5e7781c86cc11cd86e80ad1ff5325fc36 (patch)
treea295229e8a57889fbae232ba4f191dbf1bf4b927 /src/types.c
parentc8260245622780be003a897464bd5f7798b3a307 (diff)
downloadldjam57-133d07d5e7781c86cc11cd86e80ad1ff5325fc36.tar
add nelson transparency
Diffstat (limited to 'src/types.c')
-rw-r--r--src/types.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/types.c b/src/types.c
index d2a7575..fdb9aa0 100644
--- a/src/types.c
+++ b/src/types.c
@@ -15,10 +15,16 @@ typedef struct {
} 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,