Fix texture dumping directory creation

This commit is contained in:
Switch 2026-01-07 13:30:47 -05:00
parent c5913fe8cb
commit 0762ef0431

View File

@ -684,6 +684,14 @@ void LatteTextureLoader_UpdateTextureSliceData(LatteTexture* tex, uint32 sliceIn
// write texture dump // write texture dump
if (textureLoader.dump) if (textureLoader.dump)
{ {
std::filesystem::path outputDir = "dump/textures";
if (!std::filesystem::exists(outputDir))
{
std::error_code ec;
std::filesystem::create_directories(outputDir, ec);
}
wchar_t path[1024]; wchar_t path[1024];
swprintf(path, 1024, L"dump/textures/%08x_fmt%04x_slice%d_mip%02d_%dx%d_tm%02d.tga", physImagePtr, (uint32)tex->format, sliceIndex, mipIndex, tex->width, tex->height, tileMode); swprintf(path, 1024, L"dump/textures/%08x_fmt%04x_slice%d_mip%02d_%dx%d_tm%02d.tga", physImagePtr, (uint32)tex->format, sliceIndex, mipIndex, tex->width, tex->height, tileMode);
tga_write_rgba(path, textureLoader.width, textureLoader.height, textureLoader.dumpRGBA); tga_write_rgba(path, textureLoader.width, textureLoader.height, textureLoader.dumpRGBA);