Fix custom brush loading

This commit is contained in:
jacob1 2021-07-11 16:48:05 -04:00
parent cfeda0fdba
commit 05f722b397
No account linked to committer's email address
2 changed files with 1 additions and 7 deletions

View File

@ -299,9 +299,6 @@ std::vector<ByteString> DirectorySearch(ByteString directory, ByteString search,
findFileHandle = _wfindfirst(Platform::WinWiden(fileMatch).c_str(), &currentFile); findFileHandle = _wfindfirst(Platform::WinWiden(fileMatch).c_str(), &currentFile);
if (findFileHandle == -1L) if (findFileHandle == -1L)
{ {
#ifdef DEBUG
printf("Unable to open directory: %s\n", directory.c_str());
#endif
return std::vector<ByteString>(); return std::vector<ByteString>();
} }
do do
@ -318,9 +315,6 @@ std::vector<ByteString> DirectorySearch(ByteString directory, ByteString search,
DIR *directoryHandle = opendir(directory.c_str()); DIR *directoryHandle = opendir(directory.c_str());
if (!directoryHandle) if (!directoryHandle)
{ {
#ifdef DEBUG
printf("Unable to open directory: %s\n", directory.c_str());
#endif
return std::vector<ByteString>(); return std::vector<ByteString>();
} }
while ((directoryEntry = readdir(directoryHandle))) while ((directoryEntry = readdir(directoryHandle)))

View File

@ -476,7 +476,7 @@ void GameModel::BuildBrushList()
std::vector<ByteString> brushFiles = Platform::DirectorySearch(BRUSH_DIR, "", { ".ptb" }); std::vector<ByteString> brushFiles = Platform::DirectorySearch(BRUSH_DIR, "", { ".ptb" });
for (size_t i = 0; i < brushFiles.size(); i++) for (size_t i = 0; i < brushFiles.size(); i++)
{ {
std::vector<unsigned char> brushData = Client::Ref().ReadFile(brushFiles[i]); std::vector<unsigned char> brushData = Client::Ref().ReadFile(BRUSH_DIR + ByteString(PATH_SEP) + brushFiles[i]);
if(!brushData.size()) if(!brushData.size())
{ {
std::cout << "Brushes: Skipping " << brushFiles[i] << ". Could not open" << std::endl; std::cout << "Brushes: Skipping " << brushFiles[i] << ". Could not open" << std::endl;