Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 948 vs 949 for /trunk/Source Code/Graphs/SceneGraphNode.cpp

Diff revisions: vs.
  @@ -223,6 +223,27 @@
223 223 return sceneGraphNode;
224 224 }
225 225
226 + void SceneGraphNode::removeNodesByType(SceneNodeType nodeType) {
227 + UpgradableReadLock ur_lock(_childLock);
228 +
229 + U32 childCount = getChildCount();
230 + for (U32 i = 0; i < childCount; ++i) {
231 + if (_children[i]->getNode()->getType() == nodeType) {
232 + {
233 + UpgradeToWriteLock w_lock(ur_lock);
234 + _children[i].reset();
235 + _childCount = _childCount - 1;
236 + std::swap(_children[_childCount], _children[i]);
237 + }
238 + invalidateRelationshipCache();
239 + }
240 + }
241 +
242 + forEachChild([nodeType](SceneGraphNode& child) {
243 + child.removeNodesByType(nodeType);
244 + });
245 + }
246 +
226 247 bool SceneGraphNode::removeNode(SceneGraphNode& node, bool recursive) {
227 248 UpgradableReadLock ur_lock(_childLock);
228 249
  @@ -498,7 +519,7 @@
498 519 }
499 520 }
500 521
501 - return _node->onRender(sceneRenderState, renderStagePass);
522 + return _node->onRender(*this, sceneRenderState, renderStagePass);
502 523 }
503 524
504 525 void SceneGraphNode::onCameraUpdate(const I64 cameraGUID,