From 347813350f6f051b49187f020eb91f3ffc65f951 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Wed, 7 Jan 2015 14:18:29 +0100 Subject: simplify the code of menuchoixpersos Signed-off-by: Olivier Gayot --- menuchoixpersos.c | 44 +++++++++++++------------------------------- prototypes.h | 1 - 2 files changed, 13 insertions(+), 32 deletions(-) diff --git a/menuchoixpersos.c b/menuchoixpersos.c index cc217a8..2d20ef2 100644 --- a/menuchoixpersos.c +++ b/menuchoixpersos.c @@ -65,34 +65,26 @@ void Fmenuchoixpersos (SURFACES *surfaces, POSITIONS *positions) { case SDLK_LEFT: case SDLK_h: - if(Vchoix>PALADIN) - { - Vchoix--; + if (Vchoix > PALADIN) { + Vchoix--; + } else { + Vchoix=VOLEUR; + } Fchangersurlignage2 (Vchoix,surfaces,positions); - } - else - { - Vchoix=VOLEUR; - Fchangersurlignage2 (Vchoix,surfaces,positions); - } - break; + + break; case SDLK_RIGHT: case SDLK_l: - if (VchoixPecran); } -void Fremplirpersos (int Vchoix, PERSONNAGES persos[],int Vnbpersos) -{ - if (Vchoix==PALADIN) - persos[Vnbpersos].classe=PALADIN; - else if (Vchoix==PRETRE) - persos[Vnbpersos].classe=PRETRE; - else if (Vchoix==VOLEUR) - persos[Vnbpersos].classe=VOLEUR; -} - void Fremplirpersos2 (SURFACES *surfaces, PERSONNAGES persos[]) { diff --git a/prototypes.h b/prototypes.h index b6401b9..65591db 100644 --- a/prototypes.h +++ b/prototypes.h @@ -6,7 +6,6 @@ void Fchangersurlignage (int Vmode, SURFACES *surfaces, POSITIONS *positions); int Fentrermode (int Vmode, SURFACES *surfaces, POSITIONS *positions); void Fmenuchoixpersos (SURFACES *surfaces, POSITIONS *positions); void Fchangersurlignage2 (int Vperso, SURFACES *surfaces, POSITIONS *positions); -void Fremplirpersos (int Vperso, PERSONNAGES persos[],int Vnbpersos); void Fremplirpersos2 (SURFACES *surfaces, PERSONNAGES persos[]); int Fjouer (SURFACES *surfaces, POSITIONS *positions, PERSONNAGES persos[],ENNEMIS ennemis[]); void Fblitterpersos (SURFACES *surfaces, POSITIONS *positions, PERSONNAGES persos[]); -- cgit v1.2.3