Back to shtanton's homepage
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/all.c9
-rw-r--r--src/types.c3
2 files changed, 9 insertions, 3 deletions
diff --git a/src/all.c b/src/all.c
index 028289c..d2536b9 100644
--- a/src/all.c
+++ b/src/all.c
@@ -89,9 +89,14 @@ static const Color colors[N_COLORS][4] = {
},
};
+#define BUTTON_SIZE 32
+#define BUTTON_SPACING 16
+#define BUTTON_SPACER(i) (BUTTON_SPACING + (BUTTON_SIZE * (i) + (i) * BUTTON_SPACING))
+
static const Button buttons[N_BUTTONS] = {
- [BUTTON_RETRY] = {.x = 16, .y = 16, .w = 128, .h = 32},
- [BUTTON_BACK] = {.x = 16, .y = 48, .w = 128, .h = 32},
+ [BUTTON_CONTINUE] = {.x = BUTTON_SPACING, .y = BUTTON_SPACER(BUTTON_CONTINUE), .w = BUTTON_SIZE, .h = BUTTON_SIZE},
+ [BUTTON_RETRY] = {.x = BUTTON_SPACING, .y = BUTTON_SPACER(BUTTON_RETRY), .w = BUTTON_SIZE, .h = BUTTON_SIZE},
+ [BUTTON_BACK] = {.x = BUTTON_SPACING, .y = BUTTON_SPACER(BUTTON_BACK), .w = BUTTON_SIZE, .h = BUTTON_SIZE},
};
static DrawList *render(State *state, UI *ui, Arena *a) {
diff --git a/src/types.c b/src/types.c
index fd8f9ee..8e8ba1d 100644
--- a/src/types.c
+++ b/src/types.c
@@ -7,7 +7,7 @@
#define GRIDWIDTH 20
#define GRIDHEIGHT 16
#define TICK_LENGTH 200
-#define GRID_OFFSET_X 256
+#define GRID_OFFSET_X 64
typedef struct {
unsigned char r, g, b, a;
@@ -47,6 +47,7 @@ enum {
};
enum {
+ BUTTON_CONTINUE,
BUTTON_RETRY,
BUTTON_BACK,
N_BUTTONS,