mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +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
|
||||
return "";
|
||||
#else
|
||||
return "resources/";
|
||||
return "resources";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -46,11 +46,11 @@ void playSound()
|
||||
/// Play a music
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void playMusic(const std::string& filename)
|
||||
void playMusic(const std::filesystem::path& filename)
|
||||
{
|
||||
// Load an ogg music file
|
||||
sf::Music music;
|
||||
if (!music.openFromFile("resources/" + filename))
|
||||
if (!music.openFromFile("resources" / filename))
|
||||
return;
|
||||
|
||||
// Display music informations
|
||||
|
@ -17,7 +17,7 @@ std::filesystem::path resourcesDir()
|
||||
#ifdef SFML_SYSTEM_IOS
|
||||
return "";
|
||||
#else
|
||||
return "resources/";
|
||||
return "resources";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user