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

Add a global settings entry for switching between ogg and midi music

This commit is contained in:
Mathieu Schroeter 2017-12-12 23:48:21 +01:00
parent c6fbe158da
commit da3d683bf7
9 changed files with 159 additions and 20 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-07 17:31+0100\n"
"POT-Creation-Date: 2017-12-12 23:45+0100\n"
"PO-Revision-Date: 2017-12-07 17:36+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -282,6 +282,11 @@ msgstr "Stein bearbeiten"
msgid "Carve rocks"
msgstr "Steine bearbeiten"
msgid ""
"Change the\n"
"music format"
msgstr ""
msgid ""
"Change the\n"
"window size"
@ -526,6 +531,9 @@ msgstr "Roboterchef"
msgid "Medical potion"
msgstr "Medikament"
msgid "Midi"
msgstr ""
msgid "Mine"
msgstr "Bergwerk"
@ -630,6 +638,9 @@ msgstr "Du kannst jetzt mit den Missionen beginnen."
msgid "Occupied ground"
msgstr "Untergrund schon besetzt"
msgid "Ogg"
msgstr ""
msgid "Open another game"
msgstr "Gespeicherte Mission öffnen"
@ -845,6 +856,12 @@ msgstr "Bäume"
msgid "Tree trunks"
msgstr "Baumstämme"
msgid "Use Midi music (original)"
msgstr ""
msgid "Use Ogg music"
msgstr ""
msgid "Version"
msgstr "Version"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-07 17:31+0100\n"
"POT-Creation-Date: 2017-12-12 23:45+0100\n"
"PO-Revision-Date: 2017-02-27 21:28+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -238,6 +238,11 @@ msgstr ""
msgid "Carve rocks"
msgstr ""
msgid ""
"Change the\n"
"music format"
msgstr ""
msgid ""
"Change the\n"
"window size"
@ -471,6 +476,9 @@ msgstr ""
msgid "Medical potion"
msgstr ""
msgid "Midi"
msgstr ""
msgid "Mine"
msgstr ""
@ -573,6 +581,9 @@ msgstr ""
msgid "Occupied ground"
msgstr ""
msgid "Ogg"
msgstr ""
msgid "Open another game"
msgstr ""
@ -775,6 +786,12 @@ msgstr ""
msgid "Tree trunks"
msgstr ""
msgid "Use Midi music (original)"
msgstr ""
msgid "Use Ogg music"
msgstr ""
msgid "Version"
msgstr ""

View File

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-07 17:31+0100\n"
"POT-Creation-Date: 2017-12-12 23:45+0100\n"
"PO-Revision-Date: 2017-12-07 17:37+0100\n"
"Last-Translator: Mathieu Schroeter <mathieu@schroetersa.ch>\n"
"Language-Team: French <kde-i18n-doc@kde.org>\n"
@ -280,6 +280,11 @@ msgstr "Taille un rocher"
msgid "Carve rocks"
msgstr "Taille des rochers"
msgid ""
"Change the\n"
"music format"
msgstr ""
msgid ""
"Change the\n"
"window size"
@ -521,6 +526,9 @@ msgstr "Robot-maître"
msgid "Medical potion"
msgstr "Potion"
msgid "Midi"
msgstr ""
msgid "Mine"
msgstr "Mine de fer"
@ -625,6 +633,9 @@ msgstr "Passe maintenant aux missions."
msgid "Occupied ground"
msgstr "Terrain occupé"
msgid "Ogg"
msgstr ""
msgid "Open another game"
msgstr "Ouvrir une autre partie"
@ -835,6 +846,12 @@ msgstr "Arbres"
msgid "Tree trunks"
msgstr "Troncs"
msgid "Use Midi music (original)"
msgstr ""
msgid "Use Ogg music"
msgstr ""
msgid "Version"
msgstr "Version"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-07 17:31+0100\n"
"POT-Creation-Date: 2017-12-12 23:45+0100\n"
"PO-Revision-Date: 2017-12-07 17:38+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -280,6 +280,11 @@ msgstr "Spacca una roccia"
msgid "Carve rocks"
msgstr "Spacca delle roccie"
msgid ""
"Change the\n"
"music format"
msgstr ""
msgid ""
"Change the\n"
"window size"
@ -524,6 +529,9 @@ msgstr "Robot-capo"
msgid "Medical potion"
msgstr "Pozione"
msgid "Midi"
msgstr ""
msgid "Mine"
msgstr "Miniera"
@ -628,6 +636,9 @@ msgstr "Ora passa alle missioni."
msgid "Occupied ground"
msgstr "Terreno occupato"
msgid "Ogg"
msgstr ""
msgid "Open another game"
msgstr "Apri un'altra partita"
@ -838,6 +849,12 @@ msgstr "Alberi"
msgid "Tree trunks"
msgstr "Tronchi"
msgid "Use Midi music (original)"
msgstr ""
msgid "Use Ogg music"
msgstr ""
msgid "Version"
msgstr "Versione"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-07 17:31+0100\n"
"POT-Creation-Date: 2017-12-12 23:45+0100\n"
"PO-Revision-Date: 2017-12-07 17:39+0100\n"
"Last-Translator: tomangelo <tomangelo@wp.pl>\n"
"Language-Team: TerranovaTeam <contact@colobot.info>\n"
@ -281,6 +281,11 @@ msgstr "Wyłup skałę"
msgid "Carve rocks"
msgstr "Wyłup skały"
msgid ""
"Change the\n"
"music format"
msgstr ""
msgid ""
"Change the\n"
"window size"
@ -522,6 +527,9 @@ msgstr "Mistrz robotów"
msgid "Medical potion"
msgstr "Lekarstwo"
msgid "Midi"
msgstr ""
msgid "Mine"
msgstr "Kopalnia"
@ -626,6 +634,9 @@ msgstr "Teraz spróbuj swoich sił w misjach"
msgid "Occupied ground"
msgstr "Teren zajęty"
msgid "Ogg"
msgstr ""
msgid "Open another game"
msgstr "Otwórz poprzednią grę"
@ -836,6 +847,12 @@ msgstr "Drzewo"
msgid "Tree trunks"
msgstr "Pnie drzew"
msgid "Use Midi music (original)"
msgstr ""
msgid "Use Ogg music"
msgstr ""
msgid "Version"
msgstr "Wersja"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-07 17:31+0100\n"
"POT-Creation-Date: 2017-12-12 23:45+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -551,6 +551,12 @@ msgstr ""
msgid "Increase window size"
msgstr ""
msgid "Use Ogg music"
msgstr ""
msgid "Use Midi music (original)"
msgstr ""
msgid "Version"
msgstr ""
@ -705,6 +711,17 @@ msgid ""
"window size"
msgstr ""
msgid ""
"Change the\n"
"music format"
msgstr ""
msgid "Midi"
msgstr ""
msgid "Ogg"
msgstr ""
msgid "You have played Planet Blupi."
msgstr ""

View File

@ -71,18 +71,7 @@ bool g_enableRecorder = false;
std::string g_playRecord;
bool g_restoreBugs = false; // restore original < v1.9 bugs
bool g_restoreMidi = false; // restore music playback based on midi files
enum Settings {
SETTING_FULLSCREEN = 1 << 0,
SETTING_SPEEDRATE = 1 << 1,
SETTING_TIMERINTERVAL = 1 << 2,
SETTING_RENDERER = 1 << 3,
SETTING_ZOOM = 1 << 4,
SETTING_DRIVER = 1 << 5,
SETTING_MIDI = 1 << 6,
};
static int g_settingsOverload = 0;
int g_settingsOverload = 0;
bool g_bTermInit = false; // initialisation en cours
Uint32 g_lastPhase = 999;

View File

@ -34,6 +34,18 @@ extern bool g_restoreMidi;
extern bool g_enableRecorder;
extern std::string g_playRecord;
enum Settings {
SETTING_FULLSCREEN = 1 << 0,
SETTING_SPEEDRATE = 1 << 1,
SETTING_TIMERINTERVAL = 1 << 2,
SETTING_RENDERER = 1 << 3,
SETTING_ZOOM = 1 << 4,
SETTING_DRIVER = 1 << 5,
SETTING_MIDI = 1 << 6,
};
extern int g_settingsOverload;
struct Point {
Sint32 x;
Sint32 y;

View File

@ -70,8 +70,10 @@ typedef struct {
Sint16 skill;
// v1.1
Sint16 language;
// v1.2
Sint16 musicMidi;
Sint16 reserve2[92];
Sint16 reserve2[91];
} DescInfo;
// Toutes les premières lettres doivent
@ -1499,6 +1501,18 @@ static Phase table[] =
284 + 40, 330,
{ translate ("Increase window size") },
},
{
EV_BUTTON7,
0, {1, 50},
399, 330,
{ translate ("Use Ogg music") },
},
{
EV_BUTTON8,
0, {1, 51},
399 + 40, 330,
{ translate ("Use Midi music (original)") },
},
{
EV_PHASE_INIT,
0, {1, 40},
@ -2083,6 +2097,9 @@ CEvent::DrawButtons ()
SetEnable (EV_BUTTON5, !m_bFullScreen && m_WindowScale > 1);
SetEnable (EV_BUTTON6, !m_bFullScreen && m_WindowScale < 2);
SetEnable (EV_BUTTON7, g_restoreMidi);
SetEnable (EV_BUTTON8, !g_restoreMidi);
}
assert (m_index >= 0);
@ -2534,6 +2551,7 @@ CEvent::DrawButtons ()
DrawTextCenter (gettext ("Interface language\nand sounds"), 54 + 40, 80);
DrawTextCenter (gettext ("Select the\nwindow mode"), 169 + 40, 80);
DrawTextCenter (gettext ("Change the\nwindow size"), 284 + 40, 80);
DrawTextCenter (gettext ("Change the\nmusic format"), 399 + 40, 80);
const auto locale = GetLocale ();
std::string lang;
@ -2570,6 +2588,12 @@ CEvent::DrawButtons ()
pos.y = 330 - 20;
DrawText (m_pPixmap, pos, res);
}
text = g_restoreMidi ? gettext ("Midi") : gettext ("Ogg");
lg = GetTextWidth (text);
pos.x = (399 + 40) - lg / 2;
pos.y = 330 - 20;
DrawText (m_pPixmap, pos, text);
}
// Show the ending text
@ -4116,6 +4140,12 @@ CEvent::ChangeButtons (Sint32 message)
SetWindowSize (scale, m_WindowScale);
break;
}
case EV_BUTTON7:
g_restoreMidi = false;
break;
case EV_BUTTON8:
g_restoreMidi = true;
break;
}
}
}
@ -4671,7 +4701,7 @@ CEvent::WriteInfo ()
goto error;
info.majRev = 1;
info.minRev = 1;
info.minRev = 2;
info.prive = m_private;
info.exercice = m_exercice;
info.mission = m_mission;
@ -4690,6 +4720,7 @@ CEvent::WriteInfo ()
info.language = static_cast<Sint16> (
this->GetLanguage () != this->GetStartLanguage () ? this->GetLanguage ()
: Language::undef);
info.musicMidi = g_restoreMidi;
nb = fwrite (&info, sizeof (info), 1, file);
if (nb < 1)
@ -4748,6 +4779,11 @@ CEvent::ReadInfo ()
this->SetLanguage (static_cast<Language> (info.language));
}
if (
((info.majRev == 1 && info.minRev >= 2) || info.majRev >= 2) &&
!(g_settingsOverload & SETTING_MIDI))
g_restoreMidi = !!info.musicMidi;
fclose (file);
return true;