mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 19:15:56 +02:00
Start out with gray, fix coloring smaller portions by (similar to deleting)
breaking up leaf nodes into their components.
This commit is contained in:
parent
4eced82cf4
commit
ebc612f87a
2 changed files with 10 additions and 2 deletions
|
@ -1093,7 +1093,9 @@ void Application::initMenu() {
|
||||||
(_logOn = toolsMenu->addAction("Log"))->setCheckable(true);
|
(_logOn = toolsMenu->addAction("Log"))->setCheckable(true);
|
||||||
_logOn->setChecked(true);
|
_logOn->setChecked(true);
|
||||||
_voxelPaintColor = toolsMenu->addAction("Voxel Paint Color", this, SLOT(chooseVoxelPaintColor()), Qt::Key_7);
|
_voxelPaintColor = toolsMenu->addAction("Voxel Paint Color", this, SLOT(chooseVoxelPaintColor()), Qt::Key_7);
|
||||||
_voxelPaintColor->setIcon(createSwatchIcon(QColor()));
|
QColor paintColor(128, 128, 128);
|
||||||
|
_voxelPaintColor->setData(paintColor);
|
||||||
|
_voxelPaintColor->setIcon(createSwatchIcon(paintColor));
|
||||||
|
|
||||||
QMenu* frustumMenu = menuBar->addMenu("Frustum");
|
QMenu* frustumMenu = menuBar->addMenu("Frustum");
|
||||||
(_frustumOn = frustumMenu->addAction("Display Frustum"))->setCheckable(true);
|
(_frustumOn = frustumMenu->addAction("Display Frustum"))->setCheckable(true);
|
||||||
|
|
|
@ -103,7 +103,13 @@ VoxelNode* VoxelTree::createMissingNode(VoxelNode* lastParentNode, unsigned char
|
||||||
int indexOfNewChild = branchIndexWithDescendant(lastParentNode->getOctalCode(), codeToReach);
|
int indexOfNewChild = branchIndexWithDescendant(lastParentNode->getOctalCode(), codeToReach);
|
||||||
|
|
||||||
// we could be coming down a branch that was already created, so don't stomp on it.
|
// we could be coming down a branch that was already created, so don't stomp on it.
|
||||||
if (!lastParentNode->getChildAtIndex(indexOfNewChild)) {
|
if (lastParentNode->isLeaf() && lastParentNode->isColored()) {
|
||||||
|
// for colored leaves, we must add *all* the children
|
||||||
|
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||||
|
lastParentNode->addChildAtIndex(i);
|
||||||
|
lastParentNode->getChildAtIndex(i)->setColor(lastParentNode->getColor());
|
||||||
|
}
|
||||||
|
} else if (!lastParentNode->getChildAtIndex(indexOfNewChild)) {
|
||||||
lastParentNode->addChildAtIndex(indexOfNewChild);
|
lastParentNode->addChildAtIndex(indexOfNewChild);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue