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
aec5ec28
There was a problem fetching the pipeline summary.
Commit
aec5ec28
authored
8 years ago
by
Montjoie Henri
Browse files
Options
Downloads
Patches
Plain Diff
ajout du menu
parent
130127f1
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
+16
-10
16 additions, 10 deletions
src/affichage.c
with
16 additions
and
10 deletions
src/affichage.c
+
16
−
10
View file @
aec5ec28
...
...
@@ -360,8 +360,7 @@ int affichage_menu_configuration()
police
=
TTF_OpenFont
(
"../resources/fonts/arial.ttf"
,
26
);
char
src
[
50
],
dest
[
50
];
char
buffer
[
2
];
char
src
[
2
],
dest
[
20
];
for
(
i
=
0
;
i
<
NB_PERSO
;
i
++
)
{
strcpy
(
dest
,
"personnage "
);
...
...
@@ -634,7 +633,8 @@ int affichage_carte()
Position_Case
[
j
][
i
].
y
=
j
*
HAUTEUR_CASE
+
(
HAUTEUR_CASE
/
2
);
}
}
while
(
etat
!=
FERMER
&&
etat
!=
VICTOIRE
)
Position_Case_brillante
=
Position_Case
[
0
][
0
];
while
(
etat
!=
FERMER
)
{
SDL_WaitEvent
(
&
event
);
switch
(
event
.
type
)
/* Test du type d'vnement */
...
...
@@ -658,8 +658,7 @@ int affichage_carte()
//persosuivant();
break
;
case
SDLK_ESCAPE
:
//afficher_menu();
etat
=
FERMER
;
afficher_menu
();
break
;
default:
break
;
...
...
@@ -703,7 +702,7 @@ int affichage_carte()
int
afficher_menu
()
{
SDL_Event
event
;
SDL_Surface
*
ecran
=
SDL_SetVideoMode
(
LARGEUR_CARTE
*
(
LARGEUR_CASE
+
1
),
HAUTEUR_CARTE
*
(
HAUTEUR_CASE
+
2
),
32
,
SDL_HWSURFACE
|
SDL_DOUBLEBUF
);
SDL_Surface
*
fenetre
=
SDL_SetVideoMode
(
LARGEUR_CARTE
*
(
LARGEUR_CASE
+
1
),
HAUTEUR_CARTE
*
(
HAUTEUR_CASE
+
2
),
32
,
SDL_HWSURFACE
|
SDL_DOUBLEBUF
);
SDL_Surface
*
bouton_continuer
=
NULL
;
SDL_Surface
*
bouton_quitter
=
NULL
;
SDL_Rect
pos_bouton_continuer
;
...
...
@@ -726,21 +725,23 @@ int afficher_menu()
printf
(
"Unable to load bitmap: %s
\n
"
,
SDL_GetError
());
return
1
;
}
while
(
etat
!=
FERMER
)
{
SDL_WaitEvent
(
&
event
);
switch
(
event
.
type
)
/* Test du type d'vnement */
{
case
SDL_QUIT
:
/* Si c'est un vnement de type "Quitter" */
et
at
=
FERMER
;
r
et
urn
0
;
break
;
case
SDL_MOUSEBUTTONDOWN
:
if
(
pos_bouton_continuer
.
x
<
event
.
button
.
x
&&
event
.
button
.
x
<
pos_bouton_continuer
.
x
+
LARGEUR_BOUTON
)
{
if
(
pos_bouton_continuer
.
y
<
event
.
button
.
y
&&
event
.
button
.
y
<
pos_bouton_continuer
.
x
+
HAUTEUR_BOUTON
)
if
(
pos_bouton_continuer
.
y
<
event
.
button
.
y
&&
event
.
button
.
y
<
pos_bouton_continuer
.
y
+
HAUTEUR_BOUTON
)
{
return
0
;
}
if
(
pos_bouton_quitter
.
y
<
event
.
button
.
y
&&
event
.
button
.
y
<
pos_bouton_quitter
.
x
+
HAUTEUR_BOUTON
)
if
(
pos_bouton_quitter
.
y
<
event
.
button
.
y
&&
event
.
button
.
y
<
pos_bouton_quitter
.
y
+
HAUTEUR_BOUTON
)
{
etat
=
FERMER
;
}
...
...
@@ -757,7 +758,12 @@ int afficher_menu()
}
break
;
}
SDL_BlitSurface
(
bouton_continuer
,
NULL
,
fenetre
,
&
pos_bouton_continuer
);
SDL_BlitSurface
(
bouton_quitter
,
NULL
,
fenetre
,
&
pos_bouton_quitter
);
SDL_Flip
(
fenetre
);
}
//free les surfaces
SDL_FreeSurface
(
fenetre
);
SDL_FreeSurface
(
bouton_continuer
);
SDL_FreeSurface
(
bouton_quitter
);
return
0
;
}
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