Overhaul animation queues so the queue is stored as a single encoded string.

This commit is contained in:
2023-07-26 17:40:20 -04:00
parent 2dff145885
commit b459eedc82
10 changed files with 239 additions and 242 deletions

View File

@@ -169,6 +169,15 @@ void StreamBuffer::read_bytes_into(char *data, int64_t size) {
read_cursor_ += size;
}
std::string_view StreamBuffer::read_string_view_limit(uint64_t limit) {
uint64_t length = read_length();
if (length > limit) throw StreamCorruption();
check_available(length);
std::string_view result(read_cursor_, length);
read_cursor_ += length;
return result;
}
void StreamBuffer::write_xyz(const util::XYZ &xyz) {
make_space(12);
memcpy(write_cursor_, &xyz.x, 4);