mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:25:52 +02:00
Merge pull request #1216 from ZappoMan/vs_shutdown_behavior
add menu option for voxel server fade in/out and dont remove local voxels when server shuts down
This commit is contained in:
commit
5118de6fd6
4 changed files with 16 additions and 25 deletions
|
@ -4094,11 +4094,13 @@ void Application::nodeKilled(Node* node) {
|
||||||
rootDetails.x, rootDetails.y, rootDetails.z, rootDetails.s);
|
rootDetails.x, rootDetails.y, rootDetails.z, rootDetails.s);
|
||||||
|
|
||||||
// Add the jurisditionDetails object to the list of "fade outs"
|
// Add the jurisditionDetails object to the list of "fade outs"
|
||||||
VoxelFade fade(VoxelFade::FADE_OUT, NODE_KILLED_RED, NODE_KILLED_GREEN, NODE_KILLED_BLUE);
|
if (!Menu::getInstance()->isOptionChecked(MenuOption::DontFadeOnVoxelServerChanges)) {
|
||||||
fade.voxelDetails = rootDetails;
|
VoxelFade fade(VoxelFade::FADE_OUT, NODE_KILLED_RED, NODE_KILLED_GREEN, NODE_KILLED_BLUE);
|
||||||
const float slightly_smaller = 0.99;
|
fade.voxelDetails = rootDetails;
|
||||||
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
|
const float slightly_smaller = 0.99;
|
||||||
_voxelFades.push_back(fade);
|
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
|
||||||
|
_voxelFades.push_back(fade);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (node->getLinkedData() == _lookatTargetAvatar) {
|
} else if (node->getLinkedData() == _lookatTargetAvatar) {
|
||||||
_lookatTargetAvatar = NULL;
|
_lookatTargetAvatar = NULL;
|
||||||
|
@ -4127,11 +4129,13 @@ int Application::parseVoxelStats(unsigned char* messageData, ssize_t messageLeng
|
||||||
rootDetails.x, rootDetails.y, rootDetails.z, rootDetails.s);
|
rootDetails.x, rootDetails.y, rootDetails.z, rootDetails.s);
|
||||||
|
|
||||||
// Add the jurisditionDetails object to the list of "fade outs"
|
// Add the jurisditionDetails object to the list of "fade outs"
|
||||||
VoxelFade fade(VoxelFade::FADE_OUT, NODE_ADDED_RED, NODE_ADDED_GREEN, NODE_ADDED_BLUE);
|
if (!Menu::getInstance()->isOptionChecked(MenuOption::DontFadeOnVoxelServerChanges)) {
|
||||||
fade.voxelDetails = rootDetails;
|
VoxelFade fade(VoxelFade::FADE_OUT, NODE_ADDED_RED, NODE_ADDED_GREEN, NODE_ADDED_BLUE);
|
||||||
const float slightly_smaller = 0.99;
|
fade.voxelDetails = rootDetails;
|
||||||
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
|
const float slightly_smaller = 0.99;
|
||||||
_voxelFades.push_back(fade);
|
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
|
||||||
|
_voxelFades.push_back(fade);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// store jurisdiction details for later use
|
// store jurisdiction details for later use
|
||||||
// This is bit of fiddling is because JurisdictionMap assumes it is the owner of the values used to construct it
|
// This is bit of fiddling is because JurisdictionMap assumes it is the owner of the values used to construct it
|
||||||
|
|
|
@ -283,6 +283,7 @@ Menu::Menu() :
|
||||||
|
|
||||||
addCheckableActionToQMenuAndActionHash(voxelOptionsMenu, MenuOption::VoxelTextures);
|
addCheckableActionToQMenuAndActionHash(voxelOptionsMenu, MenuOption::VoxelTextures);
|
||||||
addCheckableActionToQMenuAndActionHash(voxelOptionsMenu, MenuOption::AmbientOcclusion);
|
addCheckableActionToQMenuAndActionHash(voxelOptionsMenu, MenuOption::AmbientOcclusion);
|
||||||
|
addCheckableActionToQMenuAndActionHash(voxelOptionsMenu, MenuOption::DontFadeOnVoxelServerChanges);
|
||||||
addActionToQMenuAndActionHash(voxelOptionsMenu, MenuOption::LodTools, Qt::SHIFT | Qt::Key_L, this, SLOT(lodTools()));
|
addActionToQMenuAndActionHash(voxelOptionsMenu, MenuOption::LodTools, Qt::SHIFT | Qt::Key_L, this, SLOT(lodTools()));
|
||||||
|
|
||||||
QMenu* cullingOptionsMenu = voxelOptionsMenu->addMenu("Culling Options");
|
QMenu* cullingOptionsMenu = voxelOptionsMenu->addMenu("Culling Options");
|
||||||
|
|
|
@ -165,6 +165,7 @@ namespace MenuOption {
|
||||||
const QString EchoAudio = "Echo Audio";
|
const QString EchoAudio = "Echo Audio";
|
||||||
const QString ExportVoxels = "Export Voxels";
|
const QString ExportVoxels = "Export Voxels";
|
||||||
const QString ExtraDebugging = "Extra Debugging";
|
const QString ExtraDebugging = "Extra Debugging";
|
||||||
|
const QString DontFadeOnVoxelServerChanges = "Don't Fade In/Out on Voxel Server Changes";
|
||||||
const QString HeadMouse = "Head Mouse";
|
const QString HeadMouse = "Head Mouse";
|
||||||
const QString FaceMode = "Cycle Face Mode";
|
const QString FaceMode = "Cycle Face Mode";
|
||||||
const QString FaceshiftTCP = "Faceshift (TCP)";
|
const QString FaceshiftTCP = "Faceshift (TCP)";
|
||||||
|
|
|
@ -2645,23 +2645,8 @@ bool VoxelSystem::killSourceVoxelsOperation(VoxelNode* node, void* extraData) {
|
||||||
void VoxelSystem::nodeKilled(Node* node) {
|
void VoxelSystem::nodeKilled(Node* node) {
|
||||||
if (node->getType() == NODE_TYPE_VOXEL_SERVER) {
|
if (node->getType() == NODE_TYPE_VOXEL_SERVER) {
|
||||||
_voxelServerCount--;
|
_voxelServerCount--;
|
||||||
|
|
||||||
QUuid nodeUUID = node->getUUID();
|
QUuid nodeUUID = node->getUUID();
|
||||||
|
|
||||||
qDebug("VoxelSystem... voxel server %s removed...\n", nodeUUID.toString().toLocal8Bit().constData());
|
qDebug("VoxelSystem... voxel server %s removed...\n", nodeUUID.toString().toLocal8Bit().constData());
|
||||||
|
|
||||||
if (_voxelServerCount > 0) {
|
|
||||||
// Kill any voxels from the local tree that match this nodeID
|
|
||||||
// commenting out for removal of 16 bit node IDs
|
|
||||||
lockTree();
|
|
||||||
_tree->recurseTreeWithOperation(killSourceVoxelsOperation, &nodeUUID);
|
|
||||||
unlockTree();
|
|
||||||
_tree->setDirtyBit();
|
|
||||||
setupNewVoxelsForDrawing();
|
|
||||||
} else {
|
|
||||||
// Last server, take the easy way and kill all the local voxels!
|
|
||||||
killLocalVoxels();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue