2022-12-01 23:45:25 +01:00
|
|
|
#include<stdio.h>
|
|
|
|
#include<stdlib.h>
|
|
|
|
#include<graph.h>
|
|
|
|
#include"../include/main.h"
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
zone zone;
|
2022-12-03 20:11:17 +01:00
|
|
|
int displayed, found, loaded, id;
|
2022-12-01 23:45:25 +01:00
|
|
|
char *file;
|
|
|
|
} card;
|
|
|
|
|
2022-12-03 20:23:42 +01:00
|
|
|
void 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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void show_card(card carte) {
|
|
|
|
if (!carte.loaded) 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;
|
|
|
|
}
|
|
|
|
|
|
|
|
card create_card(int x, int y, int L, int H, int id, char *file) {
|
2022-12-01 23:45:25 +01:00
|
|
|
zone zone = {x, y, L, H};
|
2022-12-03 20:23:42 +01:00
|
|
|
card carte = {zone, 0, 0, 0, id, file};
|
2022-12-01 23:45:25 +01:00
|
|
|
DessinerRectangle(carte.zone.x, carte.zone.y, carte.zone.L, carte.zone.H);
|
|
|
|
return carte;
|
|
|
|
}
|