summaryrefslogtreecommitdiff
blob: 15338a7bfaa0472f8ccf4838f8f1eb337e18c23e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
Author: Reiner Herrmann <reiner@reiner-h.de>
Description: Fix FTBFS with GCC 10
Bug-Debian: https://bugs.debian.org/957813

--- a/src/themes.h
+++ b/src/themes.h
@@ -41,28 +41,28 @@
 bool _charge_theme_act(char* theme_select);
 void _theme_suivant(bool initial);
 
-char nom_theme[32];
-char theme_act[32];
+extern char nom_theme[32];
+extern char theme_act[32];
 
-int menu_decalage, menu_t_police, menu_ecart;
+extern int menu_decalage, menu_t_police, menu_ecart;
 
-SDL_Color coul_txt_menu, coul_txt_dial, coul_txt_jeu, coul_filet, coul_sol, coul_fond;
+extern SDL_Color coul_txt_menu, coul_txt_dial, coul_txt_jeu, coul_filet, coul_sol, coul_fond;
 
-SDL_Surface *sol, *filet, *balle_img, *fleche, *oeil, *icone_jg, *icone_jd, *icone_fen;
+extern SDL_Surface *sol, *filet, *balle_img, *fleche, *oeil, *icone_jg, *icone_jd, *icone_fen;
 
-SDL_Surface **img_grand_jg, **img_grand_jd, **img_2J_jg, **img_2J_jd, **img_3J_jg, **img_3J_jd;
-Uint8 img_max_jg, img_max_jd;
+extern SDL_Surface **img_grand_jg, **img_grand_jd, **img_2J_jg, **img_2J_jd, **img_3J_jg, **img_3J_jd;
+extern Uint8 img_max_jg, img_max_jd;
 
-SDL_Surface *fond, *fond_jeu;
+extern SDL_Surface *fond, *fond_jeu;
 
-TTF_Font* police; /* La police de caractères */
-TTF_Font* police_menu;
+extern TTF_Font* police; /* La police de caractères */
+extern TTF_Font* police_menu;
 
-Uint16 decalage_haut, decalage_gauche;
-float ratio_police;
+extern Uint16 decalage_haut, decalage_gauche;
+extern float ratio_police;
 
-bool th_libere;
+extern bool th_libere;
 
-char* chemin_moi;
+extern char* chemin_moi;
 
 #endif
--- a/src/themes_general.c
+++ b/src/themes_general.c
@@ -31,6 +31,21 @@
 #define RATIO_3J .6
 #define RATIO_IC .4
 
+char nom_theme[32];
+char theme_act[32];
+int menu_decalage, menu_t_police, menu_ecart;
+SDL_Color coul_txt_menu, coul_txt_dial, coul_txt_jeu, coul_filet, coul_sol, coul_fond;
+SDL_Surface *sol, *filet, *balle_img, *fleche, *oeil, *icone_jg, *icone_jd, *icone_fen;
+SDL_Surface **img_grand_jg, **img_grand_jd, **img_2J_jg, **img_2J_jd, **img_3J_jg, **img_3J_jd;
+Uint8 img_max_jg, img_max_jd;
+SDL_Surface *fond, *fond_jeu;
+TTF_Font* police; /* La police de caractères */
+TTF_Font* police_menu;
+Uint16 decalage_haut, decalage_gauche;
+float ratio_police;
+bool th_libere;
+char* chemin_moi;
+
 SDL_Rect filet_rect = { FILET_GAUCHE, HAUT_ECRAN - HAUT_SOL - FILET_HAUT, 0, 0 };
 SDL_Rect sol_rect = { 0, HAUT_ECRAN - HAUT_SOL, 0, 0 };
 SDL_Rect fond_rect;
--- a/src/slime.c
+++ b/src/slime.c
@@ -53,6 +53,20 @@
 	#endif
 #endif
 
+SDL_Event evenement;
+SDL_Surface *ecran; /* L'écran */
+joueur tab_joueurs[NB_JOUEURS_T]; /* Ce tableau contient les configuration des joueurs */
+touches_joueur touches[4];
+Uint8 nb_balles;
+balle_obj tab_balles[MAX_BALLES];
+config_slime conf; /* La configuration actuelle (modifiable) */
+Uint8 act_conf;
+Uint32 ev_timer(Uint32 intervalle, void* param);
+Uint16 h_ecran, l_ecran;
+bool quitter;
+bool fen_ok;
+bool plein_ecran, aff_fps, aff_sc_perm;
+
 char conf_chemin[64] = CONFIG_NOM;
 
 void afficher(char* chaine, TTF_Font* police_texte, SDL_Color coul_texte, Uint16 posX, Uint16 posY) {
--- a/src/slime.h
+++ b/src/slime.h
@@ -68,7 +68,7 @@
 	#define snprintf5(a, b, c, d, e) snprintf(a, b, c, d, e)
 #endif
 
-SDL_Event evenement;
+extern SDL_Event evenement;
 
 void afficher(char* chaine, TTF_Font* police_texte, SDL_Color coul_text, Uint16 posX, Uint16 posY);
 void aff_aide(const char* texte);
@@ -85,23 +85,23 @@
 
 /* Les variables globales nécessaires... */
 
-SDL_Surface *ecran; /* L'écran */
+extern SDL_Surface *ecran; /* L'écran */
 
-joueur tab_joueurs[NB_JOUEURS_T]; /* Ce tableau contient les configuration des joueurs */
-touches_joueur touches[4];
+extern joueur tab_joueurs[NB_JOUEURS_T]; /* Ce tableau contient les configuration des joueurs */
+extern touches_joueur touches[4];
 
-Uint8 nb_balles;
-balle_obj tab_balles[MAX_BALLES];
+extern Uint8 nb_balles;
+extern balle_obj tab_balles[MAX_BALLES];
 
-config_slime conf; /* La configuration actuelle (modifiable) */
+extern config_slime conf; /* La configuration actuelle (modifiable) */
 
-Uint8 act_conf;
+extern Uint8 act_conf;
 
-Uint32 ev_timer(Uint32 intervalle, void* param);
+extern Uint32 ev_timer(Uint32 intervalle, void* param);
 
-Uint16 h_ecran, l_ecran;
+extern Uint16 h_ecran, l_ecran;
 
-bool quitter;
-bool fen_ok;
-bool plein_ecran, aff_fps, aff_sc_perm;
+extern bool quitter;
+extern bool fen_ok;
+extern bool plein_ecran, aff_fps, aff_sc_perm;
 #endif
--- a/src/audio.c
+++ b/src/audio.c
@@ -26,6 +26,10 @@
 #include "slime.h"
 #include "audio.h"
 
+bool audio_desact;
+bool son_active;
+slime_son sons[NB_SONS];
+
 SDL_AudioSpec format_obtenu;
 
 slime_son* son_act;
--- a/src/audio.h
+++ b/src/audio.h
@@ -40,8 +40,8 @@
 
 void stop_son(void);
 
-bool audio_desact;
-bool son_active;
+extern bool audio_desact;
+extern bool son_active;
 
 enum {
 	SON_RBD_SLIME	= 0,
@@ -54,6 +54,6 @@
 	NB_SONS			= 7
 };
 
-slime_son sons[NB_SONS];
+extern slime_son sons[NB_SONS];
 
 #endif
--- a/src/reseau.c
+++ b/src/reseau.c
@@ -34,6 +34,11 @@
 #define PORT 2222 /* A changer aussi dans les messages */
 #define HANDSHAKE "HelloSV241"
 
+Uint8 nb_reseau; /* Nombre de joueurs réseau */
+Uint8 nb_total; /* Nombre de joueurs au total */
+UDPpacket* paquet;
+Uint8 clt_id_joueur;
+
 UDPsocket res_socket;
 IPaddress j_adresses[NB_JOUEURS_T];
 
--- a/src/reseau.h
+++ b/src/reseau.h
@@ -48,12 +48,12 @@
 Uint8 connecte_client(char* addr_ip);
 void deconnecte_client(void);
 
-Uint8 nb_reseau; /* Nombre de joueurs réseau */
-Uint8 nb_total; /* Nombre de joueurs au total */
+extern Uint8 nb_reseau; /* Nombre de joueurs réseau */
+extern Uint8 nb_total; /* Nombre de joueurs au total */
 
-UDPpacket* paquet;
+extern UDPpacket* paquet;
 
-Uint8 clt_id_joueur;
+extern Uint8 clt_id_joueur;
 
 #endif
 #endif
--- a/src/menu.c
+++ b/src/menu.c
@@ -31,6 +31,11 @@
 
 #define TEXTE_GAUCHE 170
 
+int decalage; /* Pour aligner les slimes par rapport au texte */
+Sint8 menu_act; /* L'élément de menu actuellement choisi */
+Uint8 menu_raf; /* L'élément de menu actuellement rafraichi */
+Sint8 action; /* Indique la touche pressée par l'utilisateur (gauche/retour/droite) */
+
 void affiche_menu(menu_elem* fonctions, Uint8 n, char* nom_retour) {
 	Uint8 i;
 
--- a/src/menu.h
+++ b/src/menu.h
@@ -41,10 +41,10 @@
 
 void affiche_menu(menu_elem* fonctions, Uint8 n, char* nom_retour);
 
-int decalage; /* Pour aligner les slimes par rapport au texte */
+extern int decalage; /* Pour aligner les slimes par rapport au texte */
 
-Sint8 menu_act; /* L'�l�ment de menu actuellement choisi */
-Uint8 menu_raf; /* L'�l�ment de menu actuellement rafraichi */
-Sint8 action; /* Indique la touche press�e par l'utilisateur (gauche/retour/droite) */
+extern Sint8 menu_act; /* L'�l�ment de menu actuellement choisi */
+extern Uint8 menu_raf; /* L'�l�ment de menu actuellement rafraichi */
+extern Sint8 action; /* Indique la touche press�e par l'utilisateur (gauche/retour/droite) */
 
 #endif
--- a/src/menu_options.c
+++ b/src/menu_options.c
@@ -26,7 +26,7 @@
 #include "reseau.h"
 #include "audio.h"
 
-char tmp_chaine[64];
+static char tmp_chaine[64];
 
 void m_touches_act(void) {
 	configClavier();
--- a/src/menu_princ.c
+++ b/src/menu_princ.c
@@ -27,7 +27,7 @@
 #include "slime.h"
 #include "themes.h"
 
-char tmp_chaine[64];
+static char tmp_chaine[64];
 
 char* m_vitesse_aff(void) {
 	const char* noms_confs[] = { N_("normal"), N_("turbo"), N_("sprint") , N_("fury") };