mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 17:35:45 +02:00
got rid of redundant getTree()
This commit is contained in:
parent
76ad42015a
commit
100439784d
3 changed files with 6 additions and 8 deletions
|
@ -117,7 +117,7 @@ int VoxelSendThread::handlePacketSend(Node* node, VoxelNodeData* nodeData, int&
|
||||||
/// Version of voxel distributor that sends the deepest LOD level at once
|
/// Version of voxel distributor that sends the deepest LOD level at once
|
||||||
int VoxelSendThread::deepestLevelVoxelDistributor(Node* node, VoxelNodeData* nodeData, bool viewFrustumChanged) {
|
int VoxelSendThread::deepestLevelVoxelDistributor(Node* node, VoxelNodeData* nodeData, bool viewFrustumChanged) {
|
||||||
|
|
||||||
_myServer->getTree()->lockForRead();
|
_myServer->getServerTree().lockForRead();
|
||||||
|
|
||||||
int truePacketsSent = 0;
|
int truePacketsSent = 0;
|
||||||
int trueBytesSent = 0;
|
int trueBytesSent = 0;
|
||||||
|
@ -360,7 +360,7 @@ int VoxelSendThread::deepestLevelVoxelDistributor(Node* node, VoxelNodeData* nod
|
||||||
|
|
||||||
} // end if bag wasn't empty, and so we sent stuff...
|
} // end if bag wasn't empty, and so we sent stuff...
|
||||||
|
|
||||||
_myServer->getTree()->unlock();
|
_myServer->getServerTree().unlock();
|
||||||
|
|
||||||
return truePacketsSent;
|
return truePacketsSent;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,8 +48,6 @@ public:
|
||||||
VoxelTree& getServerTree() { return _serverTree; }
|
VoxelTree& getServerTree() { return _serverTree; }
|
||||||
JurisdictionMap* getJurisdiction() { return _jurisdiction; }
|
JurisdictionMap* getJurisdiction() { return _jurisdiction; }
|
||||||
|
|
||||||
VoxelTree* getTree() { return &_serverTree; }
|
|
||||||
|
|
||||||
int getPacketsPerClientPerInterval() const { return _packetsPerClientPerInterval; }
|
int getPacketsPerClientPerInterval() const { return _packetsPerClientPerInterval; }
|
||||||
bool getSendMinimalEnvironment() const { return _sendMinimalEnvironment; }
|
bool getSendMinimalEnvironment() const { return _sendMinimalEnvironment; }
|
||||||
EnvironmentData* getEnvironmentData(int i) { return &_environmentData[i]; }
|
EnvironmentData* getEnvironmentData(int i) { return &_environmentData[i]; }
|
||||||
|
|
|
@ -86,9 +86,9 @@ void VoxelServerPacketProcessor::processPacket(sockaddr& senderAddress, unsigned
|
||||||
delete[] vertices;
|
delete[] vertices;
|
||||||
}
|
}
|
||||||
|
|
||||||
_myServer->getTree()->lockForWrite();
|
_myServer->getServerTree().lockForWrite();
|
||||||
_myServer->getServerTree().readCodeColorBufferToTree(voxelData, destructive);
|
_myServer->getServerTree().readCodeColorBufferToTree(voxelData, destructive);
|
||||||
_myServer->getTree()->unlock();
|
_myServer->getServerTree().unlock();
|
||||||
|
|
||||||
// skip to next voxel edit record in the packet
|
// skip to next voxel edit record in the packet
|
||||||
voxelData += voxelDataSize;
|
voxelData += voxelDataSize;
|
||||||
|
@ -114,9 +114,9 @@ void VoxelServerPacketProcessor::processPacket(sockaddr& senderAddress, unsigned
|
||||||
} else if (packetData[0] == PACKET_TYPE_ERASE_VOXEL) {
|
} else if (packetData[0] == PACKET_TYPE_ERASE_VOXEL) {
|
||||||
|
|
||||||
// Send these bits off to the VoxelTree class to process them
|
// Send these bits off to the VoxelTree class to process them
|
||||||
_myServer->getTree()->lockForWrite();
|
_myServer->getServerTree().lockForWrite();
|
||||||
_myServer->getServerTree().processRemoveVoxelBitstream((unsigned char*)packetData, packetLength);
|
_myServer->getServerTree().processRemoveVoxelBitstream((unsigned char*)packetData, packetLength);
|
||||||
_myServer->getTree()->unlock();
|
_myServer->getServerTree().unlock();
|
||||||
|
|
||||||
// Make sure our Node and NodeList knows we've heard from this node.
|
// Make sure our Node and NodeList knows we've heard from this node.
|
||||||
Node* node = NodeList::getInstance()->nodeWithAddress(&senderAddress);
|
Node* node = NodeList::getInstance()->nodeWithAddress(&senderAddress);
|
||||||
|
|
Loading…
Reference in a new issue