mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 16:13:28 +02:00
Merge pull request #1924 from ey6es/metavoxels
Changes from Philip's code review.
This commit is contained in:
commit
eaa05df9f7
11 changed files with 17 additions and 10 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <QtDebug>
|
||||
|
||||
#include <RegisteredMetaTypes.h>
|
||||
#include <SharedUtil.h>
|
||||
|
||||
#include "AttributeRegistry.h"
|
||||
#include "Bitstream.h"
|
||||
|
@ -96,7 +97,6 @@ Bitstream::Bitstream(QDataStream& underlying, QObject* parent) :
|
|||
_sharedObjectStreamer(*this) {
|
||||
}
|
||||
|
||||
const int BITS_IN_BYTE = 8;
|
||||
const int LAST_BIT_POSITION = BITS_IN_BYTE - 1;
|
||||
|
||||
Bitstream& Bitstream::write(const void* data, int bits, int offset) {
|
||||
|
|
|
@ -10,10 +10,13 @@
|
|||
|
||||
#include <QtDebug>
|
||||
|
||||
#include <SharedUtil.h>
|
||||
|
||||
#include "DatagramSequencer.h"
|
||||
#include "MetavoxelMessages.h"
|
||||
|
||||
const int MAX_DATAGRAM_SIZE = 1500;
|
||||
// in sequencer parlance, a "packet" may consist of multiple datagrams. clarify when we refer to actual datagrams
|
||||
const int MAX_DATAGRAM_SIZE = MAX_PACKET_SIZE;
|
||||
|
||||
const int DEFAULT_MAX_PACKET_SIZE = 3000;
|
||||
|
||||
|
@ -515,7 +518,8 @@ void ReliableChannel::readData(QDataStream& in) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: better way of pruning buffer?
|
||||
// when the read head is sufficiently advanced into the buffer, prune it off. this along
|
||||
// with other buffer usages should be replaced with a circular buffer
|
||||
const int PRUNE_SIZE = 8192;
|
||||
if (_buffer.pos() > PRUNE_SIZE) {
|
||||
_buffer.buffer() = _buffer.buffer().right(_buffer.size() - _buffer.pos());
|
||||
|
|
|
@ -224,4 +224,4 @@ private:
|
|||
static quint64 _totalBytesOfRawData;
|
||||
};
|
||||
|
||||
#endif /* defined(__hifi__OctreePacketData__) */
|
||||
#endif /* defined(__hifi__OctreePacketData__) */
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include <NodeList.h>
|
||||
#include <SharedUtil.h>
|
||||
#include "JurisdictionMap.h"
|
||||
|
||||
#define GREENISH 0x40ff40d0
|
||||
|
|
|
@ -126,4 +126,4 @@ void Logging::verboseMessageHandler(QtMsgType type, const QMessageLogContext& co
|
|||
}
|
||||
|
||||
fprintf(stdout, "%s %s\n", prefixString.toLocal8Bit().constData(), message.toLocal8Bit().constData());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,4 +48,4 @@ NetworkPacket& NetworkPacket::operator=(NetworkPacket&& other) {
|
|||
copyContents(other.getAddress(), other.getByteArray());
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "HifiSockAddr.h"
|
||||
|
||||
#include "NodeList.h" // for MAX_PACKET_SIZE
|
||||
#include "SharedUtil.h" // for MAX_PACKET_SIZE
|
||||
|
||||
/// Storage of not-yet processed inbound, or not yet sent outbound generic UDP network packet
|
||||
class NetworkPacket {
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
|
||||
#include "Node.h"
|
||||
|
||||
const int MAX_PACKET_SIZE = 1500;
|
||||
|
||||
const quint64 NODE_SILENCE_THRESHOLD_USECS = 2 * 1000 * 1000;
|
||||
const quint64 DOMAIN_SERVER_CHECK_IN_USECS = 1 * 1000000;
|
||||
const quint64 PING_INACTIVE_NODE_INTERVAL_USECS = 1 * 1000 * 1000;
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include <string.h>
|
||||
#include <QString>
|
||||
|
||||
const int BITS_IN_BYTE = 8;
|
||||
const int BITS_IN_OCTAL = 3;
|
||||
const int NUMBER_OF_COLORS = 3; // RGB!
|
||||
const int SIZE_OF_COLOR_DATA = NUMBER_OF_COLORS * sizeof(unsigned char); // size in bytes
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include "GenericThread.h"
|
||||
#include "NetworkPacket.h"
|
||||
#include "NodeList.h"
|
||||
#include "SharedUtil.h"
|
||||
|
||||
/// Generalized threaded processor for queueing and sending of outbound packets.
|
||||
|
|
|
@ -61,6 +61,10 @@ static const quint64 USECS_PER_MSEC = 1000;
|
|||
static const quint64 MSECS_PER_SECOND = 1000;
|
||||
static const quint64 USECS_PER_SECOND = USECS_PER_MSEC * MSECS_PER_SECOND;
|
||||
|
||||
const int BITS_IN_BYTE = 8;
|
||||
|
||||
const int MAX_PACKET_SIZE = 1500;
|
||||
|
||||
quint64 usecTimestamp(const timeval *time);
|
||||
quint64 usecTimestampNow();
|
||||
void usecTimestampNowForceClockSkew(int clockSkew);
|
||||
|
|
Loading…
Reference in a new issue