mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 18:44:00 +02:00
Merge branch 'protocol' of https://github.com/birarda/hifi into protocol
This commit is contained in:
commit
ca4e2ed274
2 changed files with 4 additions and 4 deletions
|
@ -588,7 +588,7 @@ void ScriptEngine::run() {
|
|||
const int SCRIPT_AUDIO_BUFFER_BYTES = SCRIPT_AUDIO_BUFFER_SAMPLES * sizeof(int16_t);
|
||||
|
||||
QByteArray avatarByteArray = _avatarData->toByteArray();
|
||||
auto avatarPacket = NLPacket::create(PacketType::AvatarData);
|
||||
auto avatarPacket = NLPacket::create(PacketType::AvatarData, avatarByteArray.size());
|
||||
|
||||
avatarPacket->write(avatarByteArray);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ template <typename T>
|
|||
class RingBufferHistory {
|
||||
|
||||
public:
|
||||
|
||||
|
||||
RingBufferHistory(int capacity = 10)
|
||||
: _size(capacity + 1),
|
||||
_capacity(capacity),
|
||||
|
@ -53,12 +53,12 @@ public:
|
|||
_numEntries++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// std::unique_ptr need to be passed as an rvalue ref and moved into the vector
|
||||
void insert(T&& entry) {
|
||||
// increment newest entry index cyclically
|
||||
_newestEntryAtIndex = (_newestEntryAtIndex + 1) % _size;
|
||||
|
||||
|
||||
// insert new entry
|
||||
_buffer[_newestEntryAtIndex] = std::move(entry);
|
||||
if (_numEntries < _capacity) {
|
||||
|
|
Loading…
Reference in a new issue