From 081541565895082026b67ccad05fd676cab28eda Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Tue, 26 Jun 2018 19:14:55 +0200 Subject: [PATCH 1/7] Cosmetics --- src/pixmap.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pixmap.cxx b/src/pixmap.cxx index 58a766a..c1c5e46 100644 --- a/src/pixmap.cxx +++ b/src/pixmap.cxx @@ -774,19 +774,20 @@ CPixmap::LoadCursors (Uint8 scale) { Uint32 rmask, gmask, bmask, amask; -/* SDL interprets each pixel as a 32-bit number, so our masks must depend -on the endianness (byte order) of the machine */ + /* SDL interprets each pixel as a 32-bit number, so our masks must depend + * on the endianness (byte order) of the machine + */ #if SDL_BYTEORDER == SDL_BIG_ENDIAN rmask = 0xff000000; gmask = 0x00ff0000; bmask = 0x0000ff00; amask = 0x000000ff; -#else +#else /* SDL_BYTEORDER == SDL_BIG_ENDIAN */ rmask = 0x000000ff; gmask = 0x0000ff00; bmask = 0x00ff0000; amask = 0xff000000; -#endif +#endif /* SDL_BYTEORDER != SDL_BIG_ENDIAN */ for (int i = SPRITE_BEGIN; i <= SPRITE_END; ++i) { From fc4483998dd8bab36afdaefbbf4b264cb9b186dc Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Tue, 26 Jun 2018 22:49:34 +0200 Subject: [PATCH 2/7] Add missing comment for #if --- src/blupi.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blupi.cxx b/src/blupi.cxx index 8c294ad..01714eb 100644 --- a/src/blupi.cxx +++ b/src/blupi.cxx @@ -84,7 +84,7 @@ struct url_data { char * buffer; size_t size; }; -#endif +#endif /* USE_CURL */ template static void From 1300d8fb0575158bc9e6fb29aec007dbc458566a Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Tue, 26 Jun 2018 23:14:29 +0200 Subject: [PATCH 3/7] Disable smooth scroll with demos It prevents lag and bad shift with mouse clicks. --- src/event.cxx | 11 ++++++++--- src/event.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/event.cxx b/src/event.cxx index 945f5bc..51979fd 100644 --- a/src/event.cxx +++ b/src/event.cxx @@ -5005,6 +5005,10 @@ CEvent::DemoPlayStart (const std::string * demoFile) DemoPlayStop (); return false; } + + this->m_scrollSpeedPrev = m_scrollSpeed; + this->m_scrollSpeed = 3; + ChangePhase (EV_PHASE_PLAY); InitRandom (); m_pDecor->SetTime (0); @@ -5026,9 +5030,10 @@ CEvent::DemoPlayStop () m_pDemoSDLBuffer.clear (); - m_bDemoPlay = false; - m_bDemoRec = false; - m_demoTime = 0; + m_bDemoPlay = false; + m_bDemoRec = false; + m_demoTime = 0; + this->m_scrollSpeed = this->m_scrollSpeedPrev; ChangePhase (EV_PHASE_INIT); } diff --git a/src/event.h b/src/event.h index e177afb..9652425 100644 --- a/src/event.h +++ b/src/event.h @@ -241,6 +241,7 @@ protected: bool m_bHelp; bool m_bAllMissions; Sint32 m_scrollSpeed; + Sint32 m_scrollSpeedPrev; bool m_bPause; bool m_bShift; Sint32 m_shiftPhase; From d1cb5919c556fa4b90002b502f0d9799c159bcd5 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Tue, 26 Jun 2018 23:16:03 +0200 Subject: [PATCH 4/7] Make like previous commit but with the recording --- src/event.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/event.cxx b/src/event.cxx index 51979fd..1740f57 100644 --- a/src/event.cxx +++ b/src/event.cxx @@ -4883,7 +4883,9 @@ CEvent::DemoRecStart () InitRandom (); m_pDecor->SetTime (0); - m_speed = 1; + m_speed = 1; + this->m_scrollSpeedPrev = this->m_scrollSpeed; + this->m_scrollSpeed = 3; m_bStartRecording = true; } @@ -4924,9 +4926,10 @@ CEvent::DemoRecStop () } m_pDemoSDLBuffer.clear (); - m_bDemoRec = false; - m_demoTime = 0; - m_bStartRecording = false; + m_bDemoRec = false; + m_demoTime = 0; + m_bStartRecording = false; + this->m_scrollSpeed = this->m_scrollSpeedPrev; } // Début de la reproduction d'une démo. From 18135950bfc2955cddfee44d8f799ea4a2e9dea2 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Wed, 27 Jun 2018 17:32:41 +0200 Subject: [PATCH 5/7] Cosmetic: fix format --- src/decblupi.cxx | 20 +++++++++++++++----- src/pixmap.cxx | 2 +- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/decblupi.cxx b/src/decblupi.cxx index e236eba..0e6a52c 100644 --- a/src/decblupi.cxx +++ b/src/decblupi.cxx @@ -2184,7 +2184,9 @@ CDecor::GoalStop (Sint32 rank, bool bError, bool bSound) }; static Sounds table_sound_boing[] = { - SOUND_BOING1, SOUND_BOING2, SOUND_BOING3, + SOUND_BOING1, + SOUND_BOING2, + SOUND_BOING3, }; if (bError && bSound) @@ -3463,12 +3465,16 @@ CDecor::BlupiHiliUp (Point pos) static Sounds table_sound_okf[] = // si fatigué { - SOUND_OK1f, SOUND_OK2f, SOUND_OK3f, + SOUND_OK1f, + SOUND_OK2f, + SOUND_OK3f, }; static Sounds table_sound_oke[] = // si énervé { - SOUND_OK1e, SOUND_OK2e, SOUND_OK3e, + SOUND_OK1e, + SOUND_OK2e, + SOUND_OK3e, }; if (m_bHiliRect) // rectangle de sélection existe ? @@ -4102,11 +4108,15 @@ CDecor::BlupiGoal (Point cel, Buttons button) }; static Sounds table_sound_gom[] = { - SOUND_GO4, SOUND_GO5, SOUND_GO6, + SOUND_GO4, + SOUND_GO5, + SOUND_GO6, }; static Sounds table_sound_boing[] = { - SOUND_BOING1, SOUND_BOING2, SOUND_BOING3, + SOUND_BOING1, + SOUND_BOING2, + SOUND_BOING3, }; if (button == -1) diff --git a/src/pixmap.cxx b/src/pixmap.cxx index c1c5e46..f3a84e6 100644 --- a/src/pixmap.cxx +++ b/src/pixmap.cxx @@ -782,7 +782,7 @@ CPixmap::LoadCursors (Uint8 scale) gmask = 0x00ff0000; bmask = 0x0000ff00; amask = 0x000000ff; -#else /* SDL_BYTEORDER == SDL_BIG_ENDIAN */ +#else /* SDL_BYTEORDER == SDL_BIG_ENDIAN */ rmask = 0x000000ff; gmask = 0x0000ff00; bmask = 0x00ff0000; From e09a4e2fabf5f6b6c3162e0835d9bebeee5ed77a Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Fri, 29 Jun 2018 09:14:01 +0200 Subject: [PATCH 6/7] Add right-click shortcut on flowers Closes issue #63. --- src/decblupi.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/decblupi.cxx b/src/decblupi.cxx index 0e6a52c..81a5ad1 100644 --- a/src/decblupi.cxx +++ b/src/decblupi.cxx @@ -3763,6 +3763,8 @@ CDecor::GetDefButton (Point cel) if (icon == 61) button = BUTTON_CULTIVE; // cabane + if (icon == 81 || icon == 83 || icon == 94) + button = BUTTON_FLOWER; if (icon == 122) button = BUTTON_EXTRAIT; // extrait From 2d266496f30914c11971d0c5834b9d67b0cc3263 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Sat, 30 Jun 2018 15:37:45 +0200 Subject: [PATCH 7/7] Fix gettext warning --- resources/po/fr.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/po/fr.po b/resources/po/fr.po index 77eddb1..76b0e67 100644 --- a/resources/po/fr.po +++ b/resources/po/fr.po @@ -913,7 +913,7 @@ msgid "Yes, great ..." msgstr "Oui, super ..." msgid "You have failed, try again..." -msgstr "C'est raté, essaie encore une fois" +msgstr "C'est raté, essaie encore une fois..." msgid "You have played Planet Blupi." msgstr "Vous avez joué à Planète Blupi."