Merge branch 'master' of https://github.com/worklist/hifi into bugfixes

This commit is contained in:
ZappoMan 2013-11-07 15:52:29 -08:00
commit afaa448f92
9 changed files with 30 additions and 34 deletions

View file

@ -4094,11 +4094,13 @@ void Application::nodeKilled(Node* node) {
rootDetails.x, rootDetails.y, rootDetails.z, rootDetails.s);
// Add the jurisditionDetails object to the list of "fade outs"
VoxelFade fade(VoxelFade::FADE_OUT, NODE_KILLED_RED, NODE_KILLED_GREEN, NODE_KILLED_BLUE);
fade.voxelDetails = rootDetails;
const float slightly_smaller = 0.99;
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
_voxelFades.push_back(fade);
if (!Menu::getInstance()->isOptionChecked(MenuOption::DontFadeOnVoxelServerChanges)) {
VoxelFade fade(VoxelFade::FADE_OUT, NODE_KILLED_RED, NODE_KILLED_GREEN, NODE_KILLED_BLUE);
fade.voxelDetails = rootDetails;
const float slightly_smaller = 0.99;
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
_voxelFades.push_back(fade);
}
}
} else if (node->getLinkedData() == _lookatTargetAvatar) {
_lookatTargetAvatar = NULL;
@ -4127,11 +4129,13 @@ int Application::parseVoxelStats(unsigned char* messageData, ssize_t messageLeng
rootDetails.x, rootDetails.y, rootDetails.z, rootDetails.s);
// Add the jurisditionDetails object to the list of "fade outs"
VoxelFade fade(VoxelFade::FADE_OUT, NODE_ADDED_RED, NODE_ADDED_GREEN, NODE_ADDED_BLUE);
fade.voxelDetails = rootDetails;
const float slightly_smaller = 0.99;
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
_voxelFades.push_back(fade);
if (!Menu::getInstance()->isOptionChecked(MenuOption::DontFadeOnVoxelServerChanges)) {
VoxelFade fade(VoxelFade::FADE_OUT, NODE_ADDED_RED, NODE_ADDED_GREEN, NODE_ADDED_BLUE);
fade.voxelDetails = rootDetails;
const float slightly_smaller = 0.99;
fade.voxelDetails.s = fade.voxelDetails.s * slightly_smaller;
_voxelFades.push_back(fade);
}
}
// 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

View file

@ -283,6 +283,7 @@ Menu::Menu() :
addCheckableActionToQMenuAndActionHash(voxelOptionsMenu, MenuOption::VoxelTextures);
addCheckableActionToQMenuAndActionHash(voxelOptionsMenu, MenuOption::AmbientOcclusion);
addCheckableActionToQMenuAndActionHash(voxelOptionsMenu, MenuOption::DontFadeOnVoxelServerChanges);
addActionToQMenuAndActionHash(voxelOptionsMenu, MenuOption::LodTools, Qt::SHIFT | Qt::Key_L, this, SLOT(lodTools()));
QMenu* cullingOptionsMenu = voxelOptionsMenu->addMenu("Culling Options");

View file

@ -165,6 +165,7 @@ namespace MenuOption {
const QString EchoAudio = "Echo Audio";
const QString ExportVoxels = "Export Voxels";
const QString ExtraDebugging = "Extra Debugging";
const QString DontFadeOnVoxelServerChanges = "Don't Fade In/Out on Voxel Server Changes";
const QString HeadMouse = "Head Mouse";
const QString FaceMode = "Cycle Face Mode";
const QString FaceshiftTCP = "Faceshift (TCP)";

View file

@ -2645,23 +2645,8 @@ bool VoxelSystem::killSourceVoxelsOperation(VoxelNode* node, void* extraData) {
void VoxelSystem::nodeKilled(Node* node) {
if (node->getType() == NODE_TYPE_VOXEL_SERVER) {
_voxelServerCount--;
QUuid nodeUUID = node->getUUID();
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();
}
}
}

View file

@ -255,6 +255,11 @@ Avatar::~Avatar() {
delete _balls;
}
void Avatar::deleteOrDeleteLater() {
this->deleteLater();
}
void Avatar::init() {
_head.init();
_hand.init();

View file

@ -134,6 +134,7 @@ public:
Avatar(Node* owningNode = NULL);
~Avatar();
void deleteOrDeleteLater();
void init();
void simulate(float deltaTime, Transmitter* transmitter);

View file

@ -21,7 +21,6 @@
#include "SharedUtil.h"
#include "UDPSocket.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
Node::Node(const QUuid& uuid, char type, sockaddr* publicSocket, sockaddr* localSocket) :
@ -44,14 +43,8 @@ Node::~Node() {
delete _publicSocket;
delete _localSocket;
if (QCoreApplication::instance()) {
// even if we have a QCoreApplication instance we don't get here unless it's been exec'ed
// which is only currently the case for interface
if (_linkedData) {
_linkedData->deleteLater();
}
} else {
delete _linkedData;
if (_linkedData) {
_linkedData->deleteOrDeleteLater();
}
delete _bytesReceivedMovingAverage;

View file

@ -16,4 +16,8 @@ NodeData::NodeData(Node* owningNode) :
NodeData::~NodeData() {
}
void NodeData::deleteOrDeleteLater() {
delete this;
}

View file

@ -21,6 +21,8 @@ public:
virtual ~NodeData() = 0;
virtual int parseData(unsigned char* sourceBuffer, int numBytes) = 0;
virtual void deleteOrDeleteLater();
Node* getOwningNode() { return _owningNode; }
protected:
Node* _owningNode;