]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/model.cxx
Add preliminary spot light animation
[simgear.git] / simgear / scene / model / model.cxx
index 41fe9a307f635e2affb1347c856e389d5df5227d..eba1e306f8da12897cbfe131c61448be0426cd2b 100644 (file)
@@ -25,7 +25,7 @@
 #include <simgear/scene/util/SGSceneUserData.hxx>
 #include <simgear/scene/util/CopyOp.hxx>
 #include <simgear/scene/util/SplicingVisitor.hxx>
-
+#include <simgear/scene/util/SGReaderWriterOptions.hxx>
 
 #include <simgear/structure/exception.hxx>
 #include <simgear/structure/Singleton.hxx>
 #include <simgear/props/props_io.hxx>
 #include <simgear/props/condition.hxx>
 
-#include "SGReaderWriterXMLOptions.hxx"
 #include "model.hxx"
 
 using std::vector;
 
 osg::Texture2D*
 SGLoadTexture2D(bool staticTexture, const std::string& path,
-                const osgDB::ReaderWriter::Options* options,
+                const osgDB::Options* options,
                 bool wrapu, bool wrapv, int)
 {
   osg::Image* image;
@@ -210,7 +209,7 @@ class MakeEffectVisitor : public SplicingVisitor
 public:
     typedef std::map<string, SGPropertyNode_ptr> EffectMap;
     using SplicingVisitor::apply;
-    MakeEffectVisitor(const SGReaderWriterXMLOptions* options = 0)
+    MakeEffectVisitor(const SGReaderWriterOptions* options = 0)
         : _options(options)
     {
     }
@@ -226,7 +225,7 @@ public:
 protected:
     EffectMap _effectMap;
     SGPropertyNode_ptr _currentEffectParent;
-    osg::ref_ptr<const SGReaderWriterXMLOptions> _options;
+    osg::ref_ptr<const SGReaderWriterOptions> _options;
 };
 
 void MakeEffectVisitor::apply(osg::Group& node)
@@ -264,7 +263,7 @@ void MakeEffectVisitor::apply(osg::Geode& geode)
     makeParametersFromStateSet(ssRoot, ss);
     SGPropertyNode_ptr effectRoot = new SGPropertyNode;
     effect::mergePropertyTrees(effectRoot, ssRoot, _currentEffectParent);
-    Effect* effect = makeEffect(effectRoot, true, _options);
+    Effect* effect = makeEffect(effectRoot, true, _options.get());
     EffectGeode* eg = dynamic_cast<EffectGeode*>(&geode);
     if (eg) {
         eg->setEffect(effect);
@@ -274,7 +273,7 @@ void MakeEffectVisitor::apply(osg::Geode& geode)
         ref_ptr<SGSceneUserData> userData = SGSceneUserData::getSceneUserData(&geode);
         if (userData.valid())
             eg->setUserData(new SGSceneUserData(*userData));
-        for (int i = 0; i < geode.getNumDrawables(); ++i) {
+        for (unsigned i = 0; i < geode.getNumDrawables(); ++i) {
             osg::Drawable *drawable = geode.getDrawable(i);
             eg->addDrawable(drawable);
 
@@ -309,7 +308,7 @@ protected:
 
 ref_ptr<Node> instantiateEffects(osg::Node* modelGroup,
                                  PropertyList& effectProps,
-                                 const SGReaderWriterXMLOptions* options)
+                                 const SGReaderWriterOptions* options)
 {
     SGPropertyNode_ptr defaultEffectPropRoot;
     MakeEffectVisitor visitor(options);