mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 23:30:31 +02:00
cr cleanup
This commit is contained in:
parent
747cfc04be
commit
7fddd63a61
2 changed files with 20 additions and 25 deletions
|
@ -157,15 +157,9 @@ void eraseVoxelTreeAndCleanupAgentVisitData() {
|
|||
|
||||
// As our tree to erase all it's voxels
|
||||
::randomTree.eraseAllVoxels();
|
||||
|
||||
// enumerate the agents clean up their marker nodes
|
||||
|
||||
for (AgentList::iterator agent = AgentList::getInstance()->begin(); agent != AgentList::getInstance()->end(); agent++) {
|
||||
|
||||
//printf("eraseVoxelTreeAndCleanupAgentVisitData() agent[%d]\n",i);
|
||||
|
||||
VoxelAgentData* agentData = (VoxelAgentData *)agent->getLinkedData();
|
||||
|
||||
VoxelAgentData* agentData = (VoxelAgentData*) agent->getLinkedData();
|
||||
if (agentData) {
|
||||
// clean up the agent visit data
|
||||
agentData->nodeBag.deleteAll();
|
||||
|
@ -229,7 +223,7 @@ void voxelDistributeHelper(AgentList* agentList, AgentList::iterator& agent, Vox
|
|||
|
||||
// If we have something in our nodeBag, then turn them into packets and send them out...
|
||||
if (!agentData->nodeBag.isEmpty()) {
|
||||
static unsigned char tempOutputBuffer[MAX_VOXEL_PACKET_SIZE-1]; // save on allocs by making this static
|
||||
static unsigned char tempOutputBuffer[MAX_VOXEL_PACKET_SIZE - 1]; // save on allocs by making this static
|
||||
int bytesWritten = 0;
|
||||
|
||||
// NOTE: we can assume the voxelPacket has already been set up with a "V"
|
||||
|
@ -242,7 +236,8 @@ void voxelDistributeHelper(AgentList* agentList, AgentList::iterator& agent, Vox
|
|||
// Only let this guy create at largest packets equal to the amount of space we have left in our final???
|
||||
// Or let it create the largest possible size (minus 1 for the "V")
|
||||
bytesWritten = randomTree.encodeTreeBitstream(agentData->getMaxSearchLevel(), subTree, viewFrustum,
|
||||
&tempOutputBuffer[0], MAX_VOXEL_PACKET_SIZE-1, agentData->nodeBag);
|
||||
&tempOutputBuffer[0], MAX_VOXEL_PACKET_SIZE - 1,
|
||||
agentData->nodeBag);
|
||||
|
||||
// if we have room in our final packet, add this buffer to the final packet
|
||||
if (agentData->getAvailable() >= bytesWritten) {
|
||||
|
@ -302,7 +297,7 @@ void *distributeVoxelsToListeners(void *args) {
|
|||
|
||||
// enumerate the agents to send 3 packets to each
|
||||
for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) {
|
||||
VoxelAgentData* agentData = (VoxelAgentData *)agent->getLinkedData();
|
||||
VoxelAgentData* agentData = (VoxelAgentData*) agent->getLinkedData();
|
||||
|
||||
// Sometimes the agent data has not yet been linked, in which case we can't really do anything
|
||||
if (agentData) {
|
||||
|
|
Loading…
Reference in a new issue