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

ajout de l'écran entree

parent 10d3751e
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,16 @@ ...@@ -13,7 +13,16 @@
<Option compiler="gcc" /> <Option compiler="gcc" />
<Compiler> <Compiler>
<Add option="-g" /> <Add option="-g" />
<Add directory="../Libs/libroxml-2.3.0/src" />
<Add directory="../Libs/SDL-1.2.15/include" />
<Add directory="../Libs/cmocka-1.0.0/include" />
</Compiler> </Compiler>
<Linker>
<Add library="..\Libs\libroxml-2.3.0\Build\libroxml.dll" />
<Add library="..\Libs\SDL-1.2.15\lib\SDL_ttf.dll" />
<Add directory="../Libs/SDL-1.2.15/lib" />
<Add directory="../Libs/libroxml-2.3.0/Build" />
</Linker>
</Target> </Target>
<Target title="Release"> <Target title="Release">
<Option output="bin/Release/EII_jeu" prefix_auto="1" extension_auto="1" /> <Option output="bin/Release/EII_jeu" prefix_auto="1" extension_auto="1" />
...@@ -30,7 +39,9 @@ ...@@ -30,7 +39,9 @@
</Build> </Build>
<Compiler> <Compiler>
<Add option="-Wall" /> <Add option="-Wall" />
<Add directory="C:/Users/henri/Desktop/workspace-jeuC/lemeilleurjeudumonde/Libs/SDL-1.2.15/include" /> <Add directory="../Libs/libroxml-2.3.0/src" />
<Add directory="../Libs/SDL-1.2.15/include" />
<Add directory="../Libs/cmocka-1.0.0/include" />
</Compiler> </Compiler>
<Linker> <Linker>
<Add library="mingw32" /> <Add library="mingw32" />
...@@ -40,10 +51,85 @@ ...@@ -40,10 +51,85 @@
<Add library="gdi32" /> <Add library="gdi32" />
<Add library="winmm" /> <Add library="winmm" />
<Add library="dxguid" /> <Add library="dxguid" />
<Add library="..\Libs\libroxml-2.3.0\Build\libroxml.dll" />
<Add directory="C:/Users/henri/Desktop/workspace-jeuC/lemeilleurjeudumonde/Libs/SDL-1.2.15/lib" /> <Add directory="C:/Users/henri/Desktop/workspace-jeuC/lemeilleurjeudumonde/Libs/SDL-1.2.15/lib" />
<Add directory="../Libs/libroxml-2.3.0/Build" />
</Linker> </Linker>
<Unit filename="cb.bmp" /> <Unit filename="../src/ClassesXML.c">
<Unit filename="main.cpp" /> <Option compilerVar="CC" />
</Unit>
<Unit filename="../src/ClassesXML.h" />
<Unit filename="../src/Interface.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/Interface.h" />
<Unit filename="../src/SDL.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/SDL.h" />
<Unit filename="../src/SDL_bis.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/TerrainsXML.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/TerrainsXML.h" />
<Unit filename="../src/carte.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/carte.h" />
<Unit filename="../src/case.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/case.h" />
<Unit filename="../src/classe.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/classe.h" />
<Unit filename="../src/competence.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/competence.h" />
<Unit filename="../src/controleur.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/controleur.h" />
<Unit filename="../src/controleurSDL.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/controleurSDL.h" />
<Unit filename="../src/deplacements.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/deplacements.h" />
<Unit filename="../src/joueur.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/joueur.h" />
<Unit filename="../src/joueurList.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/joueurList.h" />
<Unit filename="../src/main.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/partie.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/partie.h" />
<Unit filename="../src/personnage.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/personnage.h" />
<Unit filename="../src/resultat_aleatoire.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/resultat_aleatoire.h" />
<Unit filename="../src/structures.h" />
<Unit filename="../src/terrain.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/terrain.h" />
<Extensions> <Extensions>
<code_completion /> <code_completion />
<envvars /> <envvars />
......
No preview for this file type
File added
...@@ -12,6 +12,7 @@ int SDL_bis() ...@@ -12,6 +12,7 @@ int SDL_bis()
SDL_Surface* ecran=NULL; SDL_Surface* ecran=NULL;
SDL_Event event; SDL_Event event;
SDL_Surface* logo = NULL; SDL_Surface* logo = NULL;
SDL_Surface* rectangle = NULL;
SDL_Surface* texte = NULL; SDL_Surface* texte = NULL;
SDL_Rect pos_logo; SDL_Rect pos_logo;
SDL_Rect pos_texte; SDL_Rect pos_texte;
...@@ -32,6 +33,8 @@ int SDL_bis() ...@@ -32,6 +33,8 @@ int SDL_bis()
police=TTF_OpenFont("../resources/fonts/arial.ttf",26); police=TTF_OpenFont("../resources/fonts/arial.ttf",26);
SDL_Color couleurNoire = {0, 0, 0}; SDL_Color couleurNoire = {0, 0, 0};
SDL_Color couleurBlanche = {255, 255, 255}; SDL_Color couleurBlanche = {255, 255, 255};
SDL_Color couleurBleue = {10, 30, 80};
SDL_Color couleurDoree = {190, 190, 120};
ecran = SDL_SetVideoMode(LARGEUR_CARTE*(LARGEUR_CASE+1), HAUTEUR_CARTE*(HAUTEUR_CASE+2), 32, SDL_HWSURFACE|SDL_DOUBLEBUF); ecran = SDL_SetVideoMode(LARGEUR_CARTE*(LARGEUR_CASE+1), HAUTEUR_CARTE*(HAUTEUR_CASE+2), 32, SDL_HWSURFACE|SDL_DOUBLEBUF);
if (ecran == NULL) // Si l'ouverture a chou, on le note et on arrte if (ecran == NULL) // Si l'ouverture a chou, on le note et on arrte
...@@ -62,8 +65,26 @@ int SDL_bis() ...@@ -62,8 +65,26 @@ int SDL_bis()
char nom_joueur1[15] = ""; char nom_joueur1[15] = "";
fgets(nom_joueur1, sizeof(nom_joueur1), stdin); fgets(nom_joueur1, sizeof(nom_joueur1), stdin);
texte = TTF_RenderText_Shaded(police, "Entrez le nom du joueur 2", couleurBlanche,couleurNoire);
SDL_BlitSurface(texte,NULL,ecran,&pos_texte);
SDL_Flip(ecran);
char nom_joueur2[15] = ""; char nom_joueur2[15] = "";
ajouter_joueurs(nom_joueur1,nom_joueur2, &etat); //a coder par colin fgets(nom_joueur2, sizeof(nom_joueur2), stdin);
ajouterUnJoueur(nom_joueur1,&etat);
ajouterUnJoueur(nom_joueur2,&etat);
police=TTF_OpenFont("../resources/fonts/OLDENGL.ttf",40);
texte = TTF_RenderText_Shaded(police, "Entrez dans le Royaume !", couleurDoree,couleurBleue);
pos_texte.x=(ecran->w-texte->w)/2;
pos_texte.y=ecran->h-200;
rectangle=SDL_CreateRGBSurface(SDL_HWSURFACE,texte->w,texte->h,NULL,0,0,255,NULL);
SDL_FillRect(ecran,NULL,SDL_MapRGB(ecran->format,0,0,0));
SDL_BlitSurface(logo,NULL,ecran,&pos_logo);
SDL_BlitSurface(texte,NULL,ecran,&pos_texte);
SDL_BlitSurface(rectangle,NULL,ecran,&pos_texte);
SDL_Flip(ecran);
while(quitter==0) while(quitter==0)
{ {
......
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