summaryrefslogtreecommitdiffstats
path: root/src/game.c
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-09-25 18:39:15 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-09-25 18:39:15 (EDT)
commit2ed3153670ffba9d43f6033ce89dc33c241de193 (patch)
treecd2191e381f72f2938650839962c16fcad6268e2 /src/game.c
parent15f3d1c8385ac7cc2ed3c04bb1e1fb919ba169d1 (diff)
downloadmazefight-2ed3153670ffba9d43f6033ce89dc33c241de193.zip
mazefight-2ed3153670ffba9d43f6033ce89dc33c241de193.tar.gz
mazefight-2ed3153670ffba9d43f6033ce89dc33c241de193.tar.bz2
tk: Define colors within local header
Diffstat (limited to 'src/game.c')
-rw-r--r--src/game.c23
1 files changed, 5 insertions, 18 deletions
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();