1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Cosmetic: translate some comments to english

This commit is contained in:
Mathieu Schroeter 2017-10-25 07:06:14 +02:00
parent a26b71a2d8
commit 4db92b4da6

View File

@ -2464,7 +2464,7 @@ CEvent::DrawButtons ()
DrawText (m_pPixmap, pos, list[GetWorld () % 5]); DrawText (m_pPixmap, pos, list[GetWorld () % 5]);
} }
// Affiche le texte lorsque c'est fini. // Show the ending text when the game is finished.
if (m_phase == EV_PHASE_LASTWIN) if (m_phase == EV_PHASE_LASTWIN)
{ {
char * text; char * text;
@ -2481,7 +2481,7 @@ CEvent::DrawButtons ()
DrawText (m_pPixmap, pos, text); DrawText (m_pPixmap, pos, text);
} }
// Dessine les réglages. // Draw the game settings.
if (m_phase == EV_PHASE_SETUP || m_phase == EV_PHASE_SETUPp) if (m_phase == EV_PHASE_SETUP || m_phase == EV_PHASE_SETUPp)
{ {
DrawTextCenter (gettext ("Global game\nspeed"), 54 + 40, 80); DrawTextCenter (gettext ("Global game\nspeed"), 54 + 40, 80);
@ -2625,7 +2625,7 @@ CEvent::DrawButtons ()
DrawText (m_pPixmap, pos, text); DrawText (m_pPixmap, pos, text);
} }
// Affiche le texte lorsqu'il faut insérer le CD-Rom. // Show the text when the CD-Rom must be inserted (deprecated).
if (m_phase == EV_PHASE_INSERT) if (m_phase == EV_PHASE_INSERT)
DrawTextCenter ( DrawTextCenter (
gettext ("Insert CD-Rom Planet Blupi and wait a few seconds..."), gettext ("Insert CD-Rom Planet Blupi and wait a few seconds..."),
@ -2634,15 +2634,19 @@ CEvent::DrawButtons ()
if (m_phase == EV_PHASE_BUILD) if (m_phase == EV_PHASE_BUILD)
SetEnable (EV_PHASE_UNDO, m_pDecor->IsUndo ()); SetEnable (EV_PHASE_UNDO, m_pDecor->IsUndo ());
// Dessine les tool tips (info bulle). // Draw the tooltips.
if (m_textToolTips[0] != 0) if (m_textToolTips[0] != 0)
DrawText (m_pPixmap, m_posToolTips, m_textToolTips); DrawText (m_pPixmap, m_posToolTips, m_textToolTips);
return true; return true;
} }
// Retourne le lutin à utiliser à une position donnée. /**
* \brief Return the mouse sprite to use for a position.
*
* \param[in] pos - The position.
* \return the sprite.
*/
MouseSprites MouseSprites
CEvent::MousePosToSprite (Point pos) CEvent::MousePosToSprite (Point pos)
{ {
@ -2713,8 +2717,11 @@ CEvent::MousePosToSprite (Point pos)
return sprite; return sprite;
} }
// Gère le lutin de la souris. /**
* \brief Main mouse sprite handling.
*
* \param[in] pos - The position.
*/
void void
CEvent::MouseSprite (Point pos) CEvent::MouseSprite (Point pos)
{ {
@ -2722,8 +2729,11 @@ CEvent::MouseSprite (Point pos)
m_pPixmap->ChangeSprite (m_mouseSprite); m_pPixmap->ChangeSprite (m_mouseSprite);
} }
// Met ou enlève le sablier de la souris. /**
* \brief Set or remove the waiting mouse sprite.
*
* \param[in] bWait - If waiting.
*/
void void
CEvent::WaitMouse (bool bWait) CEvent::WaitMouse (bool bWait)
{ {
@ -2737,8 +2747,11 @@ CEvent::WaitMouse (bool bWait)
m_pPixmap->ChangeSprite (m_mouseSprite); m_pPixmap->ChangeSprite (m_mouseSprite);
} }
// Cache ou montre la souris. /**
* \brief Hide or show the mouse.
*
* \param[in] bHide - If hide.
*/
void void
CEvent::HideMouse (bool bHide) CEvent::HideMouse (bool bHide)
{ {
@ -2759,8 +2772,13 @@ CEvent::HideMouse (bool bHide)
m_pPixmap->ChangeSprite (m_mouseSprite); m_pPixmap->ChangeSprite (m_mouseSprite);
} }
// Traite les événements pour tous les boutons. /**
* \brief Handle events for buttons.
*
* \param[in] event - The SDL event.
* \param[in] pos - The position.
* \return true if the event is handled.
*/
bool bool
CEvent::EventButtons (const SDL_Event & event, Point pos) CEvent::EventButtons (const SDL_Event & event, Point pos)
{ {
@ -2850,7 +2868,7 @@ CEvent::EventButtons (const SDL_Event & event, Point pos)
(event.button.button == SDL_BUTTON_LEFT || (event.button.button == SDL_BUTTON_LEFT ||
event.button.button == SDL_BUTTON_RIGHT)) event.button.button == SDL_BUTTON_RIGHT))
{ {
// Montre ou cache les infos tout en haut. // Show or hide the informations at the top.
m_pDecor->SetInfoMode (!m_pDecor->GetInfoMode ()); m_pDecor->SetInfoMode (!m_pDecor->GetInfoMode ());
} }
} }
@ -2873,7 +2891,7 @@ CEvent::EventButtons (const SDL_Event & event, Point pos)
(event.button.button == SDL_BUTTON_LEFT || (event.button.button == SDL_BUTTON_LEFT ||
event.button.button == SDL_BUTTON_RIGHT)) event.button.button == SDL_BUTTON_RIGHT))
{ {
// Inverse le mode aide dans les infos. // Reverse the help mode in the informations.
m_bInfoHelp = !m_bInfoHelp; m_bInfoHelp = !m_bInfoHelp;
if (m_bInfoHelp) if (m_bInfoHelp)
@ -2891,7 +2909,7 @@ CEvent::EventButtons (const SDL_Event & event, Point pos)
(event.button.button == SDL_BUTTON_LEFT || (event.button.button == SDL_BUTTON_LEFT ||
event.button.button == SDL_BUTTON_RIGHT)) event.button.button == SDL_BUTTON_RIGHT))
{ {
m_pDecor->HideTooltips (true); // plus de tooltips pour décor m_pDecor->HideTooltips (true); // Remove tooltips for the decor.
} }
if ( if (
event.type == SDL_MOUSEBUTTONUP && event.type == SDL_MOUSEBUTTONUP &&
@ -2920,8 +2938,12 @@ CEvent::EventButtons (const SDL_Event & event, Point pos)
return false; return false;
} }
// Indique si la souris est sur un bouton. /**
* \brief Notify if the mouse is on a button.
*
* \param[in] pos - The mouse position.
* \return true if the mouse is on a button.
*/
bool bool
CEvent::MouseOnButton (Point pos) CEvent::MouseOnButton (Point pos)
{ {
@ -2941,8 +2963,12 @@ CEvent::MouseOnButton (Point pos)
return false; return false;
} }
// Retourne l'index dans table pour une phase donnée. /**
* \brief Return the table index for a specific phase.
*
* \param[in] phase - The phase.
* \return the index in `table`.
*/
Sint32 Sint32
CEvent::SearchPhase (Uint32 phase) CEvent::SearchPhase (Uint32 phase)
{ {
@ -2958,8 +2984,11 @@ CEvent::SearchPhase (Uint32 phase)
return -1; return -1;
} }
// Donne le numéro du monde. /**
* \brief Return the world number.
*
* \return the number.
*/
Sint32 Sint32
CEvent::GetWorld () CEvent::GetWorld ()
{ {
@ -2971,8 +3000,13 @@ CEvent::GetWorld ()
return m_mission; return m_mission;
} }
// Donne le numéro physique du monde. /**
* \brief Return the physical world number.
*
* This number should be the same as the filename.
*
* \return the number.
*/
Sint32 Sint32
CEvent::GetPhysicalWorld () CEvent::GetPhysicalWorld ()
{ {
@ -2995,8 +3029,11 @@ CEvent::GetImageWorld ()
return 1; return 1;
} }
// Indique si l'aide est disponible. /**
* Notify if the help is available.
*
* \return true if available.
*/
bool bool
CEvent::IsHelpHide () CEvent::IsHelpHide ()
{ {
@ -3006,14 +3043,18 @@ CEvent::IsHelpHide ()
bHide = false; bHide = false;
if (m_bSchool || m_bPrivate) if (m_bSchool || m_bPrivate)
{ {
bHide = true; // pas d'aide pour les exercices bHide = true; // No help for the exercises.
} }
return bHide; return bHide;
} }
// Change de phase. /**
* \brief Change the phase.
*
* \param[in] phase - The new phase.
* \return true if the phase has changed.
*/
bool bool
CEvent::ChangePhase (Uint32 phase) CEvent::ChangePhase (Uint32 phase)
{ {
@ -3082,11 +3123,11 @@ CEvent::ChangePhase (Uint32 phase)
m_pSound->StopAllSounds (false, &except); m_pSound->StopAllSounds (false, &except);
} }
m_phase = phase; // change de phase m_phase = phase; // change phase
m_index = index; m_index = index;
filename = table[m_index].backName; filename = table[m_index].backName;
if (filename.find ("%.3d") != std::string::npos) // "%.3d" dans le nom ? if (filename.find ("%.3d") != std::string::npos)
filename = string_format (table[m_index].backName, GetImageWorld ()); filename = string_format (table[m_index].backName, GetImageWorld ());
totalDim.x = LXIMAGE; totalDim.x = LXIMAGE;
totalDim.y = LYIMAGE; totalDim.y = LYIMAGE;
@ -3094,10 +3135,10 @@ CEvent::ChangePhase (Uint32 phase)
iconDim.y = 0; iconDim.y = 0;
if (!m_pPixmap->Cache (CHBACK, filename, totalDim, iconDim)) if (!m_pPixmap->Cache (CHBACK, filename, totalDim, iconDim))
{ {
WaitMouse (false); // enlève le sablier WaitMouse (false);
m_tryInsertCount = 40; m_tryInsertCount = 40;
m_tryPhase = m_phase; m_tryPhase = m_phase;
return ChangePhase (EV_PHASE_INSERT); // insérez le CD-Rom ... return ChangePhase (EV_PHASE_INSERT); // insert the CD-Rom ...
} }
if ( if (
@ -3122,13 +3163,13 @@ CEvent::ChangePhase (Uint32 phase)
{ {
if ( if (
!m_pDecor->Read ( !m_pDecor->Read (
GetPhysicalWorld (), false, world, time, total) && // lit le monde GetPhysicalWorld (), false, world, time, total) && // read the world
!m_bAccessBuild && !m_bAccessBuild &&
!m_bPrivate) !m_bPrivate)
{ {
m_tryInsertCount = 40; m_tryInsertCount = 40;
m_tryPhase = m_phase; m_tryPhase = m_phase;
return ChangePhase (EV_PHASE_INSERT); // insérez le CD-Rom ... return ChangePhase (EV_PHASE_INSERT); // insert the CD-Rom ...
} }
m_pDecor->SetTime (0); m_pDecor->SetTime (0);
m_pDecor->SetTotalTime (0); m_pDecor->SetTotalTime (0);
@ -3164,7 +3205,7 @@ CEvent::ChangePhase (Uint32 phase)
if (m_phase == EV_PHASE_TESTCD) if (m_phase == EV_PHASE_TESTCD)
{ {
if (m_pDecor->Read (0, false, world, time, total)) // lit un monde if (m_pDecor->Read (0, false, world, time, total)) // read the world
{ {
return ChangePhase (EV_PHASE_INIT); // ok return ChangePhase (EV_PHASE_INIT); // ok
} }
@ -3172,25 +3213,25 @@ CEvent::ChangePhase (Uint32 phase)
{ {
m_tryInsertCount = 40; m_tryInsertCount = 40;
m_tryPhase = m_phase; m_tryPhase = m_phase;
return ChangePhase (EV_PHASE_INSERT); // insérez le CD-Rom ... return ChangePhase (EV_PHASE_INSERT); // insert the CD-Rom ...
} }
} }
m_jauges[0].SetHide (true); // cache les jauges m_jauges[0].SetHide (true);
m_jauges[1].SetHide (true); m_jauges[1].SetHide (true);
CreateButtons (); // crée les boutons selon la phase CreateButtons (); // create the buttons accordingly to the phase
m_bMenu = false; m_bMenu = false;
m_pDecor->HideTooltips (false); m_pDecor->HideTooltips (false);
m_menu.Delete (); m_menu.Delete ();
m_pDecor->BlupiSetArrow (0, false); // enlève toutes les flèches m_pDecor->BlupiSetArrow (0, false); // remove all arrows
m_pDecor->ResetHili (); // enlève les mises en évidence m_pDecor->ResetHili (); // remove all highlights
if (m_phase == EV_PHASE_PLAY) if (m_phase == EV_PHASE_PLAY)
{ {
m_pDecor->LoadImages (); m_pDecor->LoadImages ();
m_pDecor->SetBuild (false); m_pDecor->SetBuild (false);
m_pDecor->EnableFog (true); m_pDecor->EnableFog (true);
m_pDecor->NextPhase (0); // refait la carte tout de suite m_pDecor->NextPhase (0); // rebuild the map immediatly
m_pDecor->StatisticInit (); m_pDecor->StatisticInit ();
m_pDecor->TerminatedInit (); m_pDecor->TerminatedInit ();
} }
@ -3199,16 +3240,16 @@ CEvent::ChangePhase (Uint32 phase)
{ {
m_bBuildModify = true; m_bBuildModify = true;
SetState (EV_DECOR1, 1); SetState (EV_DECOR1, 1);
SetMenu (EV_DECOR1, 0); // herbe SetMenu (EV_DECOR1, 0); // grass
SetMenu (EV_DECOR2, 2); // arbre SetMenu (EV_DECOR2, 2); // tree
SetMenu (EV_DECOR3, 1); // maison SetMenu (EV_DECOR3, 1); // house
SetMenu (EV_DECOR4, 2); // blupi fort SetMenu (EV_DECOR4, 2); // strong blupi
SetMenu (EV_DECOR5, 1); // feu SetMenu (EV_DECOR5, 1); // fire
m_pDecor->LoadImages (); m_pDecor->LoadImages ();
m_pDecor->SetBuild (true); m_pDecor->SetBuild (true);
m_pDecor->EnableFog (false); m_pDecor->EnableFog (false);
m_pDecor->BlupiDeselect (); m_pDecor->BlupiDeselect ();
m_pDecor->NextPhase (0); // refait la carte tout de suite m_pDecor->NextPhase (0); // rebuild the map immediatly
} }
if (m_phase == EV_PHASE_INFO) if (m_phase == EV_PHASE_INFO)
@ -3310,7 +3351,7 @@ CEvent::ChangePhase (Uint32 phase)
{ {
if (m_pSound->IsPlayingMusic ()) if (m_pSound->IsPlayingMusic ())
{ {
m_pSound->AdaptVolumeMusic (); // adapte le volume m_pSound->AdaptVolumeMusic ();
} }
else else
{ {
@ -3360,20 +3401,24 @@ CEvent::ChangePhase (Uint32 phase)
m_phaseAfterMovie = EV_PHASE_LASTWIN; m_phaseAfterMovie = EV_PHASE_LASTWIN;
} }
WaitMouse (false); // enlève le sablier WaitMouse (false);
return true; return true;
} }
// Retourne la phase en cours. /**
* \brief Return the current phase.
*
* \return the phase number.
*/
Uint32 Uint32
CEvent::GetPhase () CEvent::GetPhase ()
{ {
return m_phase; return m_phase;
} }
// Essaye de lire le CD-Rom. /**
* \brief Try to read the CD-Rom.
*/
void void
CEvent::TryInsert () CEvent::TryInsert ()
{ {
@ -3383,19 +3428,22 @@ CEvent::TryInsert ()
m_tryInsertCount--; m_tryInsertCount--;
} }
// Fait démarrer un film si nécessaire. /**
* \brief Start a movie if necessary.
*
* \return true if the movie has started.
*/
bool bool
CEvent::MovieToStart () CEvent::MovieToStart ()
{ {
bool movie = false; bool movie = false;
if (m_movieToStart[0] != 0) // y a-t-il un film à démarrer ? if (m_movieToStart[0] != 0) // is movie available?
{ {
if (StartMovie (m_movieToStart)) if (StartMovie (m_movieToStart))
{ {
movie = true; movie = true;
m_phase = m_phaseAfterMovie; // prochaine phase normale m_phase = m_phaseAfterMovie; // the next normal phase
} }
else else
ChangePhase (m_phaseAfterMovie); ChangePhase (m_phaseAfterMovie);
@ -3406,8 +3454,12 @@ CEvent::MovieToStart ()
return movie; return movie;
} }
// Décale le décor. /**
* \brief Shift the decor.
*
* \param[in] dx - Delta x.
* \param[in] dy - Delta y.
*/
void void
CEvent::DecorShift (Sint32 dx, Sint32 dy) CEvent::DecorShift (Sint32 dx, Sint32 dy)
{ {
@ -3422,11 +3474,11 @@ CEvent::DecorShift (Sint32 dx, Sint32 dy)
coin.y += dy; coin.y += dy;
m_pDecor->SetCoin (coin); m_pDecor->SetCoin (coin);
//? m_pDecor->NextPhase(0); // faudra refaire la carte tout de suite
} }
// Décale le décor lorsque la souris touche un bord. /**
* \brief Shift the decor when the mouse is on the sides.
*/
void void
CEvent::DecorAutoShift () CEvent::DecorAutoShift ()
{ {
@ -3442,7 +3494,7 @@ CEvent::DecorAutoShift ()
if (m_phase == EV_PHASE_PLAY || m_phase == EV_PHASE_BUILD) if (m_phase == EV_PHASE_PLAY || m_phase == EV_PHASE_BUILD)
{ {
if (m_shiftPhase == 0) // début du shift ? if (m_shiftPhase == 0) // start shift ?
{ {
switch (m_mouseSprite) switch (m_mouseSprite)
{ {
@ -3523,7 +3575,7 @@ CEvent::DecorAutoShift ()
offset.y = m_shiftOffset.y * (max - m_shiftPhase) * (DIMCELY / 2 / max); offset.y = m_shiftOffset.y * (max - m_shiftPhase) * (DIMCELY / 2 / max);
m_pDecor->SetShiftOffset (offset); m_pDecor->SetShiftOffset (offset);
if (m_shiftPhase == 0) // dernière phase ? if (m_shiftPhase == 0) // last phase ?
{ {
offset.x = 0; offset.x = 0;
offset.y = 0; offset.y = 0;
@ -3534,8 +3586,11 @@ CEvent::DecorAutoShift ()
} }
} }
// Indique su un shift est en cours. /**
* \brief Notify if a shift is doing.
*
* \return true of the shift is doing.
*/
bool bool
CEvent::IsShift () CEvent::IsShift ()
{ {