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
c418edda
Commit
c418edda
authored
8 years ago
by
Montjoie Henri
Browse files
Options
Downloads
Patches
Plain Diff
creation d'un main_affichage qui appelle les autres fonctions #propre
parent
9e2da9ee
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/affichage.c
+50
-16
50 additions, 16 deletions
src/affichage.c
src/affichage.h
+1
-0
1 addition, 0 deletions
src/affichage.h
src/attaques.c
+1
-1
1 addition, 1 deletion
src/attaques.c
src/main.c
+1
-2
1 addition, 2 deletions
src/main.c
with
53 additions
and
19 deletions
src/affichage.c
+
50
−
16
View file @
c418edda
...
...
@@ -16,6 +16,54 @@ EtatsJeu etat;
char
*
nom_1
;
char
*
nom_2
;
/*!
* \fn int main_affichage()
* \brief Fonction principale de la partie affichage, elle appelle les autres en fonction de l'etat du jeu
*
*/
int
main_affichage
()
{
etat
=
LANCEMENT
;
/*lance le jeu direct l'ecran de lancement, sans rentrer les noms des joueurs*/
//etat=SAISIE_JOUEURS; /*lance le jeu l'ecran "entrer nom joueur 1"*/
if
(
SDL_Init
(
SDL_INIT_VIDEO
)
<
0
)
{
printf
(
"Unable to init SDL: %s
\n
"
,
SDL_GetError
());
exit
(
EXIT_FAILURE
);
}
if
(
TTF_Init
()
==-
1
)
{
fprintf
(
stderr
,
"Erreur d'initialisation de TTF_Init : %s
\n
"
,
TTF_GetError
());
exit
(
EXIT_FAILURE
);
}
while
(
etat
!=
FERMER
)
{
switch
(
etat
)
{
case
SAISIE_JOUEURS
:
saisie_noms_joueurs
();
break
;
case
LANCEMENT
:
affichage_ecran_accueil
();
break
;
case
CONFIGURATION
:
affichage_menu_configuration
();
break
;
case
TOUR_J1P1
:
affichage_carte
(
NULL
);
break
;
default:
break
;
}
}
SDL_Quit
();
return
0
;
}
/*!
* \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
...
...
@@ -101,17 +149,6 @@ int saisie_noms_joueurs()
SDL_Rect
pos_texte
;
TTF_Font
*
police
=
NULL
;
if
(
SDL_Init
(
SDL_INIT_VIDEO
)
<
0
)
{
printf
(
"Unable to init SDL: %s
\n
"
,
SDL_GetError
()
);
return
1
;
}
if
(
TTF_Init
()
==
-
1
)
{
fprintf
(
stderr
,
"Erreur d'initialisation de TTF_Init : %s
\n
"
,
TTF_GetError
());
exit
(
EXIT_FAILURE
);
}
SDL_Color
couleurNoire
=
{
0
,
0
,
0
};
SDL_Color
couleurBlanche
=
{
255
,
255
,
255
};
...
...
@@ -171,13 +208,12 @@ int saisie_noms_joueurs()
nom_1
=
nom_joueur1
;
nom_2
=
nom_joueur2
;
if
(
etat
==
LANCEMENT
)
affichage_ecran_accueil
();
return
0
;
}
/*!
* \fn int affichage_
menu_configuration
()
* \fn int affichage_
ecran_accueil
()
* \brief fonction qui gre l'affichage de l'ecran d'accueil (logo + bouton de lancement)
*/
int
affichage_ecran_accueil
()
...
...
@@ -194,7 +230,7 @@ int affichage_ecran_accueil()
if
(
SDL_Init
(
SDL_INIT_VIDEO
)
<
0
)
{
printf
(
"Unable to init SDL: %s
\n
"
,
SDL_GetError
()
);
return
1
;
exit
(
EXIT_FAILURE
)
;
}
if
(
TTF_Init
()
==
-
1
)
{
...
...
@@ -254,7 +290,6 @@ int affichage_ecran_accueil()
SDL_BlitSurface
(
rectangle
,
NULL
,
ecran
,
&
pos_texte
);
SDL_Flip
(
ecran
);
}
if
(
etat
==
CONFIGURATION
)
affichage_menu_configuration
();
return
0
;
}
...
...
@@ -460,7 +495,6 @@ int affichage_menu_configuration()
p
=
0
;
j
=
0
;
}
SDL_Quit
();
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
src/affichage.h
+
1
−
0
View file @
c418edda
...
...
@@ -15,6 +15,7 @@
#define HAUTEUR_BOUTON 20
#define LARGEUR_BOUTON 115
int
main_affichage
();
int
saisie_noms_joueurs
();
...
...
This diff is collapsed.
Click to expand it.
src/attaques.c
+
1
−
1
View file @
c418edda
...
...
@@ -47,7 +47,7 @@ int ajouter_effet_perso(Effet *effet_select, Personnage *cible)
*/
int
appliquer_effet
(
Effet
*
effet_select
,
Personnage
*
cible
)
{
(
cible
->
PV
)
-=
(
effet_select
->
valeur_degats
)
(
cible
->
PV
)
-=
(
effet_select
->
valeur_degats
)
;
}
...
...
This diff is collapsed.
Click to expand it.
src/main.c
+
1
−
2
View file @
c418edda
...
...
@@ -90,8 +90,7 @@ int main(void)
initJeu
();
//saisie_noms_joueurs(); /*lance le jeu l'ecran "entrer nom joueur 1"*/
//affichage_ecran_accueil(); /*lance le jeu direct l'ecran de lancement, sans rentrer les noms des joueurs*/
main_affichage
();
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