change LatteTextureLoader_UpdateTextureSliceData to use ActiveSettings::GetUserDataPath instead of relative path

This commit is contained in:
Switch 2026-01-07 14:49:05 -05:00
parent af9296a3b6
commit df26b1ca37
2 changed files with 7 additions and 10 deletions

View File

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

View File

@ -1,7 +1,7 @@
#include "Common/FileStream.h"
#include <vector>
static bool tga_write_rgba(wchar_t* path, sint32 width, sint32 height, uint8* pixelData)
static bool tga_write_rgba(const wchar_t* path, sint32 width, sint32 height, uint8* pixelData)
{
FileStream* fs = FileStream::createFile(path);
if (fs == nullptr)