3#include <BufferStream.h>
12 BufferStreamReadOnly stream{hotData.data(), hotData.size()};
19 this->
rects.resize(stream.read<uint16_t>());
20 for (
auto& rect : this->
rects) {
21 stream >> rect.flags >> rect.x1 >> rect.y1 >> rect.x2 >> rect.y2;
28 :
HOT(fs::readFileBuffer(hotPath)) {}
30HOT::operator bool()
const {
66 std::vector<std::byte> hotspotData;
67 BufferStream stream{hotspotData};
70 stream.write<uint16_t>(this->
rects.size());
72 for (
const auto& rect : this->
rects) {
73 stream << rect.flags << rect.x1 << rect.y1 << rect.x2 << rect.y2;
76 hotspotData.resize(stream.tell());
std::vector< std::byte > bake() const
void setVersion(uint8_t v)
std::vector< Rect > rects
const std::vector< Rect > & getRects() const
uint8_t getVersion() const
bool writeFileBuffer(const std::string &filepath, std::span< const std::byte > buffer)