From e3260daea23066485f36d3cf363e3af3e0c12f81 Mon Sep 17 00:00:00 2001 From: goeiecool9999 <7033575+goeiecool9999@users.noreply.github.com> Date: Fri, 9 Jan 2026 11:02:35 +0100 Subject: [PATCH] Fix dump directory creation Thanks to Switch-9867 on GH for pointing out the issue --- src/Cafe/HW/Latte/Core/LatteTextureLoader.cpp | 4 ++-- src/gui/wxgui/MainWindow.cpp | 6 +++--- src/util/ImageWriter/tga.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Cafe/HW/Latte/Core/LatteTextureLoader.cpp b/src/Cafe/HW/Latte/Core/LatteTextureLoader.cpp index 48cfb0f2..589b3bd0 100644 --- a/src/Cafe/HW/Latte/Core/LatteTextureLoader.cpp +++ b/src/Cafe/HW/Latte/Core/LatteTextureLoader.cpp @@ -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); } diff --git a/src/gui/wxgui/MainWindow.cpp b/src/gui/wxgui/MainWindow.cpp index 45d64841..9b6b8163 100644 --- a/src/gui/wxgui/MainWindow.cpp +++ b/src/gui/wxgui/MainWindow.cpp @@ -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); } } } diff --git a/src/util/ImageWriter/tga.h b/src/util/ImageWriter/tga.h index 822bdaae..f105b5f2 100644 --- a/src/util/ImageWriter/tga.h +++ b/src/util/ImageWriter/tga.h @@ -1,9 +1,9 @@ #include "Common/FileStream.h" #include -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;