Fermeture de la fenêtre quand on a choisi la taille mais problème de segmentation fault

This commit is contained in:
ozvann
2024-11-05 11:55:44 +01:00
parent ebdfe6a5e0
commit 4b41296b30
4 changed files with 17 additions and 12 deletions

View File

@@ -10,31 +10,34 @@
void GererChoixTaille(){
int taillegrille;
int taillegrille = 1;
if(ToucheEnAttente()){
KeySym touchPresse = Touche(); /* Prend en compte la touche presser et renvoie la touche presser */
if(touchPresse == XK_KP_3){
taillegrille = 3;
printf("%d", taillegrille);
FermerGraphique();
} else if(touchPresse == XK_KP_4){
taillegrille = 4;
printf("%d", taillegrille);
FermerGraphique();
} else if(touchPresse == XK_KP_5){
taillegrille = 5;
printf("%d", taillegrille);
FermerGraphique();
} else if(touchPresse == XK_KP_6){
taillegrille = 6;
printf("%d", taillegrille);
FermerGraphique();
} else if(touchPresse == XK_KP_7){
taillegrille = 7;
printf("%d", taillegrille);
FermerGraphique();
} else if(touchPresse == XK_KP_8){
taillegrille = 8;
printf("%d", taillegrille);
FermerGraphique();
} else if(touchPresse == XK_KP_9){
taillegrille = 9;
printf("%d", taillegrille);
FermerGraphique();
}
}
Grille(taillegrille);
if(taillegrille != 1){ /* Prend taillegrille et l'envoie dans le fichier Grille pour initialisation de la grille du jeu */
printf("%d", taillegrille);
Grille(taillegrille);
}
}