From 5ece1b70c4621235a3d1f197f434c6d875a05997 Mon Sep 17 00:00:00 2001 From: Lyanis Souidi Date: Sat, 3 Dec 2022 23:20:25 +0100 Subject: [PATCH] Modification des fonctions load_card et show_card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Les fonctions load_card() et show_card() retrournent désormais la carte édité pour prendre en compte les modifications de variables dans la structure. --- include/card.h | 4 ++-- src/card.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) 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) {