Overhaul animation queues so the queue is stored as a single encoded string.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user