Skip to content
Snippets Groups Projects
Commit 9169eaa4 authored by Lénaïg Le Moigne's avatar Lénaïg Le Moigne
Browse files
# Conflicts:
#	src/affichage.c
parents bc0da7be 1e13a4ec
No related branches found
No related tags found
No related merge requests found
...@@ -679,7 +679,7 @@ int affichage_carte() ...@@ -679,7 +679,7 @@ int affichage_carte()
SDL_Surface* nom_joueur = NULL; SDL_Surface* nom_joueur = NULL;
SDL_Surface* bouton1 = NULL; SDL_Surface* bouton1 = NULL;
SDL_Surface* bouton2 = NULL; SDL_Surface* bouton2 = NULL;
SDL_Surface* perso_x = NULL; SDL_Surface* personnage_numero = NULL;
SDL_Rect pos_PV; SDL_Rect pos_PV;
SDL_Rect pos_mana; SDL_Rect pos_mana;
SDL_Rect pos_texte; SDL_Rect pos_texte;
...@@ -687,7 +687,8 @@ int affichage_carte() ...@@ -687,7 +687,8 @@ int affichage_carte()
SDL_Rect pos_bouton1; SDL_Rect pos_bouton1;
SDL_Rect pos_bouton2; SDL_Rect pos_bouton2;
SDL_Rect pos_perso; SDL_Rect pos_perso;
SDL_Rect pos_perso_x; SDL_Rect pos_personnage_numero;
TTF_Font *vieille_police = NULL; TTF_Font *vieille_police = NULL;
TTF_Font *police_arial = NULL; TTF_Font *police_arial = NULL;
SDL_Color couleurNoire = {0, 0, 0}; SDL_Color couleurNoire = {0, 0, 0};
...@@ -709,7 +710,7 @@ int affichage_carte() ...@@ -709,7 +710,7 @@ int affichage_carte()
sprintf(buffer_PV, "mana: %d/%d", obtenirManaPersonnage(perso_actuel),obtenirManaMaxPersonnage(perso_actuel)); sprintf(buffer_PV, "mana: %d/%d", obtenirManaPersonnage(perso_actuel),obtenirManaMaxPersonnage(perso_actuel));
mana=TTF_RenderText_Shaded(vieille_police, buffer_PV, couleurBlanche, couleurNoire); mana=TTF_RenderText_Shaded(vieille_police, buffer_PV, couleurBlanche, couleurNoire);
sprintf(buffer_PV, "Personnage %d", perso_actuel); sprintf(buffer_PV, "Personnage %d", perso_actuel);
perso_x=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); personnage_numero=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire);
pos_texte.x=ecran->w-(LARGEUR_BORDURE+texte->w)/2; pos_texte.x=ecran->w-(LARGEUR_BORDURE+texte->w)/2;
pos_texte.y=20; pos_texte.y=20;
...@@ -727,8 +728,8 @@ int affichage_carte() ...@@ -727,8 +728,8 @@ int affichage_carte()
pos_perso.x=ecran->w-(LARGEUR_BORDURE+texte->w)/2.7; pos_perso.x=ecran->w-(LARGEUR_BORDURE+texte->w)/2.7;
pos_perso.y=pos_mana.y+(2*mana->h); pos_perso.y=pos_mana.y+(2*mana->h);
pos_perso_x.x=ecran->w-(LARGEUR_BORDURE+mana->w)/2.2; pos_personnage_numero.x=ecran->w-(LARGEUR_BORDURE+mana->w)/2.2;
pos_perso_x.y=pos_perso.y+(2*PV->h); pos_personnage_numero.y=pos_perso.y+(2*PV->h);
for(i=0; i<LARGEUR_CARTE; i++) for(i=0; i<LARGEUR_CARTE; i++)
{ {
...@@ -811,13 +812,15 @@ int affichage_carte() ...@@ -811,13 +812,15 @@ int affichage_carte()
PV=TTF_RenderText_Shaded(vieille_police, buffer_PV, couleurBlanche, couleurNoire); PV=TTF_RenderText_Shaded(vieille_police, buffer_PV, couleurBlanche, couleurNoire);
sprintf(buffer_PV, "mana: %d/%d", obtenirManaPersonnage(perso_actuel),obtenirManaMaxPersonnage(perso_actuel)); sprintf(buffer_PV, "mana: %d/%d", obtenirManaPersonnage(perso_actuel),obtenirManaMaxPersonnage(perso_actuel));
mana=TTF_RenderText_Shaded(vieille_police, buffer_PV, couleurBlanche, couleurNoire); mana=TTF_RenderText_Shaded(vieille_police, buffer_PV, couleurBlanche, couleurNoire);
if(perso_actuel <=3){ if(perso_actuel <=3){
sprintf(buffer_PV, "Personnage %d", perso_actuel); sprintf(buffer_PV, "Personnage %d", perso_actuel);
perso_x=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); personnage_numero=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire);
}else{ }else{
sprintf(buffer_PV, "Personnage %d", perso_actuel-NB_PERSO); sprintf(buffer_PV, "Personnage %d", perso_actuel-NB_PERSO);
perso_x=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); personnage_numero=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire);
} }
perso[perso_actuel]=SDL_LoadBMP(obtenirRessourcePersonnageNum(perso_actuel)); perso[perso_actuel]=SDL_LoadBMP(obtenirRessourcePersonnageNum(perso_actuel));
if (!perso[perso_actuel]) if (!perso[perso_actuel])
{ {
...@@ -836,12 +839,13 @@ int affichage_carte() ...@@ -836,12 +839,13 @@ int affichage_carte()
PV=TTF_RenderText_Shaded(vieille_police, buffer_PV, couleurBlanche, couleurNoire); PV=TTF_RenderText_Shaded(vieille_police, buffer_PV, couleurBlanche, couleurNoire);
sprintf(buffer_PV, "mana: %d/%d", obtenirManaPersonnage(perso_actuel),obtenirManaMaxPersonnage(perso_actuel)); sprintf(buffer_PV, "mana: %d/%d", obtenirManaPersonnage(perso_actuel),obtenirManaMaxPersonnage(perso_actuel));
mana=TTF_RenderText_Shaded(vieille_police, buffer_PV, couleurBlanche, couleurNoire); mana=TTF_RenderText_Shaded(vieille_police, buffer_PV, couleurBlanche, couleurNoire);
if(perso_actuel <=3){ if(perso_actuel <=3){
sprintf(buffer_PV, "Personnage %d", perso_actuel); sprintf(buffer_PV, "Personnage %d", perso_actuel);
perso_x=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); personnage_numero=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire);
}else{ }else{
sprintf(buffer_PV, "Personnage %d", perso_actuel-NB_PERSO); sprintf(buffer_PV, "Personnage %d", perso_actuel-NB_PERSO);
perso_x=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); personnage_numero=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire);
} }
perso[perso_actuel]=SDL_LoadBMP(obtenirRessourcePersonnageNum(perso_actuel)); perso[perso_actuel]=SDL_LoadBMP(obtenirRessourcePersonnageNum(perso_actuel));
...@@ -910,7 +914,7 @@ int affichage_carte() ...@@ -910,7 +914,7 @@ int affichage_carte()
SDL_BlitSurface(bouton2,NULL,ecran,&pos_bouton2); SDL_BlitSurface(bouton2,NULL,ecran,&pos_bouton2);
SDL_BlitSurface(mana,NULL,ecran,&pos_mana); SDL_BlitSurface(mana,NULL,ecran,&pos_mana);
SDL_BlitSurface(perso[perso_actuel],NULL,ecran,&pos_perso); SDL_BlitSurface(perso[perso_actuel],NULL,ecran,&pos_perso);
SDL_BlitSurface(perso_x,NULL,ecran,&pos_perso_x); SDL_BlitSurface(personnage_numero,NULL,ecran,&pos_personnage_numero);
SDL_Flip(ecran); SDL_Flip(ecran);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment