diff options
author | P. J. McDermott <pj@pehjota.net> | 2021-08-10 01:11:56 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2021-08-10 01:11:56 (EDT) |
commit | 24d08e233c162578624a61b708a5e5f1aad057e5 (patch) | |
tree | 586c986db8e818ac590c77e0bc9c5dc747af22bb | |
parent | 36a3deaf433be2c232fa2c9949d6370e4d347052 (diff) | |
download | mazefight-24d08e233c162578624a61b708a5e5f1aad057e5.zip mazefight-24d08e233c162578624a61b708a5e5f1aad057e5.tar.gz mazefight-24d08e233c162578624a61b708a5e5f1aad057e5.tar.bz2 |
menu: Store size by index
-rw-r--r-- | src/menu.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -59,7 +59,7 @@ _mf_menu_size(void *user_data, int state) { struct _mf_menu *menu = (struct _mf_menu *) user_data; - menu->size = MF_MENU_SIZES_[state]; + menu->size = state; return 0; } @@ -96,8 +96,8 @@ _mf_menu_play(void *user_data) struct _mf_menu *menu = (struct _mf_menu *) user_data; int e; - e = mf_game(menu->seed, menu->size, menu->fow, menu->reveal, - menu->renderer); + e = mf_game(menu->seed, MF_MENU_SIZES_[menu->size], menu->fow, + menu->reveal, menu->renderer); menu->seed = rand(); if (sprintf(menu->seed_buf, "%ld", menu->seed) < 0) { @@ -215,7 +215,7 @@ mf_menu(SDL_Renderer *renderer) maze_color.a = MF_COLOR_MAZE_A; menu.seed = rand(); - menu.size = 15; + menu.size = 0; menu.fow = SDL_TRUE; menu.reveal = SDL_FALSE; menu.renderer = renderer; |