Fix dump directory creation

Thanks to Switch-9867 on GH for pointing out the issue
This commit is contained in:
goeiecool9999 2026-01-09 11:02:35 +01:00
parent bc0ebfc106
commit e3260daea2
3 changed files with 7 additions and 7 deletions

View File

@ -684,8 +684,8 @@ void LatteTextureLoader_UpdateTextureSliceData(LatteTexture* tex, uint32 sliceIn
// write texture dump
if (textureLoader.dump)
{
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);
fs::path path = ActiveSettings::GetUserDataPath("dump/textures");
path /= fmt::format("{:08x}_fmt{:04x}_slice{:d}_mip{:02d}_{:d}x{: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);
free(textureLoader.dumpRGBA);
}

View File

@ -1147,13 +1147,13 @@ void MainWindow::OnDebugDumpGeneric(wxCommandEvent& event)
{
try
{
fs::create_directories(ActiveSettings::GetUserDataPath("dump/shaders"));
fs::create_directories(ActiveSettings::GetUserDataPath(dumpSubpath));
}
catch (const std::exception & ex)
{
SystemException sys(ex);
cemuLog_log(LogType::Force, "can't create shaders dump folder: {}", ex.what());
ActiveSettings::EnableDumpShaders(false);
cemuLog_log(LogType::Force, "can't create folder {} in user data folder: {}", dumpSubpath, ex.what());
setDumpState(false);
}
}
}

View File

@ -1,9 +1,9 @@
#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 fs::path& path, sint32 width, sint32 height, uint8* pixelData)
{
FileStream* fs = FileStream::createFile(path);
FileStream* fs = FileStream::createFile2(path);
if (fs == nullptr)
return false;