From cd7270813b3057d143074c625e8e7e8c8571ec9e Mon Sep 17 00:00:00 2001 From: Henri Montjoie <henri.montjoie@insa-rennes.fr> Date: Mon, 16 May 2016 11:39:00 +0200 Subject: [PATCH] encore une amelioration de l'esthetisme =) --- src/affichage.c | 66 ++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/src/affichage.c b/src/affichage.c index 1ef1b0e..e7c76ae 100644 --- a/src/affichage.c +++ b/src/affichage.c @@ -721,35 +721,15 @@ int affichage_carte() bouton2= TTF_RenderText_Shaded(vieille_police, "Joueur suivant", couleurDoree, couleurBleue); 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, "PV : %d/%d", obtenirPVPersonnage(perso_actuel),obtenirPVMaxPersonnage(perso_actuel)); + PV=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); + sprintf(buffer_PV, "Mana : %d/%d", obtenirManaPersonnage(perso_actuel),obtenirManaMaxPersonnage(perso_actuel)); + mana=TTF_RenderText_Shaded(police_arial, 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; - pos_nom_joueur.x=ecran->w-(LARGEUR_BORDURE+nom_joueur->w)/2; - pos_nom_joueur.y=pos_texte.y+(3*texte->h)/2; - pos_bouton2.x=ecran->w-(LARGEUR_BORDURE+bouton2->w)/2; - pos_bouton2.y=ecran->h-bouton2->h-40; - pos_bouton1.x=ecran->w-(LARGEUR_BORDURE+bouton1->w)/2; - pos_bouton1.y=pos_bouton2.y-(2*bouton2->h); - pos_PV.x=ecran->w-(LARGEUR_BORDURE+PV->w)/2; - pos_PV.y=pos_nom_joueur.y+(2*nom_joueur->h); - pos_mana.x=ecran->w-(LARGEUR_BORDURE+mana->w)/2.1; - pos_mana.y=pos_PV.y+(2*PV->h); - pos_perso.x=ecran->w-(LARGEUR_BORDURE+texte->w)/2.7; - pos_perso.y=pos_mana.y+(1*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+(1.1*PV->h); - pos_nombre_deplacement.y=pos_personnage_numero.y+(1*PV->h); - for(i=0; i<LARGEUR_CARTE; i++) { for(j=0; j<HAUTEUR_CARTE; j++) @@ -793,6 +773,25 @@ int affichage_carte() } SDL_SetColorKey(Case_brillante, SDL_SRCCOLORKEY, SDL_MapRGB(Case_brillante->format, 0, 0, 255)); + pos_texte.x=ecran->w-(LARGEUR_BORDURE+texte->w)/2; + pos_texte.y=20; + pos_nom_joueur.x=ecran->w-(LARGEUR_BORDURE+nom_joueur->w)/2; + pos_nom_joueur.y=pos_texte.y+(3*texte->h)/2; + pos_perso.x=ecran->w-(LARGEUR_BORDURE+perso->w)/2; + pos_perso.y=ecran->h/4; + pos_personnage_numero.x=ecran->w-(LARGEUR_BORDURE+personnage_numero->w)/2; + pos_personnage_numero.y=pos_perso.y+perso->h; + pos_PV.x=ecran->w-(LARGEUR_BORDURE-25); + pos_PV.y=pos_personnage_numero.y+(5*PV->h)/2; + pos_mana.x=ecran->w-(LARGEUR_BORDURE-25); + pos_mana.y=pos_PV.y+(3*PV->h)/2; + pos_nombre_deplacement.x=ecran->w-(LARGEUR_BORDURE-25); + pos_nombre_deplacement.y=pos_mana.y+(3*PV->h)/2; + pos_bouton2.x=ecran->w-(LARGEUR_BORDURE-25); + pos_bouton2.y=ecran->h-bouton2->h-40; + pos_bouton1.x=ecran->w-(LARGEUR_BORDURE-25); + pos_bouton1.y=pos_bouton2.y-(2*bouton2->h); + for(j=0; j<HAUTEUR_CARTE; j++) { for(i=0; i<LARGEUR_CARTE; i+=2) @@ -808,7 +807,6 @@ int affichage_carte() } Position_Case_brillante=Position_Case[0][0]; - while(etat!=FERMER) { SDL_WaitEvent(&event); @@ -821,10 +819,10 @@ int affichage_carte() if(event.button.y>pos_bouton1.y&&event.button.y<pos_bouton1.y+bouton1->h&&event.button.x>LARGEUR_CARTE*LARGEUR_CASE) { perso_actuel=perso_suivant(perso_actuel); - 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, "PV : %d/%d", obtenirPVPersonnage(perso_actuel),obtenirPVMaxPersonnage(perso_actuel)); + PV=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); + sprintf(buffer_PV, "Mana : %d/%d", obtenirManaPersonnage(perso_actuel),obtenirManaMaxPersonnage(perso_actuel)); + mana=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); if(perso_actuel <=3){ sprintf(buffer_PV, "Personnage %d", perso_actuel); @@ -841,10 +839,10 @@ int affichage_carte() debutDuTour(); nom_joueur= TTF_RenderText_Shaded(vieille_police, obtenirNomJoueurCourant(), couleurBlanche, couleurNoire); perso_actuel=actualiser_num_perso(perso_actuel); - 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, "PV : %d/%d", obtenirPVPersonnage(perso_actuel),obtenirPVMaxPersonnage(perso_actuel)); + PV=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); + sprintf(buffer_PV, "Mana : %d/%d", obtenirManaPersonnage(perso_actuel),obtenirManaMaxPersonnage(perso_actuel)); + mana=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); if(perso_actuel <=3){ sprintf(buffer_PV, "Personnage %d", perso_actuel); @@ -904,7 +902,7 @@ int affichage_carte() { SDL_BlitSurface(persos[i],NULL,ecran,&Position_Perso[i]); } - sprintf(buffer_PV, "Deplacement : %d", obtenirPDPersonnage(perso_actuel)); + sprintf(buffer_PV, "Deplacements : %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); -- GitLab