Make tex files generate even with other ones in the dir

This commit is contained in:
Agent X 2024-05-12 09:15:09 -04:00
parent 3c86c0c83b
commit 34113d3b53
1 changed files with 10 additions and 6 deletions

View File

@ -409,13 +409,22 @@ static void DynOS_Tex_GeneratePack_Recursive(const SysPath &aPackFolder, SysPath
continue;
}
// skip files that don't end in '.png'
size_t nameLen = strlen(_PackEnt->d_name);
if (nameLen < 4) continue;
// skip files that don't end in '.png'
if (strcmp(&_PackEnt->d_name[nameLen - 4], ".png")) {
continue;
}
// skip files that have already been generated
char buffer[1024];
snprintf(buffer, 1024, "%s.tex", _Path.substr(0, _Path.size() - 4).c_str());
if (fs_sys_file_exists(buffer)) {
continue;
}
// read the file
aGfxData->mModelIdentifier++;
TexData* _TexData = LoadTextureFromFile(aGfxData, _Path.c_str());
@ -468,11 +477,6 @@ static void DynOS_Tex_GeneratePack_Recursive(const SysPath &aPackFolder, SysPath
void DynOS_Tex_GeneratePack(const SysPath &aPackFolder, SysPath &aOutputFolder, bool aAllowCustomTextures) {
Print("Processing textures: \"%s\"", aPackFolder.c_str());
// skip generation if any .tex files exist
if (FileTypeExists(aOutputFolder, ".tex")) {
return;
}
GfxData *_GfxData = New<GfxData>();
_GfxData->mModelIdentifier = 0;
SysPath _Empty = "";