From 29aad066f0e57a04649b92083c4be7c6d490de31 Mon Sep 17 00:00:00 2001 From: timoore Date: Mon, 11 Aug 2008 08:32:13 +0000 Subject: [PATCH] pointers in Particles object should be ref_ptr --- simgear/scene/model/particles.cxx | 2 +- simgear/scene/model/particles.hxx | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/simgear/scene/model/particles.cxx b/simgear/scene/model/particles.cxx index df5a160f..9fdc4bf5 100644 --- a/simgear/scene/model/particles.cxx +++ b/simgear/scene/model/particles.cxx @@ -477,7 +477,7 @@ void Particles::operator()(osg::Node* node, osg::NodeVisitor* nv) particleSys->getDefaultParticleTemplate().setSizeRange(osgParticle::rangef(startSize, endSize)); if (lifeValue) particleSys->getDefaultParticleTemplate().setLifeTime(lifeValue->getValue()); - if (program) { + if (program.valid()) { if (useGravity) program->setAcceleration(GlobalParticleCallback::getGravityVector()); if (useWind) diff --git a/simgear/scene/model/particles.hxx b/simgear/scene/model/particles.hxx index 2b4bbe47..359f6acd 100644 --- a/simgear/scene/model/particles.hxx +++ b/simgear/scene/model/particles.hxx @@ -97,8 +97,6 @@ public: endSizeValue(NULL), lifeValue(NULL), counterCond(NULL), - refFrame(NULL), - program(NULL), useGravity(false), useWind(false) { @@ -265,16 +263,15 @@ protected: SGExpressiond* endSizeValue; SGExpressiond* lifeValue; SGCondition* counterCond; - osg::MatrixTransform* refFrame; float staticColorComponents[8]; float startSize; float endSize; float counterStaticValue; float counterStaticExtraRange; - osgParticle::RadialShooter* shooter; - osgParticle::RandomRateCounter* counter; - osgParticle::ParticleSystem* particleSys; - osgParticle::FluidProgram* program; + osg::ref_ptr shooter; + osg::ref_ptr counter; + osg::ref_ptr particleSys; + osg::ref_ptr program; bool useGravity; bool useWind; static osg::ref_ptr psu; -- 2.39.5