From: ThorstenB Date: Mon, 7 Mar 2011 18:26:37 +0000 (+0100) Subject: Change cloudfield::addCloud interface, X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2ef8672a6bc8105165117aece169c23598bed6cf;p=simgear.git Change cloudfield::addCloud interface, so it's more obvious that "addCloud" won't keep a reference to SGNewCloud. --- diff --git a/simgear/scene/sky/cloudfield.cxx b/simgear/scene/sky/cloudfield.cxx index 7d738563..202311e7 100644 --- a/simgear/scene/sky/cloudfield.cxx +++ b/simgear/scene/sky/cloudfield.cxx @@ -253,10 +253,9 @@ void SGCloudField::applyCoverage(void) { last_coverage = coverage; } -void SGCloudField::addCloud( SGVec3f& pos, SGNewCloud *cloud) { +void SGCloudField::addCloud( SGVec3f& pos, osg::ref_ptr geode) { defined3D = true; - osg::ref_ptr geode = cloud->genCloud(); - + // Determine which quadtree to put it in. int x = (int) floor((pos.x() + fieldSize/2.0) * QUADTREE_SIZE / fieldSize); if (x >= QUADTREE_SIZE) x = (QUADTREE_SIZE - 1); diff --git a/simgear/scene/sky/cloudfield.hxx b/simgear/scene/sky/cloudfield.hxx index 38fa9e95..f09f698b 100644 --- a/simgear/scene/sky/cloudfield.hxx +++ b/simgear/scene/sky/cloudfield.hxx @@ -49,6 +49,11 @@ using std::vector; class SGNewCloud; +namespace simgear +{ + class EffectGeode; +} + /** * A layer of 3D clouds. */ @@ -99,7 +104,7 @@ public: void clear(void); // add one cloud, data is not copied, ownership given - void addCloud( SGVec3f& pos, SGNewCloud *cloud); + void addCloud( SGVec3f& pos, osg::ref_ptr cloud); /** * reposition the cloud layer at the specified origin and