Remove debugging, fix streaming bug.

This commit is contained in:
Andrzej Kapolka 2014-10-27 14:45:34 -07:00
parent 5af52df558
commit 15f8b3006b
3 changed files with 4 additions and 12 deletions

View file

@ -223,11 +223,7 @@ void MetavoxelSession::update() {
_sender->getData().writeDelta(sendRecord->getData(), sendRecord->getLOD(), out, _lod);
out.flush();
int end = _sequencer.getOutputStream().getUnderlying().device()->pos();
QDebug debug = qDebug() << "from" << sendRecord->getLOD().position.x << sendRecord->getLOD().position.y << sendRecord->getLOD().position.z << "to" <<
_lod.position.x << _lod.position.y << _lod.position.z << _lodPacketNumber << (_sequencer.getOutgoingPacketNumber() + 1);
if (end > _sequencer.getMaxPacketSize()) {
debug << "reliable" << (_reliableDeltaID + 1);
// we need to send the delta on the reliable channel
_reliableDeltaChannel = _sequencer.getReliableOutputChannel(RELIABLE_DELTA_CHANNEL_INDEX);
_reliableDeltaChannel->startMessage();
@ -246,7 +242,6 @@ void MetavoxelSession::update() {
_sequencer.endPacket();
} else {
debug << "unreliable";
_sequencer.endPacket();
}

View file

@ -297,10 +297,7 @@ void MetavoxelClient::writeUpdateMessage(Bitstream& out) {
void MetavoxelClient::handleMessage(const QVariant& message, Bitstream& in) {
int userType = message.userType();
if (userType == MetavoxelDeltaMessage::Type) {
if (_reliableDeltaChannel) {
qDebug() << "from" << _remoteDataLOD.position.x << _remoteDataLOD.position.y << _remoteDataLOD.position.z <<
"to" << _reliableDeltaLOD.position.x << _reliableDeltaLOD.position.y << _reliableDeltaLOD.position.z <<
_sequencer.getIncomingPacketNumber() << "reliable" << _reliableDeltaID;
if (_reliableDeltaChannel) {
MetavoxelData reference = _remoteData;
MetavoxelLOD referenceLOD = _remoteDataLOD;
_remoteData.readDelta(reference, referenceLOD, in, _remoteDataLOD = _reliableDeltaLOD);
@ -310,9 +307,6 @@ void MetavoxelClient::handleMessage(const QVariant& message, Bitstream& in) {
} else {
PacketRecord* receiveRecord = getLastAcknowledgedReceiveRecord();
qDebug() << "from" << receiveRecord->getLOD().position.x << receiveRecord->getLOD().position.y << receiveRecord->getLOD().position.z <<
"to" << getLastAcknowledgedSendRecord()->getLOD().position.x << getLastAcknowledgedSendRecord()->getLOD().position.y << getLastAcknowledgedSendRecord()->getLOD().position.z <<
_sequencer.getIncomingPacketNumber() << "unreliable";
_remoteData.readDelta(receiveRecord->getData(), receiveRecord->getLOD(), in,
_remoteDataLOD = getLastAcknowledgedSendRecord()->getLOD());
in.reset();

View file

@ -1040,6 +1040,9 @@ MetavoxelNode* MetavoxelNode::readSubdivision(MetavoxelStreamState& state) {
}
void MetavoxelNode::writeSubdivision(MetavoxelStreamState& state) const {
if (!state.shouldSubdivide()) {
return;
}
bool leaf = isLeaf();
if (!state.shouldSubdivideReference()) {
state.base.stream << leaf;