From e6ddb97518eb6265e642a1dbe9a39b5ab2a42011 Mon Sep 17 00:00:00 2001 From: zabidenhtf Date: Mon, 12 Jan 2026 13:48:44 +0200 Subject: [PATCH 1/2] Updated copyright to 2026 --- data/sprites.dat | Bin 27081376 -> 27081376 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/data/sprites.dat b/data/sprites.dat index b7e8eb377c5c7d9512b3e1a078609c270d3aa644..d44ba04aa64733fc3f82cc17f32093be69239676 100644 GIT binary patch delta 18875 zcmchf34B+@wZ{z-76~enNTMJ?h=O8;3JUHhxT1n}Uva@|MFCe_@Gm;JFT?~!LZXo8 zT5W}*qODf3w(fnR*t(zsqPSLY12=fz-~4B8?)`5h_}-h(=XYl2%sFSytoPje56t}b zo06H}N>gN7nGH>AQ*7Fpwx*qFZ#FU=Oo{1eHa44>O-(1WndxjwO_|x;bTQ?o!fau- zG+j+Mvz6&?DoqcwwdrYknJTl5+1B(neav=dd(+qKV18wGH2q9}^J}w{8DIvQoy{(0 zkQr=tHM^PJ%^qe?vzOW13^Dtdea%oa%h zt=Fzuv&L3G{Ag8Ebzc96pMAW@&OUc)WfM~}OOn;W-O+sHZSe*q$~%KMz)!#~ zXftnMQfJsEIb`}LWhz{?RGz<5`1u!P5hi(lN*751mAhcz}>c}v9`P~rJpnaCCWd5Mc^V0 zE}kT3PrA8bP+^-mH8V(zL+3TH8hiy_1$)ZvaY?r`W~rhBav!HXT5E@#X3J7AWYi_f zKZ9l9Mi{Mwlhn5Xe*vq&XJ88LVeOlvzb`t^0Zr2<;4ZKk_U+WOXZ-&-p#jn9)nF<3 z*^PMZ+Uw-Rw>3Sc%$T zZ+Jp%O6Q43+irH&xl;!vO%5xep-Dj7XcQjDjaHZo&?<+QuuCg<+{ip*&+R&ayN3V)tTUM-7qtg3z>DL^caiArbvhF zJ67Jn(`~sBdYJ;`QyEZR)FjOC?JQ-v36Yx(ns# zMZhk2q^5^vG8{!6JI()cFJ$MuS5u+uqCC143S1Y=`0(y%*L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dcr-JTJ(9*G{FQ)gPqk{D_^plp^^>vsF<^mirP8qj2ib!GiB~QsUoY@%#LYKoz6QvbQBgp$a_YE%b-YQdt|FR z!HmjWo$}S>1@&e188|nYw=vw&xv+SaZKmhLZ3c_ZL!Bve4=oqvVH*kZUS%EuIiUyoaMUKVKm{1rmsuo#mMuR@}Ma*SCqw!B+5Z1YKZ9i z9LVs=8V|IV`fHQ`GNehsxva*zke>~36>?wWt!D$!#bvOEqg{TsobYx#+RSRGOj{jQ zk*?20$B{E{R&hJj4FX8pjd8rnR&7fvTPUSpkD3~!lK}HGQ?ntN-|)HoSI&Li(e4f4 zJK%erz6Mt_DtD}=qntO&5&r?>4UIcyeZW(RF^*Tr7=`B?cWuzPBBPxLxgCIdqHLWV zNR!jH_>*c}qMLJ9+H~UXH+m!_BXv1I;@4gqNPY-Vh1tKTUo~bT)g;1v#-A;ZKj0s@ z2`9FEpSulS!EK1hZ;>g3`GZdB?@jr(zSuhXA13)O6)U0A-39-2Y`QNCCUC9rKDHa+ z+2TTgLv#My2wgqrQltJ*Y(s*a|3Dx)f1G?@iO>w%Y=UHFzU9smtZ=RSQ~kdbwyf z0!M(KfDeJmG9|M_g-o{3yJ<%W3n#{?dyMfq7$9xJ=eqZ+V2a)wgDE?P!tGJ&=&D}o zpY7V9Cr*4Z9dtZ~xX(9hcu@)P46p+DEAT9^5?BR12RskF0IUXH1YQEx0BeDDz{|jT zU<0rb_#3bZ*bMv~cm?p^w}*_C8H$*v;1n(R+xy~ui#^&#s^ zb`4oSvTMoulMNs%AiIw2da{9JgUD_m8%%a1*-d0Olifl#gzQ$bp=5t1yNzrZ*WPY-MuXK1((ARn8{{!=5Nx=XB From 04dd356f55fe10279dd27a81d045028c23fc0e4f Mon Sep 17 00:00:00 2001 From: zabidenhtf Date: Mon, 12 Jan 2026 13:49:19 +0200 Subject: [PATCH 2/2] Many code tips translated from french on english --- src/audio.cc | 24 +++++----- src/audio.h | 30 ++++++------- src/editor.cc | 60 ++++++++++++------------- src/editor.h | 12 ++--- src/game.cc | 108 +++++++++++++++++++++++---------------------- src/game.h | 30 ++++++------- src/level.cc | 20 ++++----- src/level.h | 34 +++++++-------- src/loco.cc | 118 +++++++++++++++++++++++++------------------------- src/main.cc | 34 +++++++-------- 10 files changed, 233 insertions(+), 237 deletions(-) diff --git a/src/audio.cc b/src/audio.cc index 5b812af..b177510 100644 --- a/src/audio.cc +++ b/src/audio.cc @@ -30,12 +30,12 @@ #include "utils.h" #include "preference.h" -/*** Variable globales ***/ +/*** Global varibles ***/ /*************************/ extern sNewPreference Pref; extern int Horloge; -/*** Constructeur et Destructeur ***/ +/*** Contructor and Destructor ***/ /***********************************/ Audio::~Audio() { @@ -51,7 +51,7 @@ Audio::~Audio() Mix_CloseAudio(); } -/*** Initialise l'Audio ***/ +/*** Audio initialization***/ /**************************/ bool Audio::Init() { @@ -62,11 +62,11 @@ bool Audio::Init() return false; } - /*** Allocation de la mémoire ***/ + /*** Memory allocation ***/ N = sFin; Son = new Mix_Chunk *[sFin]; - /*** Chargement des sons ***/ + /*** Loading sounds ***/ strcpy(PathFile, "Sounds/clic.wav"); Utils::GetPath(PathFile); Son[sClic] = Mix_LoadWAV(PathFile); @@ -110,7 +110,7 @@ bool Audio::Init() return true; } -/*** Charge une music 0=menu 1,2,3,4 = game ***/ +/*** Load music 0=menu 1,2,3,4 = game ***/ /**********************************************/ void Audio::LoadMusic(int Num) { @@ -124,12 +124,12 @@ void Audio::LoadMusic(int Num) if (Music) { PauseMusic(true); - Mix_HaltMusic(); // Arrete la music + Mix_HaltMusic(); // Stop music Mix_FreeMusic(Music); Music = nullptr; } - if (Num == 0) { // Si music du menu + if (Num == 0) { // If music from the menu strcpy(Provi, "Sounds/menu.mod"); Utils::GetPath(Provi); Music = Mix_LoadMUS(Provi); @@ -142,7 +142,7 @@ void Audio::LoadMusic(int Num) PlayMusic(); } -/*** Passe à la music de jeu suivante ***/ +/*** Skip to the next game music ***/ /****************************************/ void Audio::NextMusic() { @@ -153,7 +153,7 @@ void Audio::NextMusic() LoadMusic(NMus); } -/*** Fait la lecture d'un son ***/ +/*** Plays a sound ***/ /********************************/ void Audio::Play(eSon So) { @@ -171,7 +171,7 @@ void Audio::Play(eSon So) Mix_PlayChannel(-1, Son[So], 0); } -/*** Joue la music ***/ +/*** Play music ***/ /*********************/ void Audio::PlayMusic() const { @@ -195,7 +195,7 @@ void Audio::PauseMusic(bool Et) const } } -/*** Valide les Volumes ***/ +/*** Validates Volumes ***/ /**************************/ void Audio::DoVolume() const { diff --git a/src/audio.h b/src/audio.h index 4823562..b15ade1 100644 --- a/src/audio.h +++ b/src/audio.h @@ -26,7 +26,7 @@ #include -/*** Enumération des sons ***/ +/*** Enumeration of sounds***/ /****************************/ enum eSon { sClic = 0, @@ -41,7 +41,7 @@ enum eSon { sFin }; -/*** Définition de la classe Audio ***/ +/*** Audio class define ***/ /*************************************/ class Audio { @@ -49,25 +49,25 @@ class Audio Audio() = default; ~Audio(); - /*** Fonctions ***/ - bool Init(); // Initialise et charge les fichiers audio - void LoadMusic(int Num); // Charge une music, 0 = music du menu 1,2,3,4=Jeu - void NextMusic(); // Passe à la music suivante + /*** Functions ***/ + bool Init(); // Initialization of audio + void LoadMusic(int Num); // Load music, 0 = music for menu 1,2,3,4=Jeu + void NextMusic(); // Skip to the next game music - void Play(eSon); // Joue un son - void PlayMusic() const; // Joue la music + void Play(eSon); // Plays a sound + void PlayMusic() const; // Plays a music - void PauseMusic(bool Etat) const; // Met ou no la music en pause + void PauseMusic(bool Etat) const; // Pause music - void DoVolume() const; // Valide les volumes audio - Mix_Music *Music { nullptr }; // Pointe sur les musics + void DoVolume() const; // Validates Volumes + Mix_Music *Music { nullptr }; // Music pointer private: /*** Variables ***/ - int N { 0 }; // Nombre d'échantillon audio - int NMus { 0 }; // Numéro de la music en cours - int MemoHorloge { 0 }; // Mémorise l'horloge pour les clics - Mix_Chunk **Son { nullptr }; // Pointe sur les sons + int N { 0 }; // Number of audio samples + int NMus { 0 }; // Current music number + int MemoHorloge { 0 }; // Remembers the time for clicks + Mix_Chunk **Son { nullptr }; // Sound pointer }; #endif diff --git a/src/editor.cc b/src/editor.cc index b6ed9c2..94d81e7 100644 --- a/src/editor.cc +++ b/src/editor.cc @@ -36,7 +36,7 @@ #include "gamepad.h" #include "mouse.h" -/*** Variables globales ***/ +/*** Global varibles ***/ /**************************/ extern SDL_Renderer *sdlRenderer; @@ -62,17 +62,17 @@ eMenu Editor::SDLMain(int NumNiv) NumN = NumNiv; - Affiche(); // Charge le tableau + Affiche(); // Load the table SDL_RenderPresent(sdlRenderer); - Horloge = SDL_GetTicks(); // Prend l'horloge + Horloge = SDL_GetTicks(); // Clock Option = rail; - // Initialise la sourie + // Initialize the mouse m_mouse.Init(nullptr); - // Prend les evenements + // Event listener do { SDL_Event event; while (SDL_PollEvent(&event)) { @@ -112,15 +112,15 @@ eMenu Editor::SDLMain(int NumNiv) } } - // Gère l'appuis du boutton de la sourie + // Manages mouse button presses cx = m_mouse.Px / D_Case; cy = m_mouse.Py / D_Case; if (Boutton && cx < LT) { switch (Option) { case deco: - if (TypeB == -1) { // Si première fois que appuis sur la touche - for (i = 0; i < level.T[NumN].NDeco; i++) { // Recherche si décoration proche du clic + if (TypeB == -1) { // If it's the first time you press the key + for (i = 0; i < level.T[NumN].NDeco; i++) { // Search for decoration near the click dx = level.T[NumN].Deco[i].x - m_mouse.Px; dy = level.T[NumN].Deco[i].y - m_mouse.Py; d = dx * dx + dy * dy; @@ -135,7 +135,7 @@ eMenu Editor::SDLMain(int NumNiv) level.T[NumN].Deco[(level.T[NumN].NDeco - 1)].y = m_mouse.Py; TypeB = 1; } - else { // Fait passe la selection au premier plan + else { // This brings the selection to the front level.T[NumN].Deco[level.T[NumN].NDeco].NumSpr = level.T[NumN].Deco[TypeB].NumSpr; level.T[NumN].Deco[level.T[NumN].NDeco].x = level.T[NumN].Deco[TypeB].x; level.T[NumN].Deco[level.T[NumN].NDeco].y = level.T[NumN].Deco[TypeB].y; @@ -147,7 +147,7 @@ eMenu Editor::SDLMain(int NumNiv) NumDeco = level.T[NumN].Deco[(level.T[NumN].NDeco - 1)].NumSpr; } } - else { // Si pas la première fois remplace + else { // If not the first time replace level.T[NumN].Deco[(level.T[NumN].NDeco - 1)].NumSpr = NumDeco; level.T[NumN].Deco[(level.T[NumN].NDeco - 1)].x = m_mouse.Px; level.T[NumN].Deco[(level.T[NumN].NDeco - 1)].y = m_mouse.Py; @@ -192,7 +192,7 @@ eMenu Editor::SDLMain(int NumNiv) } } - // Gère les Horloges et la pose + // Manages the clocks and the installation HorlogeAvant = Horloge; Horloge = SDL_GetTicks(); Sleeping(); @@ -206,20 +206,20 @@ eMenu Editor::SDLMain(int NumNiv) return mQuit; } -/*** Charge un tableau ***/ +/*** Load the table ***/ /*************************/ void Editor::Affiche() const { int i, x, y, m, cx, cy; unsigned char *T; - // Prend l'adresse du niveau + // Takes the level address T = level.T[NumN].T; - // Fabrique le fond du jeu + // Create the game background Sprites[fond].Affiche(400, 300, 0); - // Affiche le circuit + // Draw circuit for (i = 0; i < LT * HT; i++) { if (T[i] >= C_Rail && T[i] < C_Fin) { y = i / LT * D_Case + D_Case / 2; @@ -245,36 +245,36 @@ void Editor::Affiche() const } } - // Affiche les décorations + // Draw decorations for (i = 0; i < level.T[NumN].NDeco; i++) { Sprites[deco].Affiche(level.T[NumN].Deco[i].x, level.T[NumN].Deco[i].y, level.T[NumN].Deco[i].NumSpr); } - // Affiche numero du niveau + // Draw level number AfficheChiffre(740, 130, NumN + 1); // Affiche les options for (i = 0; i < LT * HT; i++) { switch (T[i]) { - case C_Wagon: // Si un loco + case C_Wagon: // If wagon Sprites[wagon].Affiche(i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2, 25); break; - case C_Allonge: // Si plus long + case C_Allonge: // If long bonus Sprites[pluslong].Affiche(i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2, 25); break; - case C_Reduit: // Si plus court + case C_Reduit: // If short bonus Sprites[pluscourt].Affiche(i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2, 25); break; - case C_Speed: // Si plus vite + case C_Speed: // If speed bonus Sprites[vitesse].Affiche(i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2, 25); break; - case C_Live: // Si une vie + case C_Live: // If live bonus Sprites[vie].Affiche(i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2, 25); break; } } - // Affiche le départ de la locomotive + // Display locomotive direction switch (level.T[NumN].DepDir) { case D_Top: Sprites[locomotive].Affiche(level.T[NumN].DepX * D_Case + D_Case / 2, level.T[NumN].DepY * D_Case + D_Case / 2, 0); @@ -290,7 +290,7 @@ void Editor::Affiche() const break; } - // Affiche l'option choisi dans le menu + // Displays the option selected in the menu switch (Option) { case rail: case wagon: @@ -319,7 +319,7 @@ void Editor::Affiche() const break; } - // Affiche le curseur + // Show cursor if (Option != deco) { Sprites[curseur].Affiche(m_mouse.Px, m_mouse.Py, 0); } @@ -328,7 +328,7 @@ void Editor::Affiche() const } } -/*** Prend les touches enfoncées ***/ +/*** Keyboard callback ***/ /***********************************/ void Editor::PrendTouche(int Tou) { @@ -392,23 +392,23 @@ void Editor::PrendTouche(int Tou) level.Clear(NumN); break; case '$': - // test si le dernier niveau est vide + // test if the last level is empty for (j = i = 0; i < LT * HT; i++) { j += level.T[level.N - 1].T[i]; } if (j == 0) { if (NumN < level.N - 1) { - level.N--; // Si vide ne le compte pas + level.N--; //If empty, don't count it. } } - // Sauve le niveau + // Save the level if (level.Save() == false) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error while saving levels"); exit(-1); } - // test le niveau + // Test the level Pref.Niveau = NumN; m_game.SDLMain(); m_mouse.Init(nullptr); diff --git a/src/editor.h b/src/editor.h index 7b260bf..360ddb2 100644 --- a/src/editor.h +++ b/src/editor.h @@ -31,7 +31,7 @@ class Mouse; class Game; class Gamepad; -/*** Définition de la class ***/ +/*** Editor class define ***/ /******************************/ class Editor { @@ -40,15 +40,15 @@ class Editor m_mouse(mouse), m_game(game), m_gamepad(gamepad) { }; ~Editor() = default; - /*** Fonctions ***/ + /*** Functions***/ /*****************/ - eMenu SDLMain(int NumNiveau); // Boucle principale - void Affiche() const; // Charge un tableau - void PrendTouche(int Touche); // Prend les touches enfoncées + eMenu SDLMain(int NumNiveau); // Mainloop + void Affiche() const; // Load a table + void PrendTouche(int Touche); // Takes pressed keys private: /*** Variables ***/ - int N { 0 }; // Numero du tableau à éditer + int N { 0 }; // Table number to be edited e_Sprite Option { locomotive }; int NumDeco { 0 }; int NumN { 0 }; diff --git a/src/game.cc b/src/game.cc index 273a27b..1598269 100644 --- a/src/game.cc +++ b/src/game.cc @@ -37,7 +37,7 @@ #include "utils.h" #include "audio.h" -/*** Variables globales ***/ +/*** Global varibles ***/ /**************************/ extern SDL_Renderer *sdlRenderer; @@ -53,9 +53,9 @@ extern Level level; static int NumRail[] = { -1, -1, -1, 0, -1, 1, 2, 3, -1, 4, 5, 6, 7, 8, 9, 10 }; -int MasqueK; // Masque pour les touches de déplacement +int MasqueK; // Mask for the movement keys -/*** Constructeur et Destructeur ***/ +/*** Constuctor and destructor ***/ /***********************************/ Game::Game(Audio &sounds, Gamepad &gamepad) : m_sounds(sounds), m_gamepad(gamepad), Lo(m_sounds) @@ -74,20 +74,20 @@ eMenu Game::SDLMain() int NumN = Pref.Niveau; Help = true; - Load(NumN); // Charge le tableau + Load(NumN); // Load the table SDL_RenderPresent(sdlRenderer); Ec.CleanSpriteAndScreen(fjeu); Pause = true; - Horloge = SDL_GetTicks(); // Prend l'horloge + Horloge = SDL_GetTicks(); // Clock DureeJeu = 0; Key = 0; - // Met le options de départ du joueur + // Set the player's starting options Pref.NVie = N_VIES_DEP; Pref.Score = 0; - // Prend les evenements + // Event listener do { bool doScreenshot = false; SDL_RenderClear(sdlRenderer); @@ -99,8 +99,8 @@ eMenu Game::SDLMain() case SDL_WINDOWEVENT: if (event.window.event == SDL_WINDOWEVENT_ENTER) { } - else if (event.window.event == SDL_WINDOWEVENT_LEAVE) { // Si désactive l'ecran - Pause = true; // Met en Pause + else if (event.window.event == SDL_WINDOWEVENT_LEAVE) { // If you turn off the screen + Pause = true; // Enable pause } break; case SDL_MOUSEBUTTONDOWN: @@ -218,7 +218,7 @@ eMenu Game::SDLMain() } } - // Gère les Horloges et la pose + // Manages the clocks and the installation HorlogeAvant = Horloge; Horloge = SDL_GetTicks(); Sleeping(); @@ -227,7 +227,7 @@ eMenu Game::SDLMain() } DureeJeu += Horloge - HorlogeAvant; - // Fait l'affichage + // Display DrawLevel(NumN); AfficheEcran(); SDL_RenderPresent(sdlRenderer); @@ -236,15 +236,15 @@ eMenu Game::SDLMain() Utils::doScreenshot(sdlRenderer); } - // Fait avancer la loco + // Move the locomotive forward if (Lo.Mort == -1 && Pause == false) { Lo.Avance(Horloge - HorlogeAvant, DureeJeu, Touche, T); } - // Test la fin d'une partie - if (Lo.Mort > -1 && Lo.Mort < Horloge) { // Si est Mort test si doit continuer ou quitter + // Test the end of a game + if (Lo.Mort > -1 && Lo.Mort < Horloge) { // If it's dead, test to see if it should continue or quit. if (Pref.NVie < 0) { - return mScoreEdit; // Si mort fini + return mScoreEdit; // If death ends } if (Lo.Gagne) { #ifndef DCHILDREN @@ -273,7 +273,7 @@ eMenu Game::SDLMain() return mQuit; } -/*** Charge un tableau ***/ +/*** Load a table ***/ /*************************/ bool Game::Load(int NivN) { @@ -281,12 +281,12 @@ bool Game::Load(int NivN) Pref.Niveau = NivN; - // Recopie le tableau + // Copy the table for (i = 0; i < LT * HT; i++) { T[i] = (int)level.T[NivN].T[i]; } - // Laisse ou efface la vie suivant le niveau + // Leave or erase life depending on the level switch (Pref.Difficulte) { case Easy: i = 5; @@ -305,12 +305,12 @@ bool Game::Load(int NivN) } } - // Initialise la locomotive + // Initialisate locomotive Lo.Init(level.T[NivN].DepX + level.T[NivN].DepY * LT, level.T[NivN].DepDir); BufTouche(level.T[NivN].DepDir); MasqueK = 0; - // Met la vitesse suivant difficulté + // Set the speed according to difficulty switch (Pref.Difficulte) { case Easy: Pref.Vitesse = Pref.VitesseMoy = VITESSE_MIN; @@ -325,16 +325,16 @@ bool Game::Load(int NivN) return DrawLevel(NivN); } -/*** Dessine le fond de l'ecran de jeu ***/ +/*** Draw background of game ***/ /*****************************************/ bool Game::DrawLevel(int NivN) { int i, x, y, m, cx, cy; - // Fabrique le fond du jeu + // Create the game's background Sprites[fond].Affiche(400, 300, 0, Sprites[fjeu].Image[0]); - // Affiche le circuit + // Draw the circuit for (i = 0; i < LT * HT; i++) { if (T[i] >= C_Rail && T[i] < C_Fin) { y = i / LT * D_Case + D_Case / 2; @@ -360,7 +360,7 @@ bool Game::DrawLevel(int NivN) } } - // Affiche les décorations + // Draw decorations #ifndef DCHILDREN for (i = 0; i < level.T[NivN].NDeco; i++) { Sprites[deco].Affiche(level.T[NivN].Deco[i].x, level.T[NivN].Deco[i].y, level.T[NivN].Deco[i].NumSpr, @@ -368,7 +368,7 @@ bool Game::DrawLevel(int NivN) } #endif - // Affiche les textes suivant la langue + // Displays texts according to language AfficheText(740, 110, T_level, Sprites[fjeu].Image[0]); AfficheText(740, 180, T_score, Sprites[fjeu].Image[0]); AfficheText(740, 260, T_options, Sprites[fjeu].Image[0]); @@ -379,8 +379,8 @@ bool Game::DrawLevel(int NivN) return true; } -/*** Fait tourner la fleche d'une simple touche ***/ -/**************************************************/ +/*** Rotates the arrow with a single touch ***/ +/*********************************************/ void Game::TourneFleche() { int To = Touche[0]; @@ -389,8 +389,8 @@ void Game::TourneFleche() int const y = Lo.PInter / LT; do { - // Fait toucher la direction dans le sens des aiguilles d'une montre - // et test si la nouvelle direction est possible + // Makes the direction touch in a clockwise direction + // and test if the new direction is possible switch (To) { case D_Top: To = D_Right; @@ -419,29 +419,29 @@ void Game::TourneFleche() } } while (Cherche == false); - BufTouche(To); // Mémorise la nouvelle touche par defaut. + BufTouche(To); // Remembers the new default key. } -/*** Mémorise une touche dans le buffet des touches ***/ +/*** Stores a key in the keypad ***/ /******************************************************/ void Game::BufTouche(int Tou) { int n = 0; - // Favorise la touche + // Promotes the touch while (Touche[n] != Tou) { - n++; // Prend position de la touche + n++; // Takes position of the key } - if (n) { // Si changement doit faire un décalage + if (n) { // If change is going to cause a shift while (n) { Touche[n] = Touche[n - 1]; n--; } - Touche[0] = Tou; // Mémorise la touche + Touche[0] = Tou; // Remember key } - // Cherche son oposé + // Looking for its opposite switch (Tou) { case D_Top: Tou = D_Bottom; @@ -457,22 +457,22 @@ void Game::BufTouche(int Tou) break; } - // Défavorise son oposé. + // Disadvantages its opposite. n = 3; while (Touche[n] != Tou) { - n--; // Prend position de la touche + n--; // Takes position of the key } - if (n < 3) { // Si changement doit faire un décalage + if (n < 3) { // If change is going to cause a shift while (n < 3) { Touche[n] = Touche[n + 1]; n++; } - Touche[3] = Tou; // Mémorise la touche + Touche[3] = Tou; // Remember key } } -/*** Test les directions possibles pour les fleches ***/ +/*** Test the possible directions for the arrows ***/ /******************************************************/ int Game::TestFleche(int Haut, int Bas, int Gauche, int Droite) { @@ -507,20 +507,19 @@ int Game::TestFleche(int Haut, int Bas, int Gauche, int Droite) return 0; } -/*** Affiche un ecran du jeu ***/ -/*******************************/ +/*** Render a screenshot of the game ***/ +/***************************************/ void Game::AfficheEcran() { int i; int ndir = 0; - // Prépare pour nouvelle Affichage + // Prepare for new display Ec.ClearSprite(fjeu); - // Fait nouvelle Affichage - Lo.Display(Ec); // Affiche la loco + Lo.Display(Ec); // Render locomotive - if (Lo.PInter != -1 && Help) { // Affiche la fleche sur la futur intersection + if (Lo.PInter != -1 && Help) { // Displays the arrow on the future intersection switch (Lo.PEntree) { case D_Left: ndir = TestFleche(0, 2, -1, 1); @@ -539,33 +538,32 @@ void Game::AfficheEcran() Ec.PrintSprite(dir, ndir, (Lo.PInter % LT) * D_Case + D_Case / 2, (Lo.PInter / LT) * D_Case + D_Case / 2); } - // Affiche les options + // Render options section for (i = 0; i < LT * HT; i++) { switch (T[i]) { - case C_Wagon: // Si un loco + case C_Wagon: // If wagon Ec.PrintSprite(wagon, (DureeJeu * 40 / 1000 + i * 7) % 50, i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2); break; - case C_Allonge: // Si plus long + case C_Allonge: // If long bonus Ec.PrintSprite(pluslong, (DureeJeu * 40 / 1000 + i * 7) % 50, i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2); break; - case C_Reduit: // Si plus court + case C_Reduit: // If short bonus Ec.PrintSprite(pluscourt, (DureeJeu * 40 / 1000 + i * 7) % 50, i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2); break; - case C_Speed: // Si plus vite + case C_Speed: // If speed bonus Ec.PrintSprite(vitesse, (DureeJeu * 40 / 1000 + i * 7) % 50, i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2); break; - case C_Live: // Si une vie + case C_Live: // If live bonus Ec.PrintSprite(vie, (DureeJeu * 40 / 1000 + i * 7) % 50, i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2); break; } } - // Si en pose demande une touche if (Pause) { Ec.PrintText(T_press_any_key, LT * D_Case / 2, 300); } - // Affiche tableau de bord + // Render bonuses on board Ec.PrintOptions(Pref.NVie, Pref.Score); if (Pref.EcartWagon < ECARTWAGON_MOY) { Ec.PrintSprite(pluscourt, (DureeJeu * 40 / 1000) % 50, 715, 295); diff --git a/src/game.h b/src/game.h index 3fdaa5a..0250dc6 100644 --- a/src/game.h +++ b/src/game.h @@ -31,7 +31,7 @@ class Audio; class Menu; class Gamepad; -/*** Définition de la class ***/ +/*** Game class define ***/ /******************************/ class Game { @@ -40,33 +40,33 @@ class Game ~Game() = default; void setMenu(Menu *menu) { m_menu = menu; } - /*** Fonctions ***/ + /*** Functions ***/ /*****************/ - eMenu SDLMain(); // Boucle principale - bool Load(int NivN); // Charge un tableau - bool DrawLevel(int NivN); // Dessine le niveau + eMenu SDLMain(); // SDL Main + bool Load(int NivN); // Load a table + bool DrawLevel(int NivN); // Draw background of game - void TourneFleche(); // Fait tourner la fleche d'un simple clic. - void BufTouche(int Touche); // Met une nouvelle touche dans le buffet - int TestFleche(int Haut, int Bas, int Gauche, int Droite); // Test la direction de sortie de la fleche - void AfficheEcran(); // Fait l'affichage d'un ecran de jeu + void TourneFleche(); // Rotates the arrow with a single touch. + void BufTouche(int Touche); // Stores a key in the keypad + int TestFleche(int Haut, int Bas, int Gauche, int Droite); // Test the possible directions for the arrows + void AfficheEcran(); // Render a screenshot of the game private: /*** Variables ***/ bool Pause { false }; // Si en pose - long DureeJeu { 0 }; // Horloge de durée du jeu + long DureeJeu { 0 }; // Game duration clock - int Key { 0 }; // Mémorise la touche enfoncée - int Touche[4]; // Direction demandée - int T[LT * HT]; // Pointe sur le tableau + int Key { 0 }; // Key buffer + int Touche[4]; // Direction requested + int T[LT * HT]; // Table pointer - bool Help { true }; // Si doit affiche les fleches d'aide + bool Help { true }; // If it enabled should display the help arrows Audio &m_sounds; Gamepad &m_gamepad; Menu *m_menu { nullptr }; - Loco Lo; // Gère la locomotive + Loco Lo; // Locomotive object }; #endif diff --git a/src/level.cc b/src/level.cc index 2a64f36..dc103b1 100644 --- a/src/level.cc +++ b/src/level.cc @@ -25,7 +25,7 @@ #include "utils.h" #include "level.h" -/*** Constructeurs ***/ +/*** Contructor ***/ /*********************/ Level::Level() { @@ -35,7 +35,7 @@ Level::Level() } } -/*** Charge les tableaux ***/ +/*** Load the table ***/ /***************************/ bool Level::Load() { @@ -50,7 +50,7 @@ bool Level::Load() return false; } - // Charge les tableaux + // Load the table N = (int)(Buf[0]) * 256 + (int)(Buf[1]); for (i = 0; i < N; i++) { @@ -75,7 +75,7 @@ bool Level::Load() return true; } -/*** Sauve les tableaux ***/ +/*** Save the table ***/ /**************************/ bool Level::Save() { @@ -84,13 +84,13 @@ bool Level::Save() int i, j; char NameLevelFile[512] = "levels.dat"; - // Alloue la mémoire + // Allocate memory Buf = new unsigned char[sizeof(s_Level) * N + sizeof(int) + 1]; if (Buf == nullptr) { return false; } - // Charge les tableaux + // Load the table Buf[0] = N / 256; Buf[1] = N % 256; @@ -119,7 +119,7 @@ bool Level::Save() } } - // Sauve les tableaux + // Save the table Utils::GetPath(NameLevelFile); if (Utils::SaveFile(NameLevelFile, (char *)Buf, P) == false) { delete[] Buf; @@ -130,7 +130,7 @@ bool Level::Save() return true; } -/*** Efface un Tableau ***/ +/*** Clear the table ***/ /*************************/ void Level::Del(int Num) { @@ -155,7 +155,7 @@ void Level::Del(int Num) } } -/*** Insert un Tableau ***/ +/*** Insert a Table ***/ /*************************/ void Level::Ins(int Num) { @@ -182,7 +182,7 @@ void Level::Ins(int Num) } } -/*** Vide un tableau ***/ +/*** Clear a table ***/ /***********************/ void Level::Clear(int Num) { diff --git a/src/level.h b/src/level.h index a4f0576..809328d 100644 --- a/src/level.h +++ b/src/level.h @@ -26,43 +26,43 @@ #include "preference.h" -/*** Définition de la structure d'un tableau ***/ -/***********************************************/ +/*** Table/level structure define ***/ +/***************************************/ struct s_Deco { - int NumSpr; // Numéro et position du sprite décoratif + int NumSpr; // Number and position of the decorative sprite int x; int y; }; struct s_Level { - unsigned char T[LT * HT]; // Définition du circuit et des options - int DepX; // Départ de la locomotive + unsigned char T[LT * HT]; // Circuit definition and options + int DepX; // Departure of the locomotive int DepY; - int DepDir; // Direction du départ - int NDeco; // Nombre d'éléments décoratifs + int DepDir; // Direction + int NDeco; // Number of decorative elements struct s_Deco Deco[32]; }; -/*** Définition de la classe ***/ -/*******************************/ +/*** Table/level class define ***/ +/********************************/ class Level { public: Level(); ~Level() = default; - /*** Fonctions ***/ - bool Load(); // charge les tableaux - bool Save(); // Sauve les tableaux - void Del(int Num); // efface un tableau - void Ins(int Num); // Insert un tableau vièrge - void Clear(int Num); // Vide un tableau + /*** Functions ***/ + bool Load(); // Load the table + bool Save(); // Save the table + void Del(int Num); // Clear the table + void Ins(int Num); // Insert a Table + void Clear(int Num); // Clear a table /*** Variables ***/ - int N { 0 }; // Nombre de niveau - s_Level T[MAX_N_LEVEL_IN_MEMORY]; // Pointe sur les tableaux + int N { 0 }; // Number of levels + s_Level T[MAX_N_LEVEL_IN_MEMORY]; // Table pointer }; #endif diff --git a/src/loco.cc b/src/loco.cc index 1889a76..8c17f26 100644 --- a/src/loco.cc +++ b/src/loco.cc @@ -33,7 +33,7 @@ #define M_PI 3.141592654 #endif -/*** Variables globales ***/ +/*** Global varibles ***/ /**************************/ extern sNewPreference Pref; extern int Horloge; @@ -41,7 +41,7 @@ extern int MasqueK; int AddDir[] = { -1, 1, -LT, LT }; -/*** Construteur et Destructeur ***/ +/*** Constructor and destructor ***/ /**********************************/ Loco::Loco(Audio &audio) : m_audio(audio) @@ -49,26 +49,26 @@ Loco::Loco(Audio &audio) : Init(LT / 2 + HT / 2 * LT, D_Right); } -/*** Initialise la locomotive ***/ -/********************************/ +/*** Locomotive initialisation ***/ +/*********************************/ void Loco::Init(int Pos, int Direction) { int i; unsigned char Ar = 0; - PLoco = 0; // Pointe sur la première case + PLoco = 0; PInter = -1; - Vitesse = Reduit = Alonge = 0; // Pas d'alongement + Vitesse = Reduit = Alonge = 0; Mort = -1; Gagne = false; Pref.EcartWagon = ECARTWAGON_MOY; - // Initialise les variables + // Varibles initilization for (i = 0; i < 256; i++) { PosWagon[i].SprStart = 0; } - // Cherche le case Avant + // Look at direction switch (Direction) { case D_Top: Pos += LT; @@ -88,19 +88,18 @@ void Loco::Init(int Pos, int Direction) break; } - // Initialise le Tableau et la loco - D = D_Case * 1.99; // Positionne la tete presque à la fin + D = D_Case * 1.99; T[PLoco].P = Pos; T[PLoco].Arrive = Ar; T[PLoco].Sortie = Direction; T[PLoco].D = D_Case; - // Fait avancer d'une case + // Moves forward one space Go(Direction); Go(Direction); - // Initialise la loco et son wagon à charbon + // Initialize the locomotive and its coal wagon NWagon = 2; Wagon[0] = locomotive; Wagon[1] = charbon; @@ -113,20 +112,20 @@ void Loco::Init(int Pos, int Direction) MemoDuree = 0; } -/*** Affiche la locomotive ***/ -/*****************************/ +/*** Render locomotive ***/ +/*************************/ void Loco::Display(Screen &Ec) { float ltrain = 0; float p1, p2, a, ar, vx, vy; int x1, x2, y1, y2; int i, ns = 0; - int cdx, cdy, cfx = 0, cfy = 0; // Points d'accroche des cables + int cdx, cdy, cfx = 0, cfy = 0; // Cable attachment points float lv; - // Affiche tous les wagons + // Render wagons for (i = 0; i < NWagon; i++) { - // Cherche les points du wagons + // Find the points on the wagons switch (Wagon[i]) { case charbon: p1 = ltrain + 11; @@ -141,17 +140,17 @@ void Loco::Display(Screen &Ec) lv = 20; } - // Calcule la position des points + // Calculate the position of the points FindPoint(D - p1, x1, y1); FindPoint(D - p2, x2, y2); - PosWagon[i].dx = x1; // Sauve la position des points pour test de colision futur + PosWagon[i].dx = x1; // Saves the position of the points for future collision testing PosWagon[i].dy = y1; PosWagon[i].fx = x2; PosWagon[i].fy = y2; - // Calcule l'angle de rotation de la loco et le N° du Sprite - if (x1 <= x2) { // Angle 0 à 180 compris + // Calculate locomotive rotation angle and sprite number + if (x1 <= x2) { // Angle 0 - 180 vy = (float)(x2 - x1); vx = (float)(y2 - y1); if (vx != 0) { @@ -164,7 +163,7 @@ void Loco::Display(Screen &Ec) a = 180.0 + a; } } - else { // Angle 180.001 à 359.999 + else { // Angle 180 - 359 vy = (float)(x1 - x2); vx = (float)(y1 - y2); if (vx != 0) { @@ -179,35 +178,35 @@ void Loco::Display(Screen &Ec) } ar = a * M_PI / 180.0; - // Prend le centre du sprite + // Take the center of the sprite x1 = (x1 + x2) / 2; y1 = (y1 + y2) / 2; - // Affiche les cables de liaison - if (i > 0) { // Si doit afficher les cables - // Calcule le point d'accroche en sortie + // Render cable + if (i > 0) { // If it should render cable + // Calculate the attachment point cdx = x1 - (int)(sin(ar) * lv); cdy = y1 - (int)(cos(ar) * lv); - // Affiche le cable + // Render cable Ec.PrintCable(cdx, cdy, cfx, cfy); } // Calcule le crocher de fin pour le prochaine wagon cfx = x1 - (int)(sin(ar + M_PI) * lv); cfy = y1 - (int)(cos(ar + M_PI) * lv); - // Cherche le N° du Sprite + // Find sprite number switch ((int)a) { - case 0: // En haut + case 0: // Up ns = (int)(y1 + D_Case / 2) % (int)D_Case; break; - case 180: // En bas + case 180: // Down ns = (int)(y1 + D_Case / 2) % (int)D_Case + 40; break; - case 90: // Gauche + case 90: // Left ns = (int)(x1 + D_Case / 2) % (int)D_Case + 80; break; - case 270: // Droite + case 270: // Right ns = (int)(x1 + D_Case / 2) % (int)D_Case + 120; break; default: @@ -220,7 +219,6 @@ void Loco::Display(Screen &Ec) Ec.PrintSprite(Wagon[i], ns, x1, y1); - // Si pas fini la sequence d'affiche de départ du wagon if (PosWagon[i].SprStart < N_SPR_START) { PosWagon[i].SprStart += MemoDuree * N_SPR_START / 750.0; if (PosWagon[i].SprStart < N_SPR_START) { @@ -228,31 +226,31 @@ void Loco::Display(Screen &Ec) } } - // Met l'ecart entre les wagons + // Place the gap between the wagons ltrain += Pref.EcartWagon; } } -/*** Test les options sur une case ***/ -/*************************************/ +/*** Colision test ***/ +/*********************/ void Loco::TestCase(float Dist, long DureeJeu, int *Tableau) { int i; float DMoy; float Ec1, vx, vy, Ec2; - // test si depasse milieu d'une case pour teste de colision + // Test if it crosses the middle of a cell for collision testing DMoy = (T[PLoco].D + T[PLoco - 1].D) / 2.0; if (D <= DMoy && D + Dist >= DMoy) { - // Test si sur une option + // Test if on an option switch (Tableau[T[PLoco].P]) { - case C_Wagon: // Une nouvelle loco + case C_Wagon: // A new wagon m_audio.Play(sWagon); - Tableau[T[PLoco].P] = 1; // efface l'option + Tableau[T[PLoco].P] = 1; Pref.Score += 5; - AddLoco(); // Ajoute une loco au azard + AddLoco(); // Add random wagon - Gagne = true; // Test si la dernière loco + Gagne = true; // Test if the last wagon for (i = 0; i < LT * HT; i++) { if (Tableau[i] == C_Wagon) { Gagne = false; @@ -263,9 +261,9 @@ void Loco::TestCase(float Dist, long DureeJeu, int *Tableau) m_audio.Play(sEnd); } break; - case C_Allonge: // Alonge la loco + case C_Allonge: // Allonge locomotive m_audio.Play(sEtire); - Tableau[T[PLoco].P] = 1; // efface l'option + Tableau[T[PLoco].P] = 1; Pref.Score += 20; if (Reduit > DureeJeu) { Reduit = DureeJeu - 1; @@ -274,9 +272,9 @@ void Loco::TestCase(float Dist, long DureeJeu, int *Tableau) Alonge = DureeJeu + DUREE_ALONGE; } break; - case C_Reduit: // Si réduit la loco + case C_Reduit: // Reduit locomotive m_audio.Play(sReduit); - Tableau[T[PLoco].P] = 1; // efface l'option + Tableau[T[PLoco].P] = 1; if (Alonge > DureeJeu) { Alonge = DureeJeu - 1; } @@ -284,9 +282,9 @@ void Loco::TestCase(float Dist, long DureeJeu, int *Tableau) Reduit = DureeJeu + DUREE_REDUIT; } break; - case C_Speed: // Si Vitesse + case C_Speed: // Speed up locomotive m_audio.Play(sSpeed); - Tableau[T[PLoco].P] = 1; // efface l'option + Tableau[T[PLoco].P] = 1; Pref.Score += 30; Vitesse = DureeJeu + DUREE_VITESSE; break; @@ -297,7 +295,7 @@ void Loco::TestCase(float Dist, long DureeJeu, int *Tableau) break; } - // Test de colision avec un autre Wagon + // Test colision with other wagon for (i = 1; i < NWagon; i++) { vx = (float)(PosWagon[i].dx - PosWagon[0].dx); vy = (float)(PosWagon[i].dy - PosWagon[0].dy); @@ -306,7 +304,7 @@ void Loco::TestCase(float Dist, long DureeJeu, int *Tableau) vy = (float)(PosWagon[i].fy - PosWagon[0].dy); Ec2 = vx * vx + vy * vy; - // Si colition le signale + // If signal if (Mort < Horloge && (Ec1 < RAYON_TOUCHE || Ec2 <= RAYON_TOUCHE)) { m_audio.Play(sCrash); Pref.NVie--; @@ -316,8 +314,8 @@ void Loco::TestCase(float Dist, long DureeJeu, int *Tableau) } } -/*** Fait Avancer la locomotive ***/ -/**********************************/ +/*** Move the locomotive forward ***/ +/***********************************/ void Loco::Avance(int Duree, long DureeJeu, int *Touche, int *Tableau) { int i; @@ -327,17 +325,17 @@ void Loco::Avance(int Duree, long DureeJeu, int *Touche, int *Tableau) TestCase(Dist, DureeJeu, Tableau); - // Test si doit Réduire le wagon + // Test if it needs to reduce the wagon if (Reduit > DureeJeu) { - if (Pref.EcartWagon > ECARTWAGON_MIN) { // Si doit réduire + if (Pref.EcartWagon > ECARTWAGON_MIN) { // If must reduce Pref.EcartWagon -= (float)(Duree) * (Pref.VitesseMoy * 0.8 / (float)(NWagon - 1)) / 1000.0; if (Pref.EcartWagon < ECARTWAGON_MIN) { Pref.EcartWagon = ECARTWAGON_MIN; } } } - else { // Si temps est passé - if (Pref.EcartWagon < ECARTWAGON_MOY) { // Si doit ralonger le wagon + else { // If time has passed + if (Pref.EcartWagon < ECARTWAGON_MOY) { // If the wagon needs to be lengthened Pref.EcartWagon += (float)(Duree) * (Pref.VitesseMoy * 0.8 / (float)(NWagon)) / 1000.0; if (Pref.EcartWagon > ECARTWAGON_MOY) { Pref.EcartWagon = ECARTWAGON_MOY; @@ -345,17 +343,17 @@ void Loco::Avance(int Duree, long DureeJeu, int *Touche, int *Tableau) } } - // Test si doit Ralonger le wagon + // Test if the wagon needs to be lengthened if (Alonge > DureeJeu) { - if (Pref.EcartWagon < ECARTWAGON_MAX) { // Si doit Ralonger + if (Pref.EcartWagon < ECARTWAGON_MAX) { // If it needs to be extended Pref.EcartWagon += (float)(Duree) * (Pref.VitesseMoy * 0.8 / (float)(NWagon)) / 1000.0; if (Pref.EcartWagon > ECARTWAGON_MAX) { Pref.EcartWagon = ECARTWAGON_MAX; } } } - else { // Si temps est passé - if (Pref.EcartWagon > ECARTWAGON_MOY) { // Si doit ralonger le wagon + else { // If time has passed + if (Pref.EcartWagon > ECARTWAGON_MOY) { // If the wagon needs to be lengthened Pref.EcartWagon -= (float)(Duree) * (Pref.VitesseMoy * 0.8 / (float)(NWagon - 1)) / 1000.0; if (Pref.EcartWagon < ECARTWAGON_MOY) { Pref.EcartWagon = ECARTWAGON_MOY; diff --git a/src/main.cc b/src/main.cc index 1100443..5860a42 100644 --- a/src/main.cc +++ b/src/main.cc @@ -46,27 +46,27 @@ #include "editor.h" #include "utils.h" -/*** Variables globales ***/ +/*** Global varibles ***/ /************************/ -SDL_Window *sdlWindow; // Pointe sur l'écran video -SDL_Renderer *sdlRenderer; // Pointe sur l'écran video +SDL_Window *sdlWindow; // Screen video pointer +SDL_Renderer *sdlRenderer; // Screen video pointer char Titre[] = "Li-ri V" VERSION; -Sprite *Sprites = nullptr; // Pointe sur les sprites -int NSprites = 0; // Nombre de sprites en mémoire -Screen Ec; // Pointe sur les 2 buffets vidéo -sNewPreference Pref; // Tableau des préférences. -Level level; // Gère les niveaux +Sprite *Sprites = nullptr; // Sprite pointer +int NSprites = 0; // Number of sprites in memory +Screen Ec; +sNewPreference Pref; // Preference table. +Level level; // Manages the levels -int Horloge = 0; // Horloges du jeu +int Horloge = 0; // Game clocks int HorlogeAvant = 0; #if defined(__unix__) || defined(__HAIKU__) -char DefPath[256]; // Chemin par defaut dans arg +char DefPath[256]; // Default path in arg #endif -/*** Initialise les preferences ***/ +/*** Initializate preferences ***/ /**********************************/ void InitPref() { @@ -82,14 +82,14 @@ void InitPref() Utils::LoadPref(); } -/*** Preogramme principale ***/ +/*** Main program ***/ /*****************************/ int main(int narg, char *argv[]) { int i; eMenu RetM, RetMenu = mMenu; - // Initialise les préferences + // Initializate preferences InitPref(); #if defined(__unix__) || defined(__HAIKU__) if (narg > 1) { @@ -98,15 +98,15 @@ int main(int narg, char *argv[]) #endif SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); - // Initiliase SDL + // Initializate SDL if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_GAMECONTROLLER) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to initialize SDL: %s", SDL_GetError()); exit(-1); } - // Ferme le programme correctement quand quit + // Close the program properly when quitting atexit(SDL_Quit); - // Demande la resolution Video + // Set type of window int vOption = SDL_WINDOW_RESIZABLE; if (Pref.FullScreen) { vOption |= SDL_WINDOW_FULLSCREEN_DESKTOP; @@ -117,7 +117,7 @@ int main(int narg, char *argv[]) SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); SDL_RenderSetLogicalSize(sdlRenderer, 800, 600); - SDL_ShowCursor(0); // Masque le curseur + SDL_ShowCursor(0); // Hide cursor Audio audio; audio.Init();