mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Clean up filesystem path usage in examples
This commit is contained in:
parent
d64cbff463
commit
33a7c4d2a8
@ -22,7 +22,7 @@ std::filesystem::path resourcesDir()
|
|||||||
#ifdef SFML_SYSTEM_IOS
|
#ifdef SFML_SYSTEM_IOS
|
||||||
return "";
|
return "";
|
||||||
#else
|
#else
|
||||||
return "resources/";
|
return "resources";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,11 +46,11 @@ void playSound()
|
|||||||
/// Play a music
|
/// Play a music
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void playMusic(const std::string& filename)
|
void playMusic(const std::filesystem::path& filename)
|
||||||
{
|
{
|
||||||
// Load an ogg music file
|
// Load an ogg music file
|
||||||
sf::Music music;
|
sf::Music music;
|
||||||
if (!music.openFromFile("resources/" + filename))
|
if (!music.openFromFile("resources" / filename))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Display music informations
|
// Display music informations
|
||||||
|
@ -17,7 +17,7 @@ std::filesystem::path resourcesDir()
|
|||||||
#ifdef SFML_SYSTEM_IOS
|
#ifdef SFML_SYSTEM_IOS
|
||||||
return "";
|
return "";
|
||||||
#else
|
#else
|
||||||
return "resources/";
|
return "resources";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user