From 45b9b7d21103e504043e011793d696f75ab80645 Mon Sep 17 00:00:00 2001 From: Ryan Meredith Date: Wed, 6 Jun 2018 08:42:41 -0400 Subject: [PATCH] Give Dump Objects dedicated folder and tooltip --- Source/Core/Common/CommonPaths.h | 1 + Source/Core/Common/FileUtil.cpp | 2 ++ Source/Core/Common/FileUtil.h | 1 + .../DolphinQt2/Config/Graphics/SoftwareRendererWidget.cpp | 5 +++++ Source/Core/UICommon/UICommon.cpp | 6 +++--- Source/Core/VideoBackends/Software/DebugUtil.cpp | 4 ++-- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Source/Core/Common/CommonPaths.h b/Source/Core/Common/CommonPaths.h index e641b33294..2255b594f5 100644 --- a/Source/Core/Common/CommonPaths.h +++ b/Source/Core/Common/CommonPaths.h @@ -47,6 +47,7 @@ #define DUMP_DIR "Dump" #define DUMP_TEXTURES_DIR "Textures" #define DUMP_FRAMES_DIR "Frames" +#define DUMP_OBJECTS_DIR "Objects" #define DUMP_AUDIO_DIR "Audio" #define DUMP_DSP_DIR "DSP" #define DUMP_SSL_DIR "SSL" diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 3b8ea2a84e..41cc73240e 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -767,6 +767,7 @@ static void RebuildUserDirectories(unsigned int dir_index) s_user_paths[D_HIRESTEXTURES_IDX] = s_user_paths[D_LOAD_IDX] + HIRES_TEXTURES_DIR DIR_SEP; s_user_paths[D_DUMP_IDX] = s_user_paths[D_USER_IDX] + DUMP_DIR DIR_SEP; s_user_paths[D_DUMPFRAMES_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_FRAMES_DIR DIR_SEP; + s_user_paths[D_DUMPOBJECTS_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_OBJECTS_DIR DIR_SEP; s_user_paths[D_DUMPAUDIO_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_AUDIO_DIR DIR_SEP; s_user_paths[D_DUMPTEXTURES_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_TEXTURES_DIR DIR_SEP; s_user_paths[D_DUMPDSP_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_DSP_DIR DIR_SEP; @@ -822,6 +823,7 @@ static void RebuildUserDirectories(unsigned int dir_index) case D_DUMP_IDX: s_user_paths[D_DUMPFRAMES_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_FRAMES_DIR DIR_SEP; + s_user_paths[D_DUMPOBJECTS_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_OBJECTS_DIR DIR_SEP; s_user_paths[D_DUMPAUDIO_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_AUDIO_DIR DIR_SEP; s_user_paths[D_DUMPTEXTURES_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_TEXTURES_DIR DIR_SEP; s_user_paths[D_DUMPDSP_IDX] = s_user_paths[D_DUMP_IDX] + DUMP_DSP_DIR DIR_SEP; diff --git a/Source/Core/Common/FileUtil.h b/Source/Core/Common/FileUtil.h index bc7ec4e70c..035cecb48f 100644 --- a/Source/Core/Common/FileUtil.h +++ b/Source/Core/Common/FileUtil.h @@ -36,6 +36,7 @@ enum D_HIRESTEXTURES_IDX, D_DUMP_IDX, D_DUMPFRAMES_IDX, + D_DUMPOBJECTS_IDX, D_DUMPAUDIO_IDX, D_DUMPTEXTURES_IDX, D_DUMPDSP_IDX, diff --git a/Source/Core/DolphinQt2/Config/Graphics/SoftwareRendererWidget.cpp b/Source/Core/DolphinQt2/Config/Graphics/SoftwareRendererWidget.cpp index b9a6dd0f0b..42ecf6ff02 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/SoftwareRendererWidget.cpp +++ b/Source/Core/DolphinQt2/Config/Graphics/SoftwareRendererWidget.cpp @@ -161,7 +161,12 @@ void SoftwareRendererWidget::AddDescriptions() QT_TR_NOOP("Dump decoded game textures to User/Dump/Textures//.\n\nIf unsure, leave " "this unchecked."); + static const char* TR_DUMP_OBJECTS_DESCRIPTION = + QT_TR_NOOP("Dump objects to User/Dump/Objects/.\n\nIf unsure, leave " + "this unchecked."); + AddDescription(m_backend_combo, TR_BACKEND_DESCRIPTION); AddDescription(m_show_statistics, TR_SHOW_STATISTICS_DESCRIPTION); AddDescription(m_dump_textures, TR_DUMP_TEXTURES_DESCRIPTION); + AddDescription(m_dump_objects, TR_DUMP_OBJECTS_DESCRIPTION); } diff --git a/Source/Core/UICommon/UICommon.cpp b/Source/Core/UICommon/UICommon.cpp index 16fd08bad0..a9453882dc 100644 --- a/Source/Core/UICommon/UICommon.cpp +++ b/Source/Core/UICommon/UICommon.cpp @@ -50,13 +50,13 @@ namespace UICommon { static void CreateDumpPath(const std::string& path) { - if (path.empty()) - return; - File::SetUserPath(D_DUMP_IDX, path + '/'); + if (!path.empty()) + File::SetUserPath(D_DUMP_IDX, path + '/'); File::CreateFullPath(File::GetUserPath(D_DUMPAUDIO_IDX)); File::CreateFullPath(File::GetUserPath(D_DUMPDSP_IDX)); File::CreateFullPath(File::GetUserPath(D_DUMPSSL_IDX)); File::CreateFullPath(File::GetUserPath(D_DUMPFRAMES_IDX)); + File::CreateFullPath(File::GetUserPath(D_DUMPOBJECTS_IDX)); File::CreateFullPath(File::GetUserPath(D_DUMPTEXTURES_IDX)); } diff --git a/Source/Core/VideoBackends/Software/DebugUtil.cpp b/Source/Core/VideoBackends/Software/DebugUtil.cpp index ecd82f6dbd..54fe476f16 100644 --- a/Source/Core/VideoBackends/Software/DebugUtil.cpp +++ b/Source/Core/VideoBackends/Software/DebugUtil.cpp @@ -200,7 +200,7 @@ void OnObjectEnd() { if (g_ActiveConfig.bDumpObjects && stats.thisFrame.numDrawnObjects >= g_ActiveConfig.drawStart && stats.thisFrame.numDrawnObjects < g_ActiveConfig.drawEnd) - DumpEfb(StringFromFormat("%sobject%i.png", File::GetUserPath(D_DUMPFRAMES_IDX).c_str(), + DumpEfb(StringFromFormat("%sobject%i.png", File::GetUserPath(D_DUMPOBJECTS_IDX).c_str(), stats.thisFrame.numDrawnObjects)); for (int i = 0; i < NUM_OBJECT_BUFFERS; i++) @@ -209,7 +209,7 @@ void OnObjectEnd() { DrawnToBuffer[i] = false; std::string filename = - StringFromFormat("%sobject%i_%s(%i).png", File::GetUserPath(D_DUMPFRAMES_IDX).c_str(), + StringFromFormat("%sobject%i_%s(%i).png", File::GetUserPath(D_DUMPOBJECTS_IDX).c_str(), stats.thisFrame.numDrawnObjects, ObjectBufferName[i], i - BufferBase[i]); TextureToPng((u8*)ObjectBuffer[i], EFB_WIDTH * 4, filename, EFB_WIDTH, EFB_HEIGHT, true);