mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 15:33:10 +02:00
some cleanup pre CR
This commit is contained in:
parent
9fb57feb3b
commit
f5808f43b5
2 changed files with 8 additions and 8 deletions
|
@ -212,7 +212,7 @@ int VoxelSystem::newTreeToArrays(VoxelNode* node) {
|
|||
}
|
||||
node->setShouldRender(shouldRender);
|
||||
// let children figure out their renderness
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||
if (node->getChildAtIndex(i)) {
|
||||
voxelsUpdated += newTreeToArrays(node->getChildAtIndex(i));
|
||||
}
|
||||
|
@ -595,7 +595,7 @@ bool VoxelSystem::removeOutOfViewOperation(VoxelNode* node, void* extraData) {
|
|||
VoxelSystem* thisVoxelSystem = (VoxelSystem*) extraData;
|
||||
_nodeCount++;
|
||||
// Need to operate on our child nodes, so we can remove them
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||
VoxelNode* childNode = node->getChildAtIndex(i);
|
||||
if (childNode && !childNode->isInView(*thisVoxelSystem->_viewFrustum)) {
|
||||
node->removeChildAtIndex(i);
|
||||
|
|
|
@ -37,7 +37,7 @@ void VoxelNode::init(unsigned char * octalCode) {
|
|||
#endif
|
||||
|
||||
// default pointers to child nodes to NULL
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||
_children[i] = NULL;
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ VoxelNode::~VoxelNode() {
|
|||
delete[] _octalCode;
|
||||
|
||||
// delete all of this node's children
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||
if (_children[i]) {
|
||||
delete _children[i];
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ void VoxelNode::addChildAtIndex(int childIndex) {
|
|||
// will average the child colors...
|
||||
void VoxelNode::setColorFromAverageOfChildren() {
|
||||
int colorArray[4] = {0,0,0,0};
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||
if (_children[i] && _children[i]->isColored()) {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
colorArray[j] += _children[i]->getTrueColor()[j]; // color averaging should always be based on true colors
|
||||
|
@ -194,7 +194,7 @@ bool VoxelNode::collapseIdenticalLeaves() {
|
|||
// scan children, verify that they are ALL present and accounted for
|
||||
bool allChildrenMatch = true; // assume the best (ottimista)
|
||||
int red,green,blue;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||
// if no child, or child doesn't have a color
|
||||
if (!_children[i] || !_children[i]->isColored()) {
|
||||
allChildrenMatch=false;
|
||||
|
@ -216,7 +216,7 @@ bool VoxelNode::collapseIdenticalLeaves() {
|
|||
|
||||
if (allChildrenMatch) {
|
||||
//printLog("allChildrenMatch: pruning tree\n");
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||
delete _children[i]; // delete all the child nodes
|
||||
_children[i]=NULL; // set it to NULL
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ void VoxelNode::setRandomColor(int minimumBrightness) {
|
|||
}
|
||||
|
||||
bool VoxelNode::isLeaf() const {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||
if (_children[i]) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue