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
e4da73ec
There was a problem fetching the pipeline summary.
Commit
e4da73ec
authored
8 years ago
by
Montjoie Henri
Browse files
Options
Downloads
Patches
Plain Diff
ajout de la possibilite de selectionner une carte perso
parent
dddd68f2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
resources/Maps.xml
+3
-3
3 additions, 3 deletions
resources/Maps.xml
src/affichage.c
+98
-15
98 additions, 15 deletions
src/affichage.c
src/affichage.h
+1
-0
1 addition, 0 deletions
src/affichage.h
with
102 additions
and
18 deletions
resources/Maps.xml
+
3
−
3
View file @
e4da73ec
<?xml version="1.0" encoding="UTF-8"?>
<Maps>
<Map
id=
"MAP_1"
name=
"Comt
é
de la sieste"
desc=
"Cette map est so-mmeil"
taille_lignes=
"10"
>
<Map
id=
"MAP_1"
name=
"Comt
e
de la sieste"
desc=
"Cette map est so-mmeil"
taille_lignes=
"10"
>
<Line>
MFPPRRPPFM
</Line>
<Line>
MFPPRRPPFM
</Line>
<Line>
MFPPRRPPFM
</Line>
...
...
@@ -39,7 +39,7 @@
<Line>
MFPPRRPFFF
</Line>
</Map>
<Map
id=
"MAP_3"
name=
"Chasse au tr
é
sor"
desc=
"Une map pour 2 joueurs qui rend fou !! "
taille_lignes=
"10"
>
<Map
id=
"MAP_3"
name=
"Chasse au tr
e
sor"
desc=
"Une map pour 2 joueurs qui rend fou !! "
taille_lignes=
"10"
>
<Line>
MFPPRRPPFM
</Line>
<Line>
MFPPRRPPFM
</Line>
<Line>
MFPPRRPPFM
</Line>
...
...
@@ -77,7 +77,7 @@
<Line>
MFPPPPPRRF
</Line>
</Map>
<Map
id=
"MAP_5"
name=
"Carte basique"
desc=
"Le mec qui l'a cr
éé
e ne s'est pas foul
é
... "
taille_lignes=
"10"
>
<Map
id=
"MAP_5"
name=
"Carte basique"
desc=
"Le mec qui l'a cr
ee
e ne s'est pas foul
e
... "
taille_lignes=
"10"
>
<Line>
PPPPPPPPPP
</Line>
<Line>
PPPPPPPPPP
</Line>
<Line>
PPPPPPPPPP
</Line>
...
...
This diff is collapsed.
Click to expand it.
src/affichage.c
+
98
−
15
View file @
e4da73ec
...
...
@@ -15,7 +15,6 @@
EtatsJeu
etat
;
char
*
nom_1
;
char
*
nom_2
;
int
num_carte_selectionnee
;
/*!
...
...
@@ -67,6 +66,78 @@ int main_affichage()
}
/*!
* \fn int afficher_cartes_personnalisees()
* \brief Fonction permettant le choix d'une carte personnalisee (cd qui n'est pas l'une des 4 previsualisees) par le joueur
* elle affiche leur nom, et leur description
*
* \return le numero de la carte choisie (ou -2 si l'utilisateur ferme la fenetre)
*/
int
afficher_cartes_personnalisees
()
{
int
i
;
int
c
=-
1
;
int
nbChoix
=
nbCartes
()
-
4
;
SDL_Surface
*
fenetre
=
NULL
;
SDL_Surface
*
textes
[
nbChoix
];
SDL_Surface
*
desc
[
nbChoix
];
SDL_Rect
positionsTextes
[
nbChoix
];
SDL_Rect
positionsDesc
[
nbChoix
];
SDL_Event
event
;
SDL_Color
couleurNoire
=
{
0
,
0
,
0
};
SDL_Color
couleurBlanche
=
{
255
,
255
,
255
};
TTF_Font
*
police
=
TTF_OpenFont
(
"../resources/fonts/arial.ttf"
,
40
);
TTF_Font
*
petite_police
=
TTF_OpenFont
(
"../resources/fonts/arial.ttf"
,
22
);
for
(
i
=
0
;
i
<
nbChoix
;
i
++
)
{
textes
[
i
]
=
TTF_RenderText_Shaded
(
police
,
obtenirNomsCartes
()[
i
+
4
],
couleurBlanche
,
couleurNoire
);
desc
[
i
]
=
TTF_RenderText_Shaded
(
petite_police
,
obtenirDescriptionCarte
()[
i
+
4
],
couleurBlanche
,
couleurNoire
);
positionsTextes
[
i
].
x
=
0
;
positionsDesc
[
i
].
x
=
0
;
positionsTextes
[
i
].
y
=
i
*
(
textes
[
0
]
->
h
+
desc
[
0
]
->
h
+
5
);
positionsDesc
[
i
].
y
=
positionsTextes
[
i
].
y
+
textes
[
i
]
->
h
;
}
fenetre
=
SDL_SetVideoMode
(
400
,
nbChoix
*
(
textes
[
0
]
->
h
+
desc
[
0
]
->
h
),
32
,
SDL_HWSURFACE
|
SDL_DOUBLEBUF
|
SDL_RESIZABLE
);
while
(
c
==-
1
)
{
SDL_WaitEvent
(
&
event
);
switch
(
event
.
type
)
{
case
SDL_QUIT
:
c
=-
2
;
break
;
case
SDL_MOUSEBUTTONDOWN
:
for
(
i
=
0
;
i
<
nbChoix
;
i
++
)
{
if
(
event
.
button
.
y
/
(
textes
[
0
]
->
h
+
desc
[
0
]
->
h
)
==
i
)
{
c
=
4
+
i
;
}
}
break
;
default:
break
;
}
for
(
i
=
0
;
i
<
nbChoix
;
i
++
)
{
SDL_BlitSurface
(
textes
[
i
],
NULL
,
fenetre
,
&
positionsTextes
[
i
]);
SDL_BlitSurface
(
desc
[
i
],
NULL
,
fenetre
,
&
positionsDesc
[
i
]);
}
SDL_Flip
(
fenetre
);
}
SDL_FreeSurface
(
fenetre
);
for
(
i
=
0
;
i
<
nbChoix
;
i
++
)
{
SDL_FreeSurface
(
textes
[
i
]);
SDL_FreeSurface
(
desc
[
i
]);
}
TTF_CloseFont
(
police
);
TTF_CloseFont
(
petite_police
);
return
c
;
}
/*!
* \fn char* afficherListeClasses(char** nomsClasses, char** skinsClasses, int nbChoix, TTF_Font* police,SDL_Color couleurTexte)
* \brief Fonction permettant le choix de la classe d'un personnage par le joueur
...
...
@@ -109,7 +180,6 @@ char* afficherListeClasses(char** nomsClasses, char** skinsClasses, int nbChoix,
case
SDL_QUIT
:
SDL_FreeSurface
(
fenetre
);
return
"fermer"
;
break
;
case
SDL_MOUSEBUTTONDOWN
:
for
(
i
=
0
;
i
<
nbChoix
;
i
++
)
{
...
...
@@ -465,9 +535,21 @@ int affichage_menu_configuration()
{
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
;
selectionnerCarte
(
obtenirNomsCartes
()[
c
]);
num_carte_selectionnee
=
c
+
1
;
if
(
i
!=
4
)
{
c
=
i
;
selectionnerCarte
(
obtenirNomsCartes
()[
c
]);
}
else
{
c
=
afficher_cartes_personnalisees
();
if
(
c
==-
2
){
c
=-
1
;
}
else
{
selectionnerCarte
(
obtenirNomsCartes
()[
c
]);
}
ecran
=
SDL_SetVideoMode
(
LARGEUR_CARTE
*
(
LARGEUR_CASE
+
1
),
HAUTEUR_CARTE
*
(
HAUTEUR_CASE
+
2
),
32
,
SDL_HWSURFACE
|
SDL_DOUBLEBUF
);
}
}
}
if
(
event
.
button
.
x
>
posTextes
[
0
].
x
&&
event
.
button
.
x
<
posTextes
[
0
].
x
+
textes
[
0
]
->
w
)
...
...
@@ -518,7 +600,8 @@ int affichage_menu_configuration()
{
SDL_BlitSurface
(
previsualisation
[
i
],
NULL
,
ecran
,
&
position_carte
[
i
]);
}
if
(
c
!=-
1
)
SDL_BlitSurface
(
map_choisie
,
NULL
,
ecran
,
&
position_carte
[
c
]);
if
(
c
>-
1
&&
c
<
4
)
SDL_BlitSurface
(
map_choisie
,
NULL
,
ecran
,
&
position_carte
[
c
]);
if
(
c
>
3
)
SDL_BlitSurface
(
map_choisie
,
NULL
,
ecran
,
&
position_carte
[
4
]);
SDL_Flip
(
ecran
);
p
=
0
;
j
=
0
;
...
...
@@ -595,15 +678,15 @@ int affichage_carte()
SDL_SetColorKey
(
classes
[
i
],
SDL_SRCCOLORKEY
,
SDL_MapRGB
(
classes
[
i
]
->
format
,
0
,
0
,
255
));
}
/* for(i=0; i<NB_JOUEURS*NB_PERSO; i++)
{
persos[i]=SDL_LoadBMP(obtenirSkinPerso(i+1));
if (!persos[i])
{
printf("Unable to load bitmap: %s\n", SDL_GetError());
return 1;
}
}*/
/* for(i=0; i<NB_JOUEURS*NB_PERSO; i++)
{
persos[i]=SDL_LoadBMP(obtenirSkinPerso(i+1));
if (!persos[i])
{
printf("Unable to load bitmap: %s\n", SDL_GetError());
return 1;
}
}*/
Guerrier_select
=
SDL_LoadBMP
(
"../resources/Skins/guerrier_select.bmp"
);
if
(
!
Guerrier_select
)
...
...
This diff is collapsed.
Click to expand it.
src/affichage.h
+
1
−
0
View file @
e4da73ec
...
...
@@ -28,5 +28,6 @@ int affichage_carte();
int
afficher_menu
();
int
afficher_cartes_personnalisees
();
#endif
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