diff options
-rw-r--r-- | src/defs.h | 1 | ||||
-rw-r--r-- | src/splash.c | 22 |
2 files changed, 20 insertions, 3 deletions
@@ -34,6 +34,7 @@ #define MF_SPLASH_LBL_M 8 /* Margin between radio buttons and labels */ #define MF_SPLASH_BOX_W 16 /* Radio button and check box width */ #define MF_SPLASH_BOX_P 2 /* Radio button and check box padding */ +#define MF_SPLASH_BTN_M 8 /* Margin between buttons */ #define MF_SPLASH_BTN_P 8 /* Button padding */ #define MF_SPLASH_TITLE_FONT_S 48 /* Title font size */ #define MF_SPLASH_TEXT_FONT_S 16 /* Regular text font size */ diff --git a/src/splash.c b/src/splash.c index dee2eb2..40d9f1e 100644 --- a/src/splash.c +++ b/src/splash.c @@ -29,6 +29,13 @@ #include "util.h" static int +_mf_splash_quit(void *user_data) +{ + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Quitting"); + return 0; +} + +static int _mf_splash_play(void *user_data) { SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Playing"); @@ -83,9 +90,18 @@ mf_splash(SDL_Renderer *renderer) mftk_grid_new(2, 1, MF_SPLASH_TITLE_M, 0, mftk_label_new(title_font, "Maze Fight", &text_color, renderer), - mftk_button_new(text_font, "Play", &text_color, - &butn_color, 2, &_mf_splash_play, NULL, - renderer) + mftk_grid_new(1, 2, 0, MF_SPLASH_BTN_M, + mftk_button_new(text_font, "Quit", + &text_color, &butn_color, + MF_SPLASH_BTN_P, + &_mf_splash_quit, NULL, + renderer), + mftk_button_new(text_font, "Play", + &text_color, &butn_color, + MF_SPLASH_BTN_P, + &_mf_splash_play, NULL, + renderer) + ) ) ); /* TODO: Widgets */ |