Clean up filesystem path usage in examples

This commit is contained in:
Chris Thrasher 2022-03-14 19:32:26 -06:00 committed by Lukas Dürrenberger
parent d64cbff463
commit 33a7c4d2a8
3 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@ std::filesystem::path resourcesDir()
#ifdef SFML_SYSTEM_IOS
return "";
#else
return "resources/";
return "resources";
#endif
}

View File

@ -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

View File

@ -17,7 +17,7 @@ std::filesystem::path resourcesDir()
#ifdef SFML_SYSTEM_IOS
return "";
#else
return "resources/";
return "resources";
#endif
}