From 2ed3153670ffba9d43f6033ce89dc33c241de193 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 25 Sep 2021 18:39:15 -0400 Subject: tk: Define colors within local header --- (limited to 'src/game.c') diff --git a/src/game.c b/src/game.c index faf2beb..e544aa1 100644 --- a/src/game.c +++ b/src/game.c @@ -50,17 +50,15 @@ _mf_game_exit(void *user_data __attribute__((__unused__))) static struct mftk_widget * _mf_game_form(SDL_Renderer *renderer, TTF_Font *text_font, - SDL_Color *text_color, SDL_Color *butn_color, struct _mf_game *game) { game->timer = mftk_text_new('\0', '\0', 5, "00:00", text_font, - text_color, SDL_FALSE, NULL, NULL, NULL, NULL); + SDL_FALSE, NULL, NULL, NULL, NULL); return mftk_grid_new(2, 1, MF_ROW_M, MF_COL_M, game->timer, MFTK_GRID_HALIGN_R|MFTK_GRID_VALIGN_T, - mftk_button_new(text_font, "Exit", text_color, - butn_color, MF_BTN_P, &_mf_game_exit, NULL, - renderer), + mftk_button_new(text_font, "Exit", MF_BTN_P, + &_mf_game_exit, NULL, renderer), MFTK_GRID_HALIGN_R|MFTK_GRID_VALIGN_B ); } @@ -146,9 +144,6 @@ mf_game(long seed, int size, int fow, int reveal, int enemies, SDL_Color maze_color; char *font_path = NULL; TTF_Font *text_font = NULL; - SDL_Color form_color; - SDL_Color text_color; - SDL_Color butn_color; struct _mf_game game; struct mftk_window *win = NULL; int fr; @@ -199,19 +194,11 @@ mf_game(long seed, int size, int fow, int reveal, int enemies, free(font_path); font_path = NULL; - form_color.r = MF_COLOR_FORM_R, form_color.g = MF_COLOR_FORM_G; - form_color.b = MF_COLOR_FORM_B, form_color.a = MF_COLOR_FORM_A; - text_color.r = MF_COLOR_FORE_R, text_color.g = MF_COLOR_FORE_G; - text_color.b = MF_COLOR_FORE_B, text_color.a = MF_COLOR_FORE_A; - butn_color.r = MF_COLOR_BUTN_R, butn_color.g = MF_COLOR_BUTN_G; - butn_color.b = MF_COLOR_BUTN_B, butn_color.a = MF_COLOR_BUTN_A; - win = mftk_window_new(MF_WINDOW_H, 0, mftk_box_new( MF_WINDOW_W - MF_WINDOW_H, MF_WINDOW_H, MF_WINDOW_W - MF_WINDOW_H, MF_WINDOW_H, - MF_FORM_P, &form_color, - _mf_game_form(renderer, text_font, - &text_color, &butn_color, &game))); + MF_FORM_P, + _mf_game_form(renderer, text_font, &game))); game.beg = SDL_GetTicks(); -- cgit v0.9.1