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 = "";