diff --git a/include/card.h b/include/card.h index 75854f3..f5c2d15 100644 --- a/include/card.h +++ b/include/card.h @@ -7,9 +7,9 @@ typedef struct { char *file; } card; -void load_card(card carte); +card load_card(card carte); -void show_card(card carte); +card show_card(card carte); card create_card(int x, int y, int L, int H, int id, char *file); diff --git a/src/card.c b/src/card.c index 54c698e..6a1f8f3 100644 --- a/src/card.c +++ b/src/card.c @@ -9,19 +9,21 @@ typedef struct { char *file; } card; -void load_card(card carte) { +card load_card(card carte) { if (!carte.loaded) { ChoisirEcran(1); ChargerImage(carte.file, carte.zone.x, carte.zone.y, 0, 0, carte.zone.L, carte.zone.H); carte.loaded = 1; ChoisirEcran(0); } + return carte; } -void show_card(card carte) { - if (!carte.loaded) load_card(carte); +card show_card(card carte) { + if (!carte.loaded) carte = load_card(carte); CopierZone(1, 0, carte.zone.x, carte.zone.y, carte.zone.L, carte.zone.H, carte.zone.x, carte.zone.y); carte.displayed = 1; + return carte; } card create_card(int x, int y, int L, int H, int id, char *file) {