diff --git a/src/app/app.cpp b/src/app/app.cpp index c1439ff1..d34532f7 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -47,7 +47,6 @@ #include "sound/oalsound/alsound.h" #endif -#include #include #include diff --git a/src/common/resources/resourcemanager.cpp b/src/common/resources/resourcemanager.cpp index 94326a9f..9130b889 100644 --- a/src/common/resources/resourcemanager.cpp +++ b/src/common/resources/resourcemanager.cpp @@ -152,27 +152,17 @@ bool CResourceManager::CreateDirectory(const std::string& directory) return false; } -//TODO: Don't use boost::filesystem here bool CResourceManager::RemoveDirectory(const std::string& directory) { if (PHYSFS_isInit()) { - bool success = true; - std::string writeDir = PHYSFS_getWriteDir(); - try + std::string path = CleanPath(directory); + for (auto file : ListFiles(path)) { - std::string path = writeDir + "/" + CleanPath(directory); - #if PLATFORM_WINDOWS - fs::remove_all(CSystemUtilsWindows::UTF8_Decode(path)); - #else - fs::remove_all(path); - #endif + if (PHYSFS_delete((path + "/" + file).c_str()) == 0) + return false; } - catch (std::exception&) - { - success = false; - } - return success; + return PHYSFS_delete(path.c_str()) != 0; } return false; } diff --git a/src/sound/oalsound/alsound.cpp b/src/sound/oalsound/alsound.cpp index 95b49a98..cfa335d1 100644 --- a/src/sound/oalsound/alsound.cpp +++ b/src/sound/oalsound/alsound.cpp @@ -25,7 +25,6 @@ #include #include -#include CALSound::CALSound() : m_enabled(false), @@ -586,11 +585,6 @@ bool CALSound::PlayMusic(const std::string &filename, bool repeat, float fadeTim if (m_music.find(filename) == m_music.end()) { GetLogger()->Debug("Music %s was not cached!\n", filename.c_str()); - /* TODO: if (!boost::filesystem::exists(filename)) - { - GetLogger()->Debug("Requested music %s was not found.\n", filename.c_str()); - return false; - } */ auto newBuffer = MakeUnique(); buffer = newBuffer.get(); diff --git a/src/sound/sound.cpp b/src/sound/sound.cpp index d22523f0..3640c585 100644 --- a/src/sound/sound.cpp +++ b/src/sound/sound.cpp @@ -27,8 +27,6 @@ #include #include -#include - CSoundInterface::CSoundInterface() {