From 34113d3b534f17d3871851c4b37c4dfcb1e14ed0 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+AgentXLP@users.noreply.github.com> Date: Sun, 12 May 2024 09:15:09 -0400 Subject: [PATCH] Make tex files generate even with other ones in the dir --- data/dynos_bin_tex.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/data/dynos_bin_tex.cpp b/data/dynos_bin_tex.cpp index 3a1e5820..bac9f5d6 100644 --- a/data/dynos_bin_tex.cpp +++ b/data/dynos_bin_tex.cpp @@ -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->mModelIdentifier = 0; SysPath _Empty = "";