Skip to content

Commit

Permalink
texture.cpp: Fix loading decals from ktx2 files
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Sep 7, 2023
1 parent eefd2e6 commit c3845cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/texture.cpp
Expand Up @@ -81,7 +81,7 @@ int getCurrentTileTextureSize()
int getMaxTileTextureSize(std::string dir)
{
int res = MIPMAP_MAX;
while (res > 0 && !PHYSFS_exists(WzString::fromUtf8(dir + "-" + std::to_string(res) + "/tile-00.png")))
while (res > 0 && !PHYSFS_exists(WzString::fromUtf8(dir + "-" + std::to_string(res) + "/tile-00.ktx2")) && !PHYSFS_exists(WzString::fromUtf8(dir + "-" + std::to_string(res) + "/tile-00.png")))
res /= 2;
return res;
}
Expand Down Expand Up @@ -310,7 +310,7 @@ bool texLoad(const char *fileName)
std::vector<WzString> usedFilenames_tmp;
for (k = 0; k <= maxTileNo; ++k)
{
auto fullPath_base = WzString::fromUtf8(astringf("%s/tile-%02d.png", partialPath, k));
auto fullPath_base = gfx_api::imageLoadFilenameFromInputFilename(WzString::fromUtf8(astringf("%s/tile-%02d.png", partialPath, k)));
tile_base_filepaths.push_back(fullPath_base);
usedFilenames_tmp.push_back(fullPath_base);

Expand Down

0 comments on commit c3845cc

Please sign in to comment.