mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-13 02:08:49 +12:00
rsx: zip and unzip rsx captures
This commit is contained in:
parent
66d01b688c
commit
840455b872
3 changed files with 25 additions and 4 deletions
|
@ -24,6 +24,7 @@
|
|||
#include "Program/GLSLCommon.h"
|
||||
#include "Utilities/date_time.h"
|
||||
#include "Utilities/StrUtil.h"
|
||||
#include "Crypto/unzip.h"
|
||||
|
||||
#include "util/serialization.hpp"
|
||||
#include "util/asm.hpp"
|
||||
|
@ -3588,14 +3589,23 @@ 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";
|
||||
std::string file_path = fs::get_config_dir() + "captures/" + Emu.GetTitleID() + "_" + date_time::current_time_narrow() + "_capture.rrc";
|
||||
|
||||
// todo: may want to compress this data?
|
||||
utils::serial save_manager;
|
||||
save_manager.reserve(0x800'0000); // 128MB
|
||||
|
||||
save_manager(frame_capture);
|
||||
|
||||
if (std::vector<u8> zipped = zip(save_manager.data); !zipped.empty())
|
||||
{
|
||||
file_path += ".gz";
|
||||
save_manager.data = std::move(zipped);
|
||||
}
|
||||
else
|
||||
{
|
||||
rsx_log.error("Failed to compress capture");
|
||||
}
|
||||
|
||||
fs::pending_file temp(file_path);
|
||||
|
||||
if (temp.file && (temp.file.write(save_manager.data), temp.commit(false)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue