CR feedback and warning fixes

This commit is contained in:
ZappoMan 2014-09-02 18:43:16 -07:00
parent 9fa087571b
commit a555eeda23
4 changed files with 7 additions and 9 deletions

View file

@ -244,20 +244,17 @@ void Agent::run() {
_scriptEngine.registerGlobalObject("VoxelViewer", &_voxelViewer);
// connect the VoxelViewer and the VoxelScriptingInterface to each other
JurisdictionListener* voxelJL = _scriptEngine.getVoxelsScriptingInterface()->getJurisdictionListener();
_voxelViewer.setJurisdictionListener(voxelJL);
_voxelViewer.setJurisdictionListener(_scriptEngine.getVoxelsScriptingInterface()->getJurisdictionListener());
_voxelViewer.init();
_scriptEngine.getVoxelsScriptingInterface()->setVoxelTree(_voxelViewer.getTree());
_scriptEngine.registerGlobalObject("ParticleViewer", &_particleViewer);
JurisdictionListener* particleJL = _scriptEngine.getParticlesScriptingInterface()->getJurisdictionListener();
_particleViewer.setJurisdictionListener(particleJL);
_particleViewer.setJurisdictionListener(_scriptEngine.getParticlesScriptingInterface()->getJurisdictionListener());
_particleViewer.init();
_scriptEngine.getParticlesScriptingInterface()->setParticleTree(_particleViewer.getTree());
_scriptEngine.registerGlobalObject("EntityViewer", &_entityViewer);
JurisdictionListener* modelJL = _scriptEngine.getEntityScriptingInterface()->getJurisdictionListener();
_entityViewer.setJurisdictionListener(modelJL);
_entityViewer.setJurisdictionListener(_scriptEngine.getEntityScriptingInterface()->getJurisdictionListener());
_entityViewer.init();
_scriptEngine.getEntityScriptingInterface()->setEntityTree(_entityViewer.getTree());

View file

@ -43,7 +43,7 @@ public:
void update();
EntityTree* getTree() { return (EntityTree*)_tree; }
EntityTree* getTree() { return static_cast<EntityTree*>(_tree); }
void processEraseMessage(const QByteArray& dataByteArray, const SharedNodePointer& sourceNode);

View file

@ -100,7 +100,7 @@ bool DeleteEntityOperator::PreRecursion(OctreeElement* element) {
if (entityTreeElement == details.containingElement) {
EntityItemID entityItemID = details.entity->getEntityItemID();
EntityItem* theEntity = entityTreeElement->getEntityWithEntityItemID(entityItemID); // find the actual entity
bool removed = entityTreeElement->removeEntityItem(theEntity); // remove it from the element
entityTreeElement->removeEntityItem(theEntity); // remove it from the element
_tree->setContainingElement(entityItemID, NULL); // update or id to element lookup
delete theEntity; // now actually delete the entity!
_foundCount++;

View file

@ -63,7 +63,8 @@ private:
/// returns a newly constructed (heap allocated) instance of your type. e.g. The following prototype:
// static EntityItem* factory(const EntityItemID& entityID, const EntityItemProperties& properties);
#define REGISTER_ENTITY_TYPE_WITH_FACTORY(x,y) static bool x##Registration = \
EntityTypes::registerEntityType(EntityTypes::x, #x, y);
EntityTypes::registerEntityType(EntityTypes::x, #x, y); \
assert(x##Registration);
#endif // hifi_EntityTypes_h