Seal cereal includes in util/cereal.cpp

This commit is contained in:
Nekotekina 2021-01-28 10:29:13 +03:00
parent 34274ec391
commit 67dd6754a6
7 changed files with 73 additions and 27 deletions

View file

@ -34,9 +34,7 @@
#include "util/sysinfo.hpp"
#include "util/yaml.hpp"
#include "util/logs.hpp"
#include "cereal/archives/binary.hpp"
#include <cereal/types/unordered_map.hpp>
#include "util/cereal.hpp"
#include <thread>
#include <queue>
@ -521,14 +519,16 @@ std::string Emulator::PPUCache() const
bool Emulator::BootRsxCapture(const std::string& path)
{
if (!fs::is_file(path))
fs::file in_file(path);
if (!in_file)
{
return false;
}
std::fstream f(path, std::ios::in | std::ios::binary);
cereal::BinaryInputArchive archive(f);
std::unique_ptr<rsx::frame_capture_data> frame = std::make_unique<rsx::frame_capture_data>();
archive(*frame);
cereal_deserialize(*frame, in_file.to_string());
in_file.close();
if (frame->magic != rsx::FRAME_CAPTURE_MAGIC)
{