diff --git a/BBGE/SoundManager.cpp b/BBGE/SoundManager.cpp index 77311a8..b5a5ae8 100644 --- a/BBGE/SoundManager.cpp +++ b/BBGE/SoundManager.cpp @@ -1494,14 +1494,8 @@ void loadCacheSoundsCallback (const std::string &filename, intptr_t param) } if (fileType==".ogg") { - - std::string f = filename; - stringToLower(f); - - debugLog("trying to load sound " + f); - - sm->loadSoundIntoBank(f, "", ""); - + debugLog("trying to load sound " + filename); + sm->loadSoundIntoBank(filename, "", ""); } } @@ -1521,21 +1515,18 @@ Buffer SoundManager::loadSoundIntoBank(const std::string &filename, const std::s // WARNING: local sounds should go here! - debugLog(filename); + debugLog(filename); if (slt == SFXLOAD_LOCAL && !audioPath2.empty()) { - f = audioPath2 + filename + format; - stringToLower(f); + f = core->adjustFilenameCase(audioPath2 + filename + format); if (!exists(f)) { - f = path + filename + format; - stringToLower(f); + f = core->adjustFilenameCase(path + filename + format); } } else { - f = path + filename + format; - stringToLower(f); + f = core->adjustFilenameCase(path + filename + format); } bool loop = false; @@ -1557,6 +1548,8 @@ Buffer SoundManager::loadSoundIntoBank(const std::string &filename, const std::s return Buffer(); } + stringToLower(name); + #ifdef BBGE_BUILD_FMODEX FMOD::Sound * sound = SoundCore::soundMap[name];