Atomic RSX capture writes

This commit is contained in:
Eladash authored and Ivan committed 2021-02-23 11:29:23 +03:00
1 parent 9ccf39b27f
commit 447d2b6f93
1 file changed
+5 -2
+5 -2
View File
@@ -2889,10 +2889,13 @@ namespace rsx
capture_current_frame = false;
const std::string file_path = fs::get_config_dir() + "captures/" + Emu.GetTitleID() + "_" + date_time::current_time_narrow() + "_capture.rrc";
const std::string file_data = cereal_serialize(frame_capture);
// todo: may want to compress this data?
if (fs::write_file(file_path, fs::rewrite, file_data))
const std::string file_data = cereal_serialize(frame_capture);
fs::pending_file temp(file_path);
if (temp.file && (temp.file.write(file_data), temp.commit(false)))
{
rsx_log.success("Capture successful: %s", file_path);
}