diff options
Diffstat (limited to 'src/types.c')
-rw-r--r-- | src/types.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/types.c b/src/types.c index fe72e13..cbd9315 100644 --- a/src/types.c +++ b/src/types.c @@ -4,6 +4,7 @@ #define GRIDWIDTH 20 #define GRIDHEIGHT 16 #define TICK_LENGTH 200 +#define GRID_OFFSET_X 256 typedef struct { unsigned char r, g, b, a; @@ -42,15 +43,32 @@ enum { N_COLORS, }; +enum { + BUTTON_RETRY, + BUTTON_BACK, + N_BUTTONS, +}; + typedef struct { int width, height; } UI; +typedef enum { + BUTTON_STATE_IDLE, + BUTTON_STATE_HOVERED, + BUTTON_STATE_PRESSED +} ButtonState; + +typedef struct { + int x, y, w, h; +} Button; + typedef struct { uint64_t lastTick; char playing; int grid[GRIDWIDTH * GRIDHEIGHT]; int goalx, goaly; + ButtonState buttonStates[N_BUTTONS]; } State; // Mirror these in src/index.html.in |