diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d27207..98adcb5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ set(ASSETS_cg assets-cg/planes.png assets-cg/map.png assets-cg/message.png + assets-cg/grid.png assets-cg/mutations.png assets-cg/cursor.png assets-cg/title.png diff --git a/assets-cg/cursor.png b/assets-cg/cursor.png index c16cb9b..4e1f3ca 100644 Binary files a/assets-cg/cursor.png and b/assets-cg/cursor.png differ diff --git a/assets-cg/grid.png b/assets-cg/grid.png new file mode 100644 index 0000000..7d1b608 Binary files /dev/null and b/assets-cg/grid.png differ diff --git a/assets-cg/infos.png b/assets-cg/infos.png new file mode 100644 index 0000000..92f657d Binary files /dev/null and b/assets-cg/infos.png differ diff --git a/assets-cg/mutations.png b/assets-cg/mutations.png index 8ebacb6..57b4e39 100644 Binary files a/assets-cg/mutations.png and b/assets-cg/mutations.png differ diff --git a/src/core.c b/src/core.c index 5c8fb97..585492f 100644 --- a/src/core.c +++ b/src/core.c @@ -99,17 +99,17 @@ int get_inputs(const int background, int *mutation_menu, int *boost) if (key == KEY_VARS) { *mutation_menu = 4; - return 3; + return 2; } if (key == KEY_ALPHA) { - if (background == 5) return 3; + if (background == 4) return 2; else return 1; } if (key == KEY_EXIT && background == 1) return -1; - if (background == 3) + if (background == 2) { switch (key) { @@ -128,7 +128,7 @@ int get_inputs(const int background, int *mutation_menu, int *boost) // Validation case KEY_SHIFT: if (*mutation_menu == 4) return 1; - else return 5; + else return 4; break; } } diff --git a/src/display_engine.c b/src/display_engine.c index b6afbdc..1d8c066 100644 --- a/src/display_engine.c +++ b/src/display_engine.c @@ -18,6 +18,7 @@ void display_background(const int background) extern const bopti_image_t img_map; extern const bopti_image_t img_message; + extern const bopti_image_t img_grid; switch(background) { case 1: @@ -28,6 +29,7 @@ void display_background(const int background) case 3: break; case 4: + dimage(0, 0, &img_grid); break; case 5: dimage(0, 0, &img_message); @@ -108,9 +110,9 @@ void display_foreground(const int background, const struct game *current_game, c dline(57, 60, 57 + length, 60, C_BLACK); dline(57, 61, 57 + length, 61, C_BLACK); - if (current_game->mutations_selected[0]) dsubimage(7, 15, &img_mutations, 0, 16 * (current_game->mutations_selected[0] - 1), 15, 15, 0); - if (current_game->mutations_selected[1]) dsubimage(37, 15, &img_mutations, 16, 16 * (current_game->mutations_selected[1] - 1), 15, 15, 0); - if (current_game->mutations_selected[2]) dsubimage(67, 15, &img_mutations, 32, 16 * (current_game->mutations_selected[2] - 1), 15, 15, 0); + if (current_game->mutations_selected[0]) dsubimage(7, 15, &img_mutations, 0, 44 * (current_game->mutations_selected[0] - 1), 44, 44, 0); + if (current_game->mutations_selected[1]) dsubimage(37, 15, &img_mutations, 44, 44 * (current_game->mutations_selected[1] - 1), 44, 44, 0); + if (current_game->mutations_selected[2]) dsubimage(67, 15, &img_mutations, 88, 44 * (current_game->mutations_selected[2] - 1), 44, 44, 0); break; } } @@ -123,14 +125,15 @@ void display_mutation(const int table[4][8], const struct cursor c, const int mu dclear(C_WHITE); display_background(4); + dprint(106,14,C_WHITE,"test menu"); for (int i = 0 ; i < 4 ; i++) { for (int j = 0 ; j < 8; j++) { - if (table[i][j]) dsubimage(j*16, i*16, &img_mutations, 16 * (mutation_menu - 1), 16 * (table[i][j] - 1), 15, 15, DIMAGE_NONE); + if (table[i][j]) dsubimage(j*44+22, i*44+46, &img_mutations, 44 * (mutation_menu - 1), 44 * (table[i][j] - 1), 44, 44, DIMAGE_NONE); } } - dsubimage((16 * c.x) - 1, (16 * c.y) - 1, &img_cursor, 0, 17 * (c.display), 17, 17, DIMAGE_NONE); + dsubimage((44 * c.x)+22, (44 * c.y)+46, &img_cursor, 0, 44 * (c.display), 44, 44, DIMAGE_NONE); dupdate(); } @@ -147,7 +150,7 @@ void display_mutation_buy(const struct cursor c, const int mutation_menu, const dclear(C_WHITE); display_background(3); - dsubimage(3, 21, &img_mutations, 16 * (mutation_menu - 1), 16 * (id - 1), 15, 15, DIMAGE_NONE); + dsubimage(3, 21, &img_mutations, 44 * (mutation_menu - 1), 44 * (id - 1), 44, 44, DIMAGE_NONE); dprint(47, 25, C_BLACK, mutation_data->name); if (!current_game->mutations_bought[mutation_menu - 1][id - 1]) dprint(81, 33, C_BLACK, "%d", mutation_data->dna); @@ -172,7 +175,7 @@ void display_mutation_description(const char *name, const char *description, con dclear(C_WHITE); display_background(6); - dsubimage(3, 21, &img_mutations, 16 * (mutation_menu - 1), 16 * (id - 1), 15, 15, DIMAGE_NONE); + dsubimage(3, 21, &img_mutations, 44 * (mutation_menu - 1), 44 * (id - 1), 44, 44, DIMAGE_NONE); dprint(47, 25, C_BLACK, name); for (int i = 0; i < 4; i ++)