mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-27 20:20:40 +00:00
- added a filter to the directory loader to remove EDuke32's texture cache files.
These cause problems with the texture manager.
This commit is contained in:
parent
bc007d75de
commit
f6c4c19b02
1 changed files with 16 additions and 1 deletions
|
@ -154,13 +154,28 @@ int FDirectory::AddDirectory(const char *dirpath)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (strstr(fi, ".orig") || strstr(fi, ".bak"))
|
if (strstr(fi, ".orig") || strstr(fi, ".bak") || strstr(fi, ".cache"))
|
||||||
{
|
{
|
||||||
// We shouldn't add backup files to the file system
|
// We shouldn't add backup files to the file system
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
FString fn = FString(dirpath) + fi;
|
FString fn = FString(dirpath) + fi;
|
||||||
|
|
||||||
|
// The next one is courtesy of EDuke32. :(
|
||||||
|
// Putting cache files in the application directory is very bad style.
|
||||||
|
// Unfortunately, having a garbage file named "texture" present will cause serious problems down the line.
|
||||||
|
if (!stricmp(fi, "textures"))
|
||||||
|
{
|
||||||
|
FILE* f = fopen(fn, "rb");
|
||||||
|
if (f)
|
||||||
|
{
|
||||||
|
char check[3]{};
|
||||||
|
fread(check, 1, 3, f);
|
||||||
|
if (!memcmp(check, "LZ4", 3)) continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (GetFileInfo(fn, &size, nullptr))
|
if (GetFileInfo(fn, &size, nullptr))
|
||||||
{
|
{
|
||||||
AddEntry(fn, (int)size);
|
AddEntry(fn, (int)size);
|
||||||
|
|
Loading…
Reference in a new issue