]> git.mxchange.org Git - simgear.git/commitdiff
pointers in Particles object should be ref_ptr
authortimoore <timoore>
Mon, 11 Aug 2008 08:32:13 +0000 (08:32 +0000)
committertimoore <timoore>
Mon, 11 Aug 2008 08:32:13 +0000 (08:32 +0000)
simgear/scene/model/particles.cxx
simgear/scene/model/particles.hxx

index df5a160f5473386a57bb2bed3042d56bf4fddbf9..9fdc4bf51a1f3d5c8ab8746d2fb26a827004a67c 100644 (file)
@@ -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)
index 2b4bbe47a976e5ef33cbbf2c3ed46a0435c2dbea..359f6acd4d3c26f7a8a2a4e09495a936c8a981b3 100644 (file)
@@ -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<osgParticle::RadialShooter> shooter;
+    osg::ref_ptr<osgParticle::RandomRateCounter> counter;
+    osg::ref_ptr<osgParticle::ParticleSystem> particleSys;
+    osg::ref_ptr<osgParticle::FluidProgram> program;
     bool useGravity;
     bool useWind;
     static osg::ref_ptr<osgParticle::ParticleSystemUpdater> psu;