Skip to content

Commit 03db699

Browse files
authored
Translate code on english (#69)
1 parent 8a5806d commit 03db699

16 files changed

Lines changed: 482 additions & 482 deletions

src/audio.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
/*** Variable globales ***/
3434
/*************************/
3535
extern sNewPreference Pref;
36-
extern int Horloge;
36+
extern int currentTime;
3737

3838
/*** Constructeur et Destructeur ***/
3939
/***********************************/
@@ -162,10 +162,10 @@ void Audio::Play(eSon So)
162162
}
163163

164164
if (So == sClic) {
165-
if (Horloge - MemoHorloge <= 120) {
165+
if (currentTime - MemorizedTime <= 120) {
166166
return;
167167
}
168-
MemoHorloge = Horloge;
168+
MemorizedTime = currentTime;
169169
}
170170

171171
Mix_PlayChannel(-1, Son[So], 0);

src/audio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Audio
6666
/*** Variables ***/
6767
int N { 0 }; // Nombre d'échantillon audio
6868
int NMus { 0 }; // Numéro de la music en cours
69-
int MemoHorloge { 0 }; // Mémorise l'horloge pour les clics
69+
int MemorizedTime { 0 }; // Mémorise l'horloge pour les clics
7070
Mix_Chunk **Son { nullptr }; // Pointe sur les sons
7171
};
7272

src/editor.cc

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ extern SDL_Renderer *sdlRenderer;
4343
extern Sprite *Sprites;
4444
extern sNewPreference Pref;
4545

46-
extern int Horloge;
47-
extern int HorlogeAvant;
46+
extern int currentTime;
47+
extern int previousTime;
4848

4949
extern 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
}

src/editor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Editor
4343
/*** Fonctions ***/
4444
/*****************/
4545
eMenu SDLMain(int NumNiveau); // Boucle principale
46-
void Affiche() const; // Charge un tableau
46+
void Draw() const; // Charge un tableau
4747
void PrendTouche(int Touche); // Prend les touches enfoncées
4848

4949
private:

0 commit comments

Comments
 (0)