]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/model.cxx
Do not modify danymically generated textures.
[simgear.git] / simgear / scene / model / model.cxx
index cdd50861c478979587126563c501018b54eb4856..54e749245e5082d575e56467944d5046f8a415db 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "model.hxx"
 
-SG_USING_STD(vector);
+using std::vector;
 
 osg::Texture2D*
 SGLoadTexture2D(bool staticTexture, const std::string& path,
@@ -56,26 +56,6 @@ SGLoadTexture2D(bool staticTexture, const std::string& path,
     }
   }
 
-  // Make sure the texture is shared if we already have the same texture
-  // somewhere ...
-  {
-    osg::ref_ptr<osg::Node> tmpNode = new osg::Node;
-    osg::StateSet* stateSet = tmpNode->getOrCreateStateSet();
-    stateSet->setTextureAttribute(0, texture.get());
-
-    // OSGFIXME: don't forget that mutex here
-    osgDB::Registry* registry = osgDB::Registry::instance();
-    registry->getSharedStateManager()->share(tmpNode.get(), 0);
-
-    // should be the same, but be paranoid ...
-    stateSet = tmpNode->getStateSet();
-    osg::StateAttribute* stateAttr;
-    stateAttr = stateSet->getTextureAttribute(0, osg::StateAttribute::TEXTURE);
-    osg::Texture2D* texture2D = dynamic_cast<osg::Texture2D*>(stateAttr);
-    if (texture2D)
-      texture = texture2D;
-  }
-
   return texture.release();
 }