mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Revert "Return the music format finally retrieved by GetMusicLocation"
This reverts commit 7097c6708dc4e00d2aa86e95cea279cdfe20a432.
This commit is contained in:
parent
6975b664b9
commit
c6d109f87d
@ -3079,26 +3079,20 @@ CEvent::IsBaseMusicAvailable (Sint32 music, const std::string & format)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
CEvent::GetMusicLocation (Sint32 music, std::string & format)
|
CEvent::GetMusicLocation (Sint32 music)
|
||||||
{
|
{
|
||||||
static const std::string exts[] = {"ogg", "mid"};
|
static const std::string exts[] = {"ogg", "mid"};
|
||||||
static const Location locs[] = {LOCATION_USER, LOCATION_BASE};
|
static const Location locs[] = {LOCATION_USER, LOCATION_BASE};
|
||||||
std::string absolute;
|
std::string absolute;
|
||||||
|
|
||||||
format = "";
|
|
||||||
|
|
||||||
// Look for music in the user directory, then in the game directory.
|
// Look for music in the user directory, then in the game directory.
|
||||||
for (size_t i = 0; i < countof (locs); ++i)
|
for (size_t i = 0; i < countof (locs); ++i)
|
||||||
{
|
{
|
||||||
format = exts[g_restoreMidi ? 1 : 0];
|
auto filename = string_format (
|
||||||
auto filename =
|
"music/music%.3d.%s", music - 1, exts[g_restoreMidi ? 1 : 0].c_str ());
|
||||||
string_format ("music/music%.3d.%s", music - 1, format.c_str ());
|
|
||||||
if (!FileExists (filename, absolute, locs[i]))
|
if (!FileExists (filename, absolute, locs[i]))
|
||||||
{
|
filename = string_format (
|
||||||
format = exts[g_restoreMidi ? 0 : 1];
|
"music/music%.3d.%s", music - 1, exts[g_restoreMidi ? 0 : 1].c_str ());
|
||||||
filename =
|
|
||||||
string_format ("music/music%.3d.%s", music - 1, format.c_str ());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (FileExists (filename, absolute, locs[i]))
|
if (FileExists (filename, absolute, locs[i]))
|
||||||
break;
|
break;
|
||||||
@ -3418,8 +3412,7 @@ CEvent::ChangePhase (Uint32 phase)
|
|||||||
music = m_pDecor->GetMusic ();
|
music = m_pDecor->GetMusic ();
|
||||||
if (music > 0)
|
if (music > 0)
|
||||||
{
|
{
|
||||||
std::string format;
|
auto absolute = this->GetMusicLocation (music);
|
||||||
auto absolute = this->GetMusicLocation (music, format);
|
|
||||||
|
|
||||||
m_pSound->StopMusic ();
|
m_pSound->StopMusic ();
|
||||||
m_pSound->PlayMusic (absolute);
|
m_pSound->PlayMusic (absolute);
|
||||||
|
@ -101,7 +101,7 @@ public:
|
|||||||
Sint32 GetImageWorld ();
|
Sint32 GetImageWorld ();
|
||||||
bool IsHelpHide ();
|
bool IsHelpHide ();
|
||||||
bool IsBaseMusicAvailable (Sint32 music, const std::string & format);
|
bool IsBaseMusicAvailable (Sint32 music, const std::string & format);
|
||||||
std::string GetMusicLocation (Sint32 music, std::string & format);
|
std::string GetMusicLocation (Sint32 music);
|
||||||
bool ChangePhase (Uint32 phase);
|
bool ChangePhase (Uint32 phase);
|
||||||
bool MovieToStart ();
|
bool MovieToStart ();
|
||||||
Uint32 GetPhase ();
|
Uint32 GetPhase ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user