diff --git a/src/affichage.c b/src/affichage.c index 40ce8ab45ff7873f15666377c3c990b07083cba1..b232cca736c23cc93b266e80bba372389706123b 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);