mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 23:36:44 +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);
|
const int SCRIPT_AUDIO_BUFFER_BYTES = SCRIPT_AUDIO_BUFFER_SAMPLES * sizeof(int16_t);
|
||||||
|
|
||||||
QByteArray avatarByteArray = _avatarData->toByteArray();
|
QByteArray avatarByteArray = _avatarData->toByteArray();
|
||||||
auto avatarPacket = NLPacket::create(PacketType::AvatarData);
|
auto avatarPacket = NLPacket::create(PacketType::AvatarData, avatarByteArray.size());
|
||||||
|
|
||||||
avatarPacket->write(avatarByteArray);
|
avatarPacket->write(avatarByteArray);
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ template <typename T>
|
||||||
class RingBufferHistory {
|
class RingBufferHistory {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
RingBufferHistory(int capacity = 10)
|
RingBufferHistory(int capacity = 10)
|
||||||
: _size(capacity + 1),
|
: _size(capacity + 1),
|
||||||
_capacity(capacity),
|
_capacity(capacity),
|
||||||
|
@ -53,12 +53,12 @@ public:
|
||||||
_numEntries++;
|
_numEntries++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// std::unique_ptr need to be passed as an rvalue ref and moved into the vector
|
// std::unique_ptr need to be passed as an rvalue ref and moved into the vector
|
||||||
void insert(T&& entry) {
|
void insert(T&& entry) {
|
||||||
// increment newest entry index cyclically
|
// increment newest entry index cyclically
|
||||||
_newestEntryAtIndex = (_newestEntryAtIndex + 1) % _size;
|
_newestEntryAtIndex = (_newestEntryAtIndex + 1) % _size;
|
||||||
|
|
||||||
// insert new entry
|
// insert new entry
|
||||||
_buffer[_newestEntryAtIndex] = std::move(entry);
|
_buffer[_newestEntryAtIndex] = std::move(entry);
|
||||||
if (_numEntries < _capacity) {
|
if (_numEntries < _capacity) {
|
||||||
|
|
Loading…
Reference in a new issue