mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Add an argument to look for music only in the base location
This commit is contained in:
parent
7097c6708d
commit
ce0fe82a02
@ -3066,7 +3066,7 @@ CEvent::IsHelpHide ()
|
||||
}
|
||||
|
||||
std::string
|
||||
CEvent::GetMusicLocation (Sint32 music, std::string & format)
|
||||
CEvent::GetMusicLocation (Sint32 music, std::string & format, bool onlyBase)
|
||||
{
|
||||
static const std::string exts[] = {"ogg", "mid"};
|
||||
static const Location locs[] = {LOCATION_USER, LOCATION_BASE};
|
||||
@ -3077,6 +3077,9 @@ CEvent::GetMusicLocation (Sint32 music, std::string & format)
|
||||
// Look for music in the user directory, then in the game directory.
|
||||
for (size_t i = 0; i < countof (locs); ++i)
|
||||
{
|
||||
if (onlyBase && locs[i] != LOCATION_BASE)
|
||||
continue;
|
||||
|
||||
format = exts[g_restoreMidi ? 1 : 0];
|
||||
auto filename =
|
||||
string_format ("music/music%.3d.%s", music - 1, format.c_str ());
|
||||
|
23
src/event.h
23
src/event.h
@ -94,17 +94,18 @@ public:
|
||||
|
||||
Point GetMousePos ();
|
||||
void
|
||||
Create (CPixmap * pPixmap, CDecor * pDecor, CSound * pSound, CMovie * pMovie);
|
||||
void SetFullScreen (bool bFullScreen);
|
||||
Sint32 GetWorld ();
|
||||
Sint32 GetPhysicalWorld ();
|
||||
Sint32 GetImageWorld ();
|
||||
bool IsHelpHide ();
|
||||
std::string GetMusicLocation (Sint32 music, std::string & format);
|
||||
bool ChangePhase (Uint32 phase);
|
||||
bool MovieToStart ();
|
||||
Uint32 GetPhase ();
|
||||
void TryInsert ();
|
||||
Create (CPixmap * pPixmap, CDecor * pDecor, CSound * pSound, CMovie * pMovie);
|
||||
void SetFullScreen (bool bFullScreen);
|
||||
Sint32 GetWorld ();
|
||||
Sint32 GetPhysicalWorld ();
|
||||
Sint32 GetImageWorld ();
|
||||
bool IsHelpHide ();
|
||||
std::string
|
||||
GetMusicLocation (Sint32 music, std::string & format, bool onlyBase = false);
|
||||
bool ChangePhase (Uint32 phase);
|
||||
bool MovieToStart ();
|
||||
Uint32 GetPhase ();
|
||||
void TryInsert ();
|
||||
|
||||
Sint32 GetButtonIndex (Sint32 button);
|
||||
Sint32 GetState (Sint32 button);
|
||||
|
Loading…
x
Reference in New Issue
Block a user