From f8d396ac9e9b50fe262adf9432b4a731a2a344d9 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sun, 24 Jun 2018 12:43:50 +0200 Subject: [PATCH] change rsx_capture filename --- rpcs3/Emu/RSX/rsx_methods.cpp | 3 ++- rpcs3/date_time.h | 13 +++++++++++++ rpcs3/emucore.vcxproj | 1 + rpcs3/emucore.vcxproj.filters | 3 +++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 rpcs3/date_time.h diff --git a/rpcs3/Emu/RSX/rsx_methods.cpp b/rpcs3/Emu/RSX/rsx_methods.cpp index b733e65f08..b4d514e00d 100644 --- a/rpcs3/Emu/RSX/rsx_methods.cpp +++ b/rpcs3/Emu/RSX/rsx_methods.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "date_time.h" #include "rsx_methods.h" #include "RSXThread.h" #include "Emu/Memory/Memory.h" @@ -1106,7 +1107,7 @@ namespace rsx rsx->capture_current_frame = false; std::stringstream os; cereal::BinaryOutputArchive archive(os); - const std::string& filePath = fs::get_config_dir() + "capture.rrc"; + const std::string& filePath = fs::get_config_dir() + Emu.GetTitleID() + "_" + get_current_date_time() +"_capture.rrc"; archive(frame_capture); { // todo: 'dynamicly' create capture filename, also may want to compress this data? diff --git a/rpcs3/date_time.h b/rpcs3/date_time.h new file mode 100644 index 0000000000..c63e611684 --- /dev/null +++ b/rpcs3/date_time.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +const std::string get_current_date_time() +{ + time_t now = time(0); + tm* tstruct = localtime(&now); + char buf[80]; + strftime(buf, sizeof(buf), "%Y%m%d%H%M%S", tstruct); + delete tstruct; + return buf; +} diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index 4d41c1dfd3..5626ae2bda 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -390,6 +390,7 @@ + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 8bf7eb2b67..1163d62882 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -1447,5 +1447,8 @@ Emu\GPU\RSX\Overlays + + Utilities + \ No newline at end of file