diff --git a/src/resource_manager.cpp b/src/resource_manager.cpp index 55cd5cd..fc59cd8 100644 --- a/src/resource_manager.cpp +++ b/src/resource_manager.cpp @@ -19,7 +19,7 @@ ResourceManager::~ResourceManager() { */ std::string getCurrentDirectory() { int length = wai_getExecutablePath(NULL, 0, NULL), dirname_length; - std::unique_ptr buffer = std::unique_ptr(new char[length + 1]); + std::unique_ptr buffer = std::make_unique(length + 1); wai_getExecutablePath(buffer.get(), length, &dirname_length); if (dirname_length == 0) { @@ -56,8 +56,6 @@ sf::Texture& ResourceManager::getTexture(std::string name) { } void ResourceManager::setMusic(std::string name) { - std::string path = getCurrentDirectory() - if (!music.openFromFile(getResourcePath(name))) { throw std::runtime_error("Impossible de charger la musique : " + name); }