diff xmit of animation queues. Also, StreamBuffer::unwrite_to

This commit is contained in:
2021-07-13 15:18:37 -04:00
parent 3fc76afc09
commit 1904f03dad
4 changed files with 260 additions and 51 deletions

View File

@@ -290,6 +290,12 @@ void StreamBuffer::unread_to(int64_t rd_count) {
read_cursor_ = buf_lo_ + (rd_count - pre_read_count_);
}
void StreamBuffer::unwrite_to(int64_t wr_count) {
assert(wr_count >= read_count());
assert(wr_count <= write_count());
write_cursor_ = buf_lo_ + (wr_count - pre_read_count_);
}
int StreamBuffer::lua_writer(lua_State *L, const void* p, size_t sz, void* ud) {
StreamBuffer *sb = (StreamBuffer *)ud;
sb->write_bytes((const char *)p, sz);