Remove part of boost::filesystem usage.
parent
b56cd11c98
commit
2168b57cac
|
@ -47,7 +47,6 @@
|
|||
#include "sound/oalsound/alsound.h"
|
||||
#endif
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/tokenizer.hpp>
|
||||
|
||||
#include <SDL.h>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include <algorithm>
|
||||
#include <iomanip>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
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<CBuffer>();
|
||||
buffer = newBuffer.get();
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
|
||||
CSoundInterface::CSoundInterface()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue