Skip to content
Snippets Groups Projects
Commit f01162d1 authored by Montjoie Henri's avatar Montjoie Henri
Browse files

leger changement de la gestion des joueurs

parent 5b62b62b
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -646,7 +646,7 @@ int affichage_carte()
int x=0;
int nombre_classes=nbClasses();
SDL_Event event;
SDL_Surface* ecran=SDL_SetVideoMode(LARGEUR_CARTE*(LARGEUR_CASE+20), HAUTEUR_CARTE*(HAUTEUR_CASE+2), 32, SDL_HWSURFACE|SDL_DOUBLEBUF);;
SDL_Surface* ecran=SDL_SetVideoMode(LARGEUR_CARTE*(LARGEUR_CASE)+LARGEUR_BORDURE, HAUTEUR_CARTE*(HAUTEUR_CASE+2), 32, SDL_HWSURFACE|SDL_DOUBLEBUF);;
SDL_Surface* classes[nombre_classes];
SDL_Surface* cases[HAUTEUR_CARTE][LARGEUR_CARTE];
SDL_Surface* persos[NB_PERSO*NB_JOUEURS];
......@@ -669,33 +669,29 @@ int affichage_carte()
SDL_Rect pos_texte3;
SDL_Rect pos_texte4;
TTF_Font *police = NULL;
TTF_Font *petite_police = NULL;
TTF_Font *mini_police = NULL;
TTF_Font *vieille_police = NULL;
SDL_Color couleurNoire = {0, 0, 0};
SDL_Color couleurBlanche = {255, 255, 255};
SDL_Color couleurBleue = {10, 30, 80};
SDL_Color couleurDoree = {190, 190, 120};
police=TTF_OpenFont("../resources/fonts/OLDENGL.ttf",46);
petite_police=TTF_OpenFont("../resources/fonts/arial.ttf",32);
mini_police=TTF_OpenFont("../resources/fonts/arial.ttf",25);
texte= TTF_RenderText_Shaded(police, "Joueur actuel", couleurBlanche,couleurNoire);
texte2= TTF_RenderText_Shaded(petite_police, nom_1, couleurBlanche, couleurNoire);
texte3= TTF_RenderText_Shaded(petite_police, nom_2, couleurBlanche, couleurNoire);
texte4= TTF_RenderText_Shaded(mini_police, "Joueur suivant", couleurBlanche, couleurNoire);
vieille_police=TTF_OpenFont("../resources/fonts/OLDENGL.ttf",28);
police=TTF_OpenFont("../resources/fonts/arial.ttf",27);
pos_texte.x=ecran->w/1.15-texte->w/2;
pos_texte.y=10;
pos_texte2.x=pos_texte.x-(texte2->w-texte->w)/2;
pos_texte2.y=pos_texte.y+(3*texte2->h)/2;
pos_texte3.x=pos_texte.x-(texte3->w-texte->w)/2;
pos_texte3.y=pos_texte.y+(3*texte3->h)/2;
pos_texte4.x=pos_texte.x-(texte4->w-texte->w)/2;
pos_texte4.y=pos_texte.y+(3*texte4->h)/0.8;
texte= TTF_RenderText_Shaded(vieille_police, "Joueur actuel :", couleurBlanche,couleurNoire);
texte2= TTF_RenderText_Shaded(vieille_police, nom_1, couleurBlanche, couleurNoire);
texte3= TTF_RenderText_Shaded(police, "Perso suivant", couleurDoree, couleurBleue);
texte4= TTF_RenderText_Shaded(police, "Joueur suivant", couleurDoree, couleurBleue);
pos_texte.x=ecran->w-(LARGEUR_BORDURE+texte->w)/2;
pos_texte.y=15;
pos_texte2.x=ecran->w-(LARGEUR_BORDURE+texte2->w)/2;
pos_texte2.y=pos_texte.y+(3*texte->h)/2;
pos_texte4.x=ecran->w-(LARGEUR_BORDURE+texte4->w)/2;
pos_texte4.y=ecran->h-texte4->h-15;
pos_texte3.x=ecran->w-(LARGEUR_BORDURE+texte3->w)/2;
pos_texte3.y=pos_texte4.y-(3*texte4->h)/2;
for(i=0; i<LARGEUR_CARTE; i++)
{
......@@ -829,6 +825,7 @@ int affichage_carte()
SDL_BlitSurface(texte,NULL,ecran,&pos_texte);
SDL_BlitSurface(texte2,NULL,ecran,&pos_texte2);
SDL_BlitSurface(texte3,NULL,ecran,&pos_texte3);
SDL_BlitSurface(texte4,NULL,ecran,&pos_texte4);
SDL_Flip(ecran);
......
......@@ -15,6 +15,7 @@
#define NB_JOUEURS 2
#define HAUTEUR_BOUTON 20
#define LARGEUR_BOUTON 115
#define LARGEUR_BORDURE 220
int main_affichage();
......
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