Atomic RSX capture writes

This commit is contained in:
Eladash 2021-02-23 06:35:35 +02:00 committed by Ivan
parent 9ccf39b27f
commit 447d2b6f93

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);
}