Correction typo dans ResourceManager
This commit is contained in:
parent
e45939344e
commit
6dbf641651
|
@ -19,7 +19,7 @@ ResourceManager::~ResourceManager() {
|
||||||
*/
|
*/
|
||||||
std::string getCurrentDirectory() {
|
std::string getCurrentDirectory() {
|
||||||
int length = wai_getExecutablePath(NULL, 0, NULL), dirname_length;
|
int length = wai_getExecutablePath(NULL, 0, NULL), dirname_length;
|
||||||
std::unique_ptr<char> buffer = std::unique_ptr<char>(new char[length + 1]);
|
std::unique_ptr<char[]> buffer = std::make_unique<char[]>(length + 1);
|
||||||
wai_getExecutablePath(buffer.get(), length, &dirname_length);
|
wai_getExecutablePath(buffer.get(), length, &dirname_length);
|
||||||
|
|
||||||
if (dirname_length == 0) {
|
if (dirname_length == 0) {
|
||||||
|
@ -56,8 +56,6 @@ sf::Texture& ResourceManager::getTexture(std::string name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourceManager::setMusic(std::string name) {
|
void ResourceManager::setMusic(std::string name) {
|
||||||
std::string path = getCurrentDirectory()
|
|
||||||
|
|
||||||
if (!music.openFromFile(getResourcePath(name))) {
|
if (!music.openFromFile(getResourcePath(name))) {
|
||||||
throw std::runtime_error("Impossible de charger la musique : " + name);
|
throw std::runtime_error("Impossible de charger la musique : " + name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue