From 729b886dc0715c3ea54f377372fc886dc978add0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFg=20Le=20Moigne?= <lenaig.le-moigne@insa-rennes.fr> Date: Sun, 15 May 2016 22:52:55 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20la=20vision=20du=20nombre=20de=20d?= =?UTF-8?q?=C3=A9placement=20restant=20par=20personnage.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/affichage.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/affichage.c b/src/affichage.c index 40ce8ab..b232cca 100644 --- a/src/affichage.c +++ b/src/affichage.c @@ -694,6 +694,7 @@ int affichage_carte() SDL_Surface* bouton1 = NULL; SDL_Surface* bouton2 = NULL; SDL_Surface* personnage_numero = NULL; + SDL_Surface* nombre_deplacement = NULL; SDL_Rect pos_perso; SDL_Rect pos_PV; SDL_Rect pos_mana; @@ -702,6 +703,7 @@ int affichage_carte() SDL_Rect pos_bouton1; SDL_Rect pos_bouton2; SDL_Rect pos_personnage_numero; + SDL_Rect pos_nombre_deplacement; TTF_Font *vieille_police = NULL; TTF_Font *police_arial = NULL; @@ -718,13 +720,15 @@ int affichage_carte() bouton1= TTF_RenderText_Shaded(vieille_police, "Perso suivant", couleurDoree, couleurBleue); bouton2= TTF_RenderText_Shaded(vieille_police, "Joueur suivant", couleurDoree, couleurBleue); - char buffer_PV[30]; + char buffer_PV[40]; sprintf(buffer_PV, "PV: %d/%d", obtenirPVPersonnage(perso_actuel),obtenirPVMaxPersonnage(perso_actuel)); PV=TTF_RenderText_Shaded(vieille_police, buffer_PV, couleurBlanche, couleurNoire); sprintf(buffer_PV, "Mana: %d/%d", obtenirManaPersonnage(perso_actuel),obtenirManaMaxPersonnage(perso_actuel)); mana=TTF_RenderText_Shaded(vieille_police, buffer_PV, couleurBlanche, couleurNoire); sprintf(buffer_PV, "Personnage %d", perso_actuel-NB_PERSO); personnage_numero=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); + sprintf(buffer_PV, "Deplacement : %d", obtenirPDPersonnage(perso_actuel)); + nombre_deplacement=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); pos_texte.x=ecran->w-(LARGEUR_BORDURE+texte->w)/2; pos_texte.y=20; @@ -742,6 +746,8 @@ int affichage_carte() pos_perso.y=pos_mana.y+(2*mana->h); pos_personnage_numero.x=ecran->w-(LARGEUR_BORDURE+mana->w)/2.4; pos_personnage_numero.y=pos_perso.y+(2*PV->h); + pos_nombre_deplacement.x=ecran->w-(LARGEUR_BORDURE+mana->w)/2.4; + pos_nombre_deplacement.y=pos_personnage_numero.y+(2*PV->h); for(i=0; i<LARGEUR_CARTE; i++) { @@ -801,6 +807,7 @@ int affichage_carte() } Position_Case_brillante=Position_Case[0][0]; + while(etat!=FERMER) { SDL_WaitEvent(&event); @@ -896,6 +903,8 @@ int affichage_carte() { SDL_BlitSurface(persos[i],NULL,ecran,&Position_Perso[i]); } + sprintf(buffer_PV, "Deplacement : %d", obtenirPDPersonnage(perso_actuel)); + nombre_deplacement=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); SDL_BlitSurface(perso_select,NULL,ecran,&Position_Perso[perso_actuel-1]); SDL_BlitSurface(Case_brillante,NULL,ecran,&Position_Case_brillante); SDL_BlitSurface(PV,NULL,ecran,&pos_PV); @@ -906,6 +915,7 @@ int affichage_carte() SDL_BlitSurface(mana,NULL,ecran,&pos_mana); SDL_BlitSurface(perso,NULL,ecran,&pos_perso); SDL_BlitSurface(personnage_numero,NULL,ecran,&pos_personnage_numero); + SDL_BlitSurface(nombre_deplacement,NULL,ecran,&pos_nombre_deplacement); SDL_Flip(ecran); } @@ -932,6 +942,7 @@ int affichage_carte() SDL_FreeSurface(PV); SDL_FreeSurface(ecran); SDL_FreeSurface(personnage_numero); + SDL_FreeSurface(nombre_deplacement); TTF_CloseFont(vieille_police); TTF_CloseFont(police_arial); -- GitLab