mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:44:01 +02:00
added population data back for SIMPLE_CHILD_ARRAY implementation
This commit is contained in:
parent
b792d01511
commit
87a44bafc9
1 changed files with 11 additions and 0 deletions
|
@ -690,12 +690,23 @@ void VoxelNode::deleteAllChildren() {
|
|||
|
||||
void VoxelNode::setChildAtIndex(int childIndex, VoxelNode* child) {
|
||||
#ifdef SIMPLE_CHILD_ARRAY
|
||||
int previousChildCount = getChildCount();
|
||||
if (child) {
|
||||
setAtBit(_childBitmask, childIndex);
|
||||
} else {
|
||||
clearAtBit(_childBitmask, childIndex);
|
||||
}
|
||||
int newChildCount = getChildCount();
|
||||
|
||||
// store the child in our child array
|
||||
_simpleChildArray[childIndex] = child;
|
||||
|
||||
// track our population data
|
||||
if (previousChildCount != newChildCount) {
|
||||
_childrenCount[previousChildCount]--;
|
||||
_childrenCount[newChildCount]++;
|
||||
}
|
||||
|
||||
#else
|
||||
PerformanceWarning warn(false,"setChildAtIndex",false,&_setChildAtIndexTime,&_setChildAtIndexCalls);
|
||||
|
||||
|
|
Loading…
Reference in a new issue