Presque fini
This commit is contained in:
+10
-5
@@ -1,7 +1,9 @@
|
||||
#include "menu_view.h"
|
||||
#include "defs.h"
|
||||
#include <graph.h>
|
||||
#include <stdio.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define IMG_PREVIEW_SIZE 150
|
||||
#define IMG_START_X 50
|
||||
@@ -37,6 +39,9 @@ void menu_render(const menu_state_t *state)
|
||||
couleur C_START = CouleurParNom("green");
|
||||
char buffer[50];
|
||||
|
||||
char path_buffer[30];
|
||||
const char *path_fixed = "assets/spiderman.jpg"; /* FIXE LE CHEMIN */
|
||||
|
||||
EffacerEcran(C_FOND);
|
||||
ChoisirCouleurDessin(C_TEXTE);
|
||||
|
||||
@@ -46,11 +51,10 @@ void menu_render(const menu_state_t *state)
|
||||
for (i = 0; i < NUM_IMAGES; i++) {
|
||||
int x = IMG_START_X + i * IMG_SPACING;
|
||||
int y = IMG_START_Y;
|
||||
char path[30];
|
||||
|
||||
sprintf(path, "assets/image%d.png", i + 1);
|
||||
strcpy(path_buffer, path_fixed);
|
||||
|
||||
ChargerImage(path, x, y, 0, 0, IMG_PREVIEW_SIZE, IMG_PREVIEW_SIZE);
|
||||
ChargerImage(path_buffer, x, y, 0, 0, IMG_PREVIEW_SIZE, IMG_PREVIEW_SIZE);
|
||||
|
||||
if (state->selected_image == i) {
|
||||
ChoisirCouleurDessin(C_SELECTION);
|
||||
@@ -107,7 +111,8 @@ void menu_handle_mouse_click(menu_state_t *state)
|
||||
}
|
||||
}
|
||||
|
||||
if (is_in_rect(x_click, y_click, dim_section_x + button_l_offset, DIM_START_Y + 30, btn_size, btn_size)) {
|
||||
|
||||
if (is_in_rect(x_click, y_click, dim_section_x + button_l_offset, DIM_START_Y + 30, btn_size, btn_size)) {
|
||||
if (state->rows < MAX_DIMENSION) state->rows++;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user