void SimGroup::popObject() { MutexHandle handle; handle.lock( mMutex ); if( objectList.empty() ) { AssertWarn( false, "SimGroup::popObject - Stack underflow" ); return; } SimObject* object = objectList.last(); objectList.pop_back(); object->onGroupRemove(); object->mGroup = NULL; clearNotify( object ); mNameDictionary.remove( object ); getSetModificationSignal().trigger( SetObjectAdded, this, object ); if( object->isProperlyAdded() ) onObjectRemoved_callback( object ); object->decRefCount(); }
void Item::setCollisionTimeout(ShapeBase* obj) { if (mCollisionObject) clearNotify(mCollisionObject); deleteNotify(obj); mCollisionObject = obj; mCollisionTimeout = sCollisionTimeout; setMaskBits(ThrowSrcMask); }
afxEA_ParticleEmitter::~afxEA_ParticleEmitter() { if (emitter) { clearNotify(emitter); emitter->deleteWhenEmpty(); emitter = 0; } }
void SceneObject::onUnmount( SceneObject *obj, S32 node ) { clearNotify(obj); if ( !isGhost() ) { setMaskBits( MountedMask ); //onUnmount_callback( node ); } }
void GhostManager::setScopeObject(SimNetObject *obj) { if(obj == scopeObject) return; if(scopeObject) clearNotify(scopeObject); scopeObject = obj; if(scopeObject) deleteNotify(scopeObject); }
void GameBase::onUnmount( SceneObject *obj, S32 node ) { clearNotify(obj); GameBase *gbaseObj = dynamic_cast<GameBase*>( obj ); if ( gbaseObj && gbaseObj->getControlObject() != this ) clearProcessAfter(); if (!isGhost()) { setMaskBits(MountedMask); mDataBlock->onUnmount_callback( this, obj, node ); } }
void Trigger::processTick(const Move* move) { Parent::processTick(move); if (!mDataBlock) return; if (mDataBlock->isClientSide && isServerObject()) return; if (!mDataBlock->isClientSide && isClientObject()) return; // if (mObjects.size() == 0) return; if (mLastThink + mDataBlock->tickPeriodMS < mCurrTick) { mCurrTick = 0; mLastThink = 0; for (S32 i = S32(mObjects.size() - 1); i >= 0; i--) { if (testObject(mObjects[i]) == false) { GameBase* remove = mObjects[i]; mObjects.erase(i); clearNotify(remove); if (!mLeaveCommand.isEmpty()) { String command = String("%obj = ") + remove->getIdString() + ";" + mLeaveCommand; Con::evaluate(command.c_str()); } mDataBlock->onLeaveTrigger_callback( this, remove ); } } if (!mTickCommand.isEmpty()) Con::evaluate(mTickCommand.c_str()); if (mObjects.size() != 0) mDataBlock->onTickTrigger_callback( this ); } else { mCurrTick += TickMs; } }
void GuiControlProfile::setChildrenProfile(GuiControlProfile *prof) { if(prof == mChildrenProfile) return; // Clear the delete notification we previously set up if (mChildrenProfile) clearNotify(mChildrenProfile); mChildrenProfile = prof; // Make sure that the new profile will notify us when it is deleted if (mChildrenProfile) deleteNotify(mChildrenProfile); }
void Turret::unshoot() { AssertFatal(m_pProjectile != NULL, "Error, no projectile?"); m_beganState = wg->currentTime; m_fireState = Reloading; m_pProjectile->shutOffProjectile(); m_pProjectile = NULL; if (m_pTarget != NULL) clearNotify(m_pTarget); m_pTarget = NULL; }
CompoundUndoAction::~CompoundUndoAction() { while( !mChildren.empty() ) { UndoAction* action = mChildren.last(); if( action->isProperlyAdded() ) action->deleteObject(); else { clearNotify( action ); // need to clear the delete notification manually in this case delete action; } mChildren.pop_back(); } }
void SimSet::removeObject( SimObject* obj ) { lock(); const bool removed = objectList.remove( obj ); if( removed ) clearNotify( obj ); unlock(); if( removed ) { getSetModificationSignal().trigger( SetObjectRemoved, this, obj ); if( obj->isProperlyAdded() ) onObjectRemoved_callback( obj ); } }
void SimSet::popObject() { if( objectList.empty() ) { AssertWarn(false, "Stack underflow in SimSet::popObject"); return; } lock(); SimObject* object = objectList.last(); objectList.pop_back(); clearNotify( object ); unlock(); getSetModificationSignal().trigger( SetObjectRemoved, this, object ); if( object->isProperlyAdded() ) onObjectRemoved_callback( object ); }
void afxEA_ParticleEmitter::ea_finish(bool was_stopped) { if (arcaneFX::isShutdown()) return; if (emitter) { // make sure particles are fully faded. // note - fully faded particles are not always // invisible, so they are still kept alive and // deleted via deleteWhenEmpty(). if (ew_timing.fade_out_time > 0.0f) emitter->setFadeAmount(0.0f); if (dynamic_cast<afxParticleEmitter*>(emitter)) ((afxParticleEmitter*)emitter)->setAFXOwner(0); clearNotify(emitter); emitter->deleteWhenEmpty(); emitter = 0; } }
void SimSet::onRemove() { MutexHandle handle; handle.lock( mMutex ); if( !objectList.empty() ) { objectList.sortId(); // This backwards iterator loop doesn't work if the // list is empty, check the size first. for( SimObjectList::iterator ptr = objectList.end() - 1; ptr >= objectList.begin(); ptr -- ) clearNotify( *ptr ); } handle.unlock(); Parent::onRemove(); }
void Player::setMountObject (GameBase *object, int in_mountPoint) { if(mount) clearNotify(mount); setMaskBits(MountMask); mount = object; mountPoint = in_mountPoint; if(mount) { deleteNotify(mount); TMat3F tmat; mount->getObjectMountTransform(mountPoint, &tmat); if (!mountPoint) { Point3F rot = getRot (); tmat.set (EulerF (rot.x, rot.y, rot.z), tmat.p); } setTransform(tmat); EulerF angles; tmat.angles(&angles); if (mountPoint < 1) setRot (Point3F (0, 0, angles.z)); else if (mountPoint == 1) setRot (Point3F (0, 0, 0)); else { Point3F rot = getRot (); rot.z -= angles.z; setRot (rot); } setImageTriggerUp(0); setLinearVelocity (Point3F (0, 0, 0)); } }