@@ -43,8 +43,8 @@ extern SDL_Renderer *sdlRenderer;
4343extern Sprite *Sprites;
4444extern sNewPreference Pref;
4545
46- extern int Horloge ;
47- extern int HorlogeAvant ;
46+ extern int currentTime ;
47+ extern int previousTime ;
4848
4949extern Level level;
5050
@@ -62,10 +62,10 @@ eMenu Editor::SDLMain(int NumNiv)
6262
6363 NumN = NumNiv;
6464
65- Affiche (); // Charge le tableau
65+ Draw (); // Charge le tableau
6666 SDL_RenderPresent (sdlRenderer);
6767
68- Horloge = SDL_GetTicks (); // Prend l'horloge
68+ currentTime = SDL_GetTicks (); // Prend l'horloge
6969
7070 Option = rail;
7171
@@ -82,7 +82,7 @@ eMenu Editor::SDLMain(int NumNiv)
8282 switch (event.type ) {
8383 case SDL_WINDOWEVENT:
8484 if (event.window .event == SDL_WINDOWEVENT_ENTER) {
85- Affiche ();
85+ Draw ();
8686 }
8787 break ;
8888 case SDL_KEYDOWN:
@@ -173,10 +173,10 @@ eMenu Editor::SDLMain(int NumNiv)
173173 case pluscourt:
174174 level.T [NumN].T [cy * LT + cx] = C_Reduit;
175175 break ;
176- case vitesse :
176+ case speed :
177177 level.T [NumN].T [cy * LT + cx] = C_Speed;
178178 break ;
179- case vie :
179+ case life :
180180 level.T [NumN].T [cy * LT + cx] = C_Live;
181181 break ;
182182 case (e_Sprite)(locomotive + D_Top):
@@ -193,12 +193,12 @@ eMenu Editor::SDLMain(int NumNiv)
193193 }
194194
195195 // Gère les Horloges et la pose
196- HorlogeAvant = Horloge ;
197- Horloge = SDL_GetTicks ();
196+ previousTime = currentTime ;
197+ currentTime = SDL_GetTicks ();
198198 Sleeping ();
199199
200200 // Fait l'affichage
201- Affiche ();
201+ Draw ();
202202 SDL_RenderPresent (sdlRenderer);
203203
204204 } while (true );
@@ -208,7 +208,7 @@ eMenu Editor::SDLMain(int NumNiv)
208208
209209/* ** Charge un tableau ***/
210210/* ************************/
211- void Editor::Affiche () const
211+ void Editor::Draw () const
212212{
213213 int i, x, y, m, cx, cy;
214214 unsigned char *T;
@@ -217,7 +217,7 @@ void Editor::Affiche() const
217217 T = level.T [NumN].T ;
218218
219219 // Fabrique le fond du jeu
220- Sprites[fond].Affiche (400 , 300 , 0 );
220+ Sprites[fond].Draw (400 , 300 , 0 );
221221
222222 // Affiche le circuit
223223 for (i = 0 ; i < LT * HT; i++) {
@@ -241,52 +241,52 @@ void Editor::Affiche() const
241241 m += 1 ;
242242 }
243243
244- Sprites[rail].Affiche (x, y, NumRail[m]);
244+ Sprites[rail].Draw (x, y, NumRail[m]);
245245 }
246246 }
247247
248248 // Affiche les décorations
249249 for (i = 0 ; i < level.T [NumN].NDeco ; i++) {
250- Sprites[deco].Affiche (level.T [NumN].Deco [i].x , level.T [NumN].Deco [i].y , level.T [NumN].Deco [i].NumSpr );
250+ Sprites[deco].Draw (level.T [NumN].Deco [i].x , level.T [NumN].Deco [i].y , level.T [NumN].Deco [i].NumSpr );
251251 }
252252
253253 // Affiche numero du niveau
254- AfficheChiffre (740 , 130 , NumN + 1 );
254+ DrawNumber (740 , 130 , NumN + 1 );
255255
256256 // Affiche les options
257257 for (i = 0 ; i < LT * HT; i++) {
258258 switch (T[i]) {
259259 case C_Wagon: // Si un loco
260- Sprites[wagon].Affiche (i % LT * D_Case + D_Case / 2 , i / LT * D_Case + D_Case / 2 , 25 );
260+ Sprites[wagon].Draw (i % LT * D_Case + D_Case / 2 , i / LT * D_Case + D_Case / 2 , 25 );
261261 break ;
262262 case C_Allonge: // Si plus long
263- Sprites[pluslong].Affiche (i % LT * D_Case + D_Case / 2 , i / LT * D_Case + D_Case / 2 , 25 );
263+ Sprites[pluslong].Draw (i % LT * D_Case + D_Case / 2 , i / LT * D_Case + D_Case / 2 , 25 );
264264 break ;
265265 case C_Reduit: // Si plus court
266- Sprites[pluscourt].Affiche (i % LT * D_Case + D_Case / 2 , i / LT * D_Case + D_Case / 2 , 25 );
266+ Sprites[pluscourt].Draw (i % LT * D_Case + D_Case / 2 , i / LT * D_Case + D_Case / 2 , 25 );
267267 break ;
268268 case C_Speed: // Si plus vite
269- Sprites[vitesse]. Affiche (i % LT * D_Case + D_Case / 2 , i / LT * D_Case + D_Case / 2 , 25 );
269+ Sprites[speed]. Draw (i % LT * D_Case + D_Case / 2 , i / LT * D_Case + D_Case / 2 , 25 );
270270 break ;
271271 case C_Live: // Si une vie
272- Sprites[vie]. Affiche (i % LT * D_Case + D_Case / 2 , i / LT * D_Case + D_Case / 2 , 25 );
272+ Sprites[life]. Draw (i % LT * D_Case + D_Case / 2 , i / LT * D_Case + D_Case / 2 , 25 );
273273 break ;
274274 }
275275 }
276276
277277 // Affiche le départ de la locomotive
278278 switch (level.T [NumN].DepDir ) {
279279 case D_Top:
280- Sprites[locomotive].Affiche (level.T [NumN].DepX * D_Case + D_Case / 2 , level.T [NumN].DepY * D_Case + D_Case / 2 , 0 );
280+ Sprites[locomotive].Draw (level.T [NumN].DepX * D_Case + D_Case / 2 , level.T [NumN].DepY * D_Case + D_Case / 2 , 0 );
281281 break ;
282282 case D_Bottom:
283- Sprites[locomotive].Affiche (level.T [NumN].DepX * D_Case + D_Case / 2 , level.T [NumN].DepY * D_Case + D_Case / 2 , 40 );
283+ Sprites[locomotive].Draw (level.T [NumN].DepX * D_Case + D_Case / 2 , level.T [NumN].DepY * D_Case + D_Case / 2 , 40 );
284284 break ;
285285 case D_Left:
286- Sprites[locomotive].Affiche (level.T [NumN].DepX * D_Case + D_Case / 2 , level.T [NumN].DepY * D_Case + D_Case / 2 , 80 );
286+ Sprites[locomotive].Draw (level.T [NumN].DepX * D_Case + D_Case / 2 , level.T [NumN].DepY * D_Case + D_Case / 2 , 80 );
287287 break ;
288288 case D_Right:
289- Sprites[locomotive].Affiche (level.T [NumN].DepX * D_Case + D_Case / 2 , level.T [NumN].DepY * D_Case + D_Case / 2 , 120 );
289+ Sprites[locomotive].Draw (level.T [NumN].DepX * D_Case + D_Case / 2 , level.T [NumN].DepY * D_Case + D_Case / 2 , 120 );
290290 break ;
291291 }
292292
@@ -296,35 +296,35 @@ void Editor::Affiche() const
296296 case wagon:
297297 case pluslong:
298298 case pluscourt:
299- case vitesse :
300- case vie :
301- Sprites[Option].Affiche (740 , 200 , 0 );
299+ case speed :
300+ case life :
301+ Sprites[Option].Draw (740 , 200 , 0 );
302302 break ;
303303 case (e_Sprite)(locomotive + D_Top):
304- Sprites[locomotive].Affiche (740 , 200 , 0 );
304+ Sprites[locomotive].Draw (740 , 200 , 0 );
305305 break ;
306306 case (e_Sprite)(locomotive + D_Bottom):
307- Sprites[locomotive].Affiche (740 , 200 , 40 );
307+ Sprites[locomotive].Draw (740 , 200 , 40 );
308308 break ;
309309 case (e_Sprite)(locomotive + D_Left):
310- Sprites[locomotive].Affiche (740 , 200 , 80 );
310+ Sprites[locomotive].Draw (740 , 200 , 80 );
311311 break ;
312312 case (e_Sprite)(locomotive + D_Right):
313- Sprites[locomotive].Affiche (740 , 200 , 120 );
313+ Sprites[locomotive].Draw (740 , 200 , 120 );
314314 break ;
315315 case deco:
316- Sprites[deco].Affiche (740 , 200 , NumDeco);
316+ Sprites[deco].Draw (740 , 200 , NumDeco);
317317 break ;
318318 default :
319319 break ;
320320 }
321321
322322 // Affiche le curseur
323323 if (Option != deco) {
324- Sprites[curseur]. Affiche (m_mouse.Px , m_mouse.Py , 0 );
324+ Sprites[cursor]. Draw (m_mouse.Px , m_mouse.Py , 0 );
325325 }
326326 else {
327- Sprites[deco].Affiche (m_mouse.Px , m_mouse.Py , NumDeco);
327+ Sprites[deco].Draw (m_mouse.Px , m_mouse.Py , NumDeco);
328328 }
329329}
330330
@@ -409,10 +409,10 @@ void Editor::PrendTouche(int Tou)
409409 }
410410
411411 // test le niveau
412- Pref.Niveau = NumN;
412+ Pref.Level = NumN;
413413 m_game.SDLMain ();
414414 m_mouse.Init (nullptr );
415- Affiche ();
415+ Draw ();
416416 break ;
417417 case ' a' :
418418 Option = rail;
@@ -427,10 +427,10 @@ void Editor::PrendTouche(int Tou)
427427 Option = pluscourt;
428428 break ;
429429 case ' t' :
430- Option = vitesse ;
430+ Option = speed ;
431431 break ;
432432 case ' y' :
433- Option = vie ;
433+ Option = life ;
434434 break ;
435435 }
436436}
0 commit comments