From 9f410ad161d6f2fe7a73ebfbcbab08025924a65c Mon Sep 17 00:00:00 2001 From: MysterD Date: Sat, 7 May 2022 16:39:19 -0700 Subject: [PATCH] Fixed custom textures on Windows --- data/dynos_bin_tex.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/dynos_bin_tex.cpp b/data/dynos_bin_tex.cpp index c9d548a0..67a675d1 100644 --- a/data/dynos_bin_tex.cpp +++ b/data/dynos_bin_tex.cpp @@ -30,7 +30,9 @@ static TexData* LoadTextureFromFile(GfxData *aGfxData, const char* aFile) { // Image file SysPath _Filename; int fileNameLen = strlen(aFile); - if (fileNameLen > 4 && !strcmp(&aFile[fileNameLen - 4], ".png")) { + if (aGfxData->mPackFolder.length() == 0) { + _Filename = aFile; + } else if (fileNameLen > 4 && !strcmp(&aFile[fileNameLen - 4], ".png")) { _Filename = fstring("%s/%s", aGfxData->mPackFolder.c_str(), aFile); } else { _Filename = fstring("%s/%s.png", aGfxData->mPackFolder.c_str(), aFile); @@ -322,7 +324,7 @@ static void DynOS_Tex_GeneratePack_Recursive(const SysPath &aPackFolder, SysPath if (SysPath(_PackEnt->d_name) == ".") continue; if (SysPath(_PackEnt->d_name) == "..") continue; - SysPath _Path = fstring("%s/%s", _DirPath.c_str(), _PackEnt->d_name); + SysPath _Path = fstring("%s%s", _DirPath.c_str(), _PackEnt->d_name); // Recurse through subfolders if (fs_sys_dir_exists(_Path.c_str())) {