mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-05-12 15:59:38 -06:00
Fix dump directory creation
Thanks to Switch-9867 on GH for pointing out the issue
This commit is contained in:
parent
bc0ebfc106
commit
e3260daea2
@ -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);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user