Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lemeilleurjeudumonde
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tacticalrpg
lemeilleurjeudumonde
Commits
3c336f65
There was a problem fetching the pipeline summary.
Commit
3c336f65
authored
8 years ago
by
Montjoie Henri
Browse files
Options
Downloads
Patches
Plain Diff
ajout du bouton lancer la partie
parent
e3f06975
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/affichage.c
+32
-8
32 additions, 8 deletions
src/affichage.c
with
32 additions
and
8 deletions
src/affichage.c
+
32
−
8
View file @
3c336f65
...
@@ -232,7 +232,6 @@ int affichage_ecran_accueil()
...
@@ -232,7 +232,6 @@ int affichage_ecran_accueil()
SDL_Surface
*
ecran
=
SDL_SetVideoMode
(
LARGEUR_CARTE
*
(
LARGEUR_CASE
+
1
),
HAUTEUR_CARTE
*
(
HAUTEUR_CASE
+
2
),
32
,
SDL_HWSURFACE
|
SDL_DOUBLEBUF
);
SDL_Surface
*
ecran
=
SDL_SetVideoMode
(
LARGEUR_CARTE
*
(
LARGEUR_CASE
+
1
),
HAUTEUR_CARTE
*
(
HAUTEUR_CASE
+
2
),
32
,
SDL_HWSURFACE
|
SDL_DOUBLEBUF
);
SDL_WM_SetCaption
(
"Elder Internal Ignition"
,
NULL
);
SDL_WM_SetCaption
(
"Elder Internal Ignition"
,
NULL
);
SDL_Event
event
;
SDL_Event
event
;
SDL_Surface
*
rectangle
=
NULL
;
SDL_Surface
*
logo
=
NULL
;
SDL_Surface
*
logo
=
NULL
;
SDL_Surface
*
texte
=
NULL
;
SDL_Surface
*
texte
=
NULL
;
TTF_Font
*
police
=
NULL
;
TTF_Font
*
police
=
NULL
;
...
@@ -245,7 +244,6 @@ int affichage_ecran_accueil()
...
@@ -245,7 +244,6 @@ int affichage_ecran_accueil()
texte
=
TTF_RenderText_Shaded
(
police
,
"Entrez dans le Royaume !"
,
couleurDoree
,
couleurBleue
);
texte
=
TTF_RenderText_Shaded
(
police
,
"Entrez dans le Royaume !"
,
couleurDoree
,
couleurBleue
);
pos_texte
.
x
=
(
ecran
->
w
-
texte
->
w
)
/
2
;
pos_texte
.
x
=
(
ecran
->
w
-
texte
->
w
)
/
2
;
pos_texte
.
y
=
ecran
->
h
-
200
;
pos_texte
.
y
=
ecran
->
h
-
200
;
rectangle
=
SDL_CreateRGBSurface
(
SDL_HWSURFACE
,
texte
->
w
,
texte
->
h
,
0
,
0
,
0
,
255
,
0
);
logo
=
SDL_LoadBMP
(
"../resources/Skins/logo.bmp"
);
logo
=
SDL_LoadBMP
(
"../resources/Skins/logo.bmp"
);
if
(
!
logo
)
if
(
!
logo
)
...
@@ -258,7 +256,6 @@ int affichage_ecran_accueil()
...
@@ -258,7 +256,6 @@ int affichage_ecran_accueil()
SDL_FillRect
(
ecran
,
NULL
,
SDL_MapRGB
(
ecran
->
format
,
0
,
0
,
0
));
SDL_FillRect
(
ecran
,
NULL
,
SDL_MapRGB
(
ecran
->
format
,
0
,
0
,
0
));
SDL_BlitSurface
(
logo
,
NULL
,
ecran
,
&
pos_logo
);
SDL_BlitSurface
(
logo
,
NULL
,
ecran
,
&
pos_logo
);
SDL_BlitSurface
(
texte
,
NULL
,
ecran
,
&
pos_texte
);
SDL_BlitSurface
(
texte
,
NULL
,
ecran
,
&
pos_texte
);
SDL_BlitSurface
(
rectangle
,
NULL
,
ecran
,
&
pos_texte
);
SDL_Flip
(
ecran
);
SDL_Flip
(
ecran
);
while
(
etat
==
LANCEMENT
)
while
(
etat
==
LANCEMENT
)
...
@@ -278,13 +275,11 @@ int affichage_ecran_accueil()
...
@@ -278,13 +275,11 @@ int affichage_ecran_accueil()
}
}
SDL_BlitSurface
(
logo
,
NULL
,
ecran
,
&
pos_logo
);
SDL_BlitSurface
(
logo
,
NULL
,
ecran
,
&
pos_logo
);
SDL_BlitSurface
(
texte
,
NULL
,
ecran
,
&
pos_texte
);
SDL_BlitSurface
(
texte
,
NULL
,
ecran
,
&
pos_texte
);
SDL_BlitSurface
(
rectangle
,
NULL
,
ecran
,
&
pos_texte
);
SDL_Flip
(
ecran
);
SDL_Flip
(
ecran
);
}
}
TTF_CloseFont
(
police
);
TTF_CloseFont
(
police
);
SDL_FreeSurface
(
ecran
);
SDL_FreeSurface
(
ecran
);
SDL_FreeSurface
(
logo
);
SDL_FreeSurface
(
logo
);
SDL_FreeSurface
(
rectangle
);
SDL_FreeSurface
(
texte
);
SDL_FreeSurface
(
texte
);
return
0
;
return
0
;
}
}
...
@@ -300,6 +295,7 @@ int affichage_menu_configuration()
...
@@ -300,6 +295,7 @@ int affichage_menu_configuration()
SDL_Surface
*
ecran
=
SDL_SetVideoMode
(
LARGEUR_CARTE
*
(
LARGEUR_CASE
+
1
),
HAUTEUR_CARTE
*
(
HAUTEUR_CASE
+
2
),
32
,
SDL_HWSURFACE
|
SDL_DOUBLEBUF
);
SDL_Surface
*
ecran
=
SDL_SetVideoMode
(
LARGEUR_CARTE
*
(
LARGEUR_CASE
+
1
),
HAUTEUR_CARTE
*
(
HAUTEUR_CASE
+
2
),
32
,
SDL_HWSURFACE
|
SDL_DOUBLEBUF
);
SDL_WM_SetCaption
(
"Elder Internal Ignition"
,
NULL
);
SDL_WM_SetCaption
(
"Elder Internal Ignition"
,
NULL
);
SDL_Event
event
;
SDL_Event
event
;
SDL_Surface
*
lancer_partie
=
NULL
;
SDL_Surface
*
map_choisie
=
NULL
;
SDL_Surface
*
map_choisie
=
NULL
;
SDL_Surface
*
texte
=
NULL
;
SDL_Surface
*
texte
=
NULL
;
SDL_Surface
*
texte2
=
NULL
;
SDL_Surface
*
texte2
=
NULL
;
...
@@ -310,6 +306,7 @@ int affichage_menu_configuration()
...
@@ -310,6 +306,7 @@ int affichage_menu_configuration()
SDL_Surface
*
images_persos
[
NB_PERSO
][
NB_JOUEURS
]
=
{{
NULL
}};
SDL_Surface
*
images_persos
[
NB_PERSO
][
NB_JOUEURS
]
=
{{
NULL
}};
SDL_Rect
positions_images
[
NB_PERSO
][
NB_JOUEURS
];
SDL_Rect
positions_images
[
NB_PERSO
][
NB_JOUEURS
];
SDL_Rect
posTextes
[
NB_JOUEURS
*
NB_PERSO
];
SDL_Rect
posTextes
[
NB_JOUEURS
*
NB_PERSO
];
SDL_Rect
pos_bouton
;
SDL_Rect
pos_texte
;
SDL_Rect
pos_texte
;
SDL_Rect
pos_texte2
;
SDL_Rect
pos_texte2
;
SDL_Rect
pos_texte3
;
SDL_Rect
pos_texte3
;
...
@@ -319,13 +316,18 @@ int affichage_menu_configuration()
...
@@ -319,13 +316,18 @@ int affichage_menu_configuration()
TTF_Font
*
petite_police
=
NULL
;
TTF_Font
*
petite_police
=
NULL
;
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
};
int
i
,
j
,
p
,
k
,
c
;
int
i
,
j
,
p
,
k
,
c
;
SDL_FillRect
(
ecran
,
NULL
,
SDL_MapRGB
(
ecran
->
format
,
0
,
0
,
0
));
SDL_FillRect
(
ecran
,
NULL
,
SDL_MapRGB
(
ecran
->
format
,
0
,
0
,
0
));
police
=
TTF_OpenFont
(
"../resources/fonts/OLDENGL.ttf"
,
4
4
);
police
=
TTF_OpenFont
(
"../resources/fonts/OLDENGL.ttf"
,
4
6
);
petite_police
=
TTF_OpenFont
(
"../resources/fonts/OLDENGL.ttf"
,
32
);
petite_police
=
TTF_OpenFont
(
"../resources/fonts/OLDENGL.ttf"
,
32
);
lancer_partie
=
TTF_RenderText_Shaded
(
police
,
"Lancer la partie"
,
couleurDoree
,
couleurBleue
);
pos_bouton
.
y
=
ecran
->
h
-
lancer_partie
->
h
-
25
;
pos_bouton
.
x
=
(
ecran
->
w
-
lancer_partie
->
w
)
/
2
;
texte
=
TTF_RenderText_Shaded
(
police
,
nom_1
,
couleurBlanche
,
couleurNoire
);
texte
=
TTF_RenderText_Shaded
(
police
,
nom_1
,
couleurBlanche
,
couleurNoire
);
texte2
=
TTF_RenderText_Shaded
(
police
,
nom_2
,
couleurBlanche
,
couleurNoire
);
texte2
=
TTF_RenderText_Shaded
(
police
,
nom_2
,
couleurBlanche
,
couleurNoire
);
texte3
=
TTF_RenderText_Shaded
(
petite_police
,
"choisissez vos personnages"
,
couleurBlanche
,
couleurNoire
);
texte3
=
TTF_RenderText_Shaded
(
petite_police
,
"choisissez vos personnages"
,
couleurBlanche
,
couleurNoire
);
...
@@ -367,7 +369,7 @@ int affichage_menu_configuration()
...
@@ -367,7 +369,7 @@ int affichage_menu_configuration()
}
}
char
**
path_images
=
obtenirSkinsClasses
();
char
**
path_images
=
obtenirSkinsClasses
();
int
numClassePerso
[
3
][
2
]
=
{{
-
1
,
-
1
},{
-
1
,
-
1
},{
-
1
,
-
1
}};
int
numClassePerso
[
NB_PERSO
][
NB_JOUEURS
]
=
{{
-
1
,
-
1
},{
-
1
,
-
1
},{
-
1
,
-
1
}};
j
=
0
;
/*numero du joeuur*/
j
=
0
;
/*numero du joeuur*/
p
=
0
;
/*numero du personnage*/
p
=
0
;
/*numero du personnage*/
char
*
classeChoisie
;
char
*
classeChoisie
;
...
@@ -421,12 +423,32 @@ int affichage_menu_configuration()
...
@@ -421,12 +423,32 @@ int affichage_menu_configuration()
return
0
;
return
0
;
break
;
break
;
case
SDL_MOUSEBUTTONDOWN
:
case
SDL_MOUSEBUTTONDOWN
:
if
(
event
.
button
.
x
>
pos_bouton
.
x
&&
event
.
button
.
x
<
pos_bouton
.
x
+
lancer_partie
->
w
&&
event
.
button
.
y
>
pos_bouton
.
y
&&
event
.
button
.
y
<
pos_bouton
.
y
+
lancer_partie
->
h
){
for
(
i
=
0
;
i
<
NB_PERSO
;
i
++
){
for
(
k
=
0
;
k
<
NB_JOUEURS
;
k
++
){
if
(
numClassePerso
[
i
][
k
]
==-
1
){
p
=-
1
;
}
}
}
if
(
p
==
0
&&
c
!=-
1
){
//etat=TOUR_J1P1;
printf
(
"c'est parti!
\n
"
);
}
if
(
c
==-
1
){
printf
(
"choisissez une carte
\n
"
);
}
if
(
p
==-
1
){
p
=
0
;
printf
(
"selectionnez des personnages
\n
"
);
}
}
for
(
i
=
0
;
i
<
5
;
i
++
)
for
(
i
=
0
;
i
<
5
;
i
++
)
{
{
if
(
event
.
button
.
x
>
position_carte
[
i
].
x
&&
event
.
button
.
x
<
position_carte
[
i
].
x
+
previsualisation
[
0
]
->
w
&&
event
.
button
.
y
>
position_carte
[
i
].
y
&&
event
.
button
.
y
<
position_carte
[
i
].
y
+
previsualisation
[
0
]
->
h
)
if
(
event
.
button
.
x
>
position_carte
[
i
].
x
&&
event
.
button
.
x
<
position_carte
[
i
].
x
+
previsualisation
[
0
]
->
w
&&
event
.
button
.
y
>
position_carte
[
i
].
y
&&
event
.
button
.
y
<
position_carte
[
i
].
y
+
previsualisation
[
0
]
->
h
)
{
{
c
=
i
;
c
=
i
;
//
selectionnerCarte(obtenirNomsCartes()[c]);
selectionnerCarte
(
obtenirNomsCartes
()[
c
]);
}
}
}
}
if
(
event
.
button
.
x
>
posTextes
[
0
].
x
&&
event
.
button
.
x
<
posTextes
[
0
].
x
+
textes
[
0
]
->
w
)
if
(
event
.
button
.
x
>
posTextes
[
0
].
x
&&
event
.
button
.
x
<
posTextes
[
0
].
x
+
textes
[
0
]
->
w
)
...
@@ -466,6 +488,7 @@ int affichage_menu_configuration()
...
@@ -466,6 +488,7 @@ int affichage_menu_configuration()
}
}
}
}
}
}
SDL_BlitSurface
(
lancer_partie
,
NULL
,
ecran
,
&
pos_bouton
);
SDL_BlitSurface
(
texte
,
NULL
,
ecran
,
&
pos_texte
);
SDL_BlitSurface
(
texte
,
NULL
,
ecran
,
&
pos_texte
);
SDL_BlitSurface
(
texte2
,
NULL
,
ecran
,
&
pos_texte2
);
SDL_BlitSurface
(
texte2
,
NULL
,
ecran
,
&
pos_texte2
);
SDL_BlitSurface
(
texte3
,
NULL
,
ecran
,
&
pos_texte3
);
SDL_BlitSurface
(
texte3
,
NULL
,
ecran
,
&
pos_texte3
);
...
@@ -487,6 +510,7 @@ int affichage_menu_configuration()
...
@@ -487,6 +510,7 @@ int affichage_menu_configuration()
SDL_FreeSurface
(
texte
);
SDL_FreeSurface
(
texte
);
SDL_FreeSurface
(
texte2
);
SDL_FreeSurface
(
texte2
);
SDL_FreeSurface
(
texte3
);
SDL_FreeSurface
(
texte3
);
SDL_FreeSurface
(
lancer_partie
);
for
(
i
=
0
;
i
<
5
;
i
++
){
for
(
i
=
0
;
i
<
5
;
i
++
){
SDL_FreeSurface
(
previsualisation
[
i
]);
SDL_FreeSurface
(
previsualisation
[
i
]);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment