History

namechange entitiesToSend --> entitiesInQueue

Andrew Meadows committed 9 years ago

Commit d54fa201 parent cbf82a62 files · +15 −15Browse files

Showing the changes to assignment-client/src/entities/EntityTreeSendThread.cpp (1 of 2 files). Show all

Unified · Split

assignment-client/src/entities/EntityTreeSendThread.cpp+14−14
@@ -101,7 +101,7 @@ void EntityTreeSendThread::traverseTreeAndSendContents(SharedNodePointer node, O · 100 unmodified lines
101101 if (!_sendQueue.empty()) {
102102 EntityPriorityQueue prevSendQueue;
103103 _sendQueue.swap(prevSendQueue);
104− _entitiesToSend.clear();
104+ _entitiesInQueue.clear();
105105 // Re-add elements from previous traversal if they still need to be sent
106106 while (!prevSendQueue.empty()) {
107107 EntityItemPointer entity = prevSendQueue.top().getEntity();
@@ -122,14 +122,14 @@ void EntityTreeSendThread::traverseTreeAndSendContents(SharedNodePointer node, O · 14 unmodified lines
122122 // Only send entities if they are large enough to see
123123 if (renderAccuracy > 0.0f) {
124124 _sendQueue.push(PrioritizedEntity(entity, priority));
125− _entitiesToSend.insert(entity.get());
125+ _entitiesInQueue.insert(entity.get());
126126 }
127127 }
128128 }
129129 } else {
130130 const float WHEN_IN_DOUBT_PRIORITY = 1.0f;
131131 _sendQueue.push(PrioritizedEntity(entity, WHEN_IN_DOUBT_PRIORITY));
132− _entitiesToSend.insert(entity.get());
132+ _entitiesInQueue.insert(entity.get());
133133 }
134134 }
135135 }
@@ -161,7 +161,7 @@ void EntityTreeSendThread::traverseTreeAndSendContents(SharedNodePointer node, O · 25 unmodified lines
161161 std::cout << "adebug send '" << entity->getName().toStdString() << "'" << " : " << entry.getPriority() << std::endl; // adebug
162162 }
163163 _sendQueue.pop();
164− _entitiesToSend.erase(entry.getRawEntityPointer());
164+ _entitiesInQueue.erase(entry.getRawEntityPointer());
165165 }
166166 }
167167 #endif // SEND_SORTED_ENTITIES
@@ -239,7 +239,7 @@ void EntityTreeSendThread::startNewTraversal(const ViewFrustum& view, EntityTree · 71 unmodified lines
239239 _traversal.setScanCallback([&] (DiffTraversal::VisibleElement& next) {
240240 next.element->forEachEntity([&](EntityItemPointer entity) {
241241 // Bail early if we've already checked this entity this frame
242− if (_entitiesToSend.find(entity.get()) != _entitiesToSend.end()) {
242+ if (_entitiesInQueue.find(entity.get()) != _entitiesInQueue.end()) {
243243 return;
244244 }
245245 bool success = false;
@@ -259,13 +259,13 @@ void EntityTreeSendThread::startNewTraversal(const ViewFrustum& view, EntityTree · 13 unmodified lines
259259 if (renderAccuracy > 0.0f) {
260260 float priority = _conicalView.computePriority(cube);
261261 _sendQueue.push(PrioritizedEntity(entity, priority));
262− _entitiesToSend.insert(entity.get());
262+ _entitiesInQueue.insert(entity.get());
263263 }
264264 }
265265 } else {
266266 const float WHEN_IN_DOUBT_PRIORITY = 1.0f;
267267 _sendQueue.push(PrioritizedEntity(entity, WHEN_IN_DOUBT_PRIORITY));
268− _entitiesToSend.insert(entity.get());
268+ _entitiesInQueue.insert(entity.get());
269269 }
270270 });
271271 });
@@ -276,7 +276,7 @@ void EntityTreeSendThread::startNewTraversal(const ViewFrustum& view, EntityTree · 4 unmodified lines
276276 uint64_t timestamp = _traversal.getStartOfCompletedTraversal();
277277 next.element->forEachEntity([&](EntityItemPointer entity) {
278278 // Bail early if we've already checked this entity this frame
279− if (_entitiesToSend.find(entity.get()) != _entitiesToSend.end()) {
279+ if (_entitiesInQueue.find(entity.get()) != _entitiesInQueue.end()) {
280280 return;
281281 }
282282 if (entity->getLastEdited() > timestamp) {
@@ -294,13 +294,13 @@ void EntityTreeSendThread::startNewTraversal(const ViewFrustum& view, EntityTree · 11 unmodified lines
294294 if (renderAccuracy > 0.0f) {
295295 float priority = _conicalView.computePriority(cube);
296296 _sendQueue.push(PrioritizedEntity(entity, priority));
297− _entitiesToSend.insert(entity.get());
297+ _entitiesInQueue.insert(entity.get());
298298 }
299299 }
300300 } else {
301301 const float WHEN_IN_DOUBT_PRIORITY = 1.0f;
302302 _sendQueue.push(PrioritizedEntity(entity, WHEN_IN_DOUBT_PRIORITY));
303− _entitiesToSend.insert(entity.get());
303+ _entitiesInQueue.insert(entity.get());
304304 }
305305 }
306306 });
@@ -314,7 +314,7 @@ void EntityTreeSendThread::startNewTraversal(const ViewFrustum& view, EntityTree · 7 unmodified lines
314314 if (next.element->getLastChangedContent() > timestamp || next.intersection != ViewFrustum::INSIDE) {
315315 next.element->forEachEntity([&](EntityItemPointer entity) {
316316 // Bail early if we've already checked this entity this frame
317− if (_entitiesToSend.find(entity.get()) != _entitiesToSend.end()) {
317+ if (_entitiesInQueue.find(entity.get()) != _entitiesInQueue.end()) {
318318 return;
319319 }
320320 bool success = false;
@@ -332,7 +332,7 @@ void EntityTreeSendThread::startNewTraversal(const ViewFrustum& view, EntityTree · 11 unmodified lines
332332 if (entity->getLastEdited() > timestamp || !_traversal.getCompletedView().cubeIntersectsKeyhole(cube)) {
333333 float priority = _conicalView.computePriority(cube);
334334 _sendQueue.push(PrioritizedEntity(entity, priority));
335− _entitiesToSend.insert(entity.get());
335+ _entitiesInQueue.insert(entity.get());
336336 } else {
337337 // If this entity was skipped last time because it was too small, we still need to send it
338338 float lastRenderAccuracy = calculateRenderAccuracy(_traversal.getCompletedView().getPosition(),
@@ -343,7 +343,7 @@ void EntityTreeSendThread::startNewTraversal(const ViewFrustum& view, EntityTree · 4 unmodified lines
343343 if (lastRenderAccuracy <= 0.0f) {
344344 float priority = _conicalView.computePriority(cube);
345345 _sendQueue.push(PrioritizedEntity(entity, priority));
346− _entitiesToSend.insert(entity.get());
346+ _entitiesInQueue.insert(entity.get());
347347 }
348348 }
349349 }
@@ -351,7 +351,7 @@ void EntityTreeSendThread::startNewTraversal(const ViewFrustum& view, EntityTree · 1 unmodified line
351351 } else {
352352 const float WHEN_IN_DOUBT_PRIORITY = 1.0f;
353353 _sendQueue.push(PrioritizedEntity(entity, WHEN_IN_DOUBT_PRIORITY));
354− _entitiesToSend.insert(entity.get());
354+ _entitiesInQueue.insert(entity.get());
355355 }
356356 });
357357 }