]> git.mxchange.org Git - simgear.git/commitdiff
Modified Files:
authorfrohlich <frohlich>
Mon, 20 Nov 2006 18:19:02 +0000 (18:19 +0000)
committerfrohlich <frohlich>
Mon, 20 Nov 2006 18:19:02 +0000 (18:19 +0000)
model.cxx: Tweak model optimizations

simgear/scene/model/model.cxx

index acc8a1f81e1a9ea07a4ef6944bb18e8b80754f21..8be60e92795fd14e60992a29f1e1389f66bdf8ce 100644 (file)
@@ -212,7 +212,10 @@ public:
       SG_LOG(SG_IO, SG_INFO, "Reading model \""
              << absFileName << "\"");
 
+      bool needTristrip = true;
       if (osgDB::getLowerCaseFileExtension(absFileName) == "ac") {
+        // we get optimal geometry from the loader.
+        needTristrip = false;
         osg::Matrix m(1, 0, 0, 0,
                       0, 0, 1, 0,
                       0, -1, 0, 0,
@@ -250,7 +253,7 @@ public:
       unsigned opts = 0;
       // Don't use this one. It will break animation names ...
       // opts |= osgUtil::Optimizer::REMOVE_REDUNDANT_NODES;
-      
+
       // opts |= osgUtil::Optimizer::REMOVE_LOADED_PROXY_NODES;
       // opts |= osgUtil::Optimizer::COMBINE_ADJACENT_LODS;
       // opts |= osgUtil::Optimizer::SHARE_DUPLICATE_STATE;
@@ -258,9 +261,10 @@ public:
       // opts |= osgUtil::Optimizer::CHECK_GEOMETRY;
       // opts |= osgUtil::Optimizer::SPATIALIZE_GROUPS;
       // opts |= osgUtil::Optimizer::COPY_SHARED_NODES;
-      opts |= osgUtil::Optimizer::TRISTRIP_GEOMETRY;
+      if (needTristrip)
+        opts |= osgUtil::Optimizer::TRISTRIP_GEOMETRY;
       // opts |= osgUtil::Optimizer::TESSELATE_GEOMETRY;
-      // opts |= osgUtil::Optimizer::OPTIMIZE_TEXTURE_SETTINGS;
+      opts |= osgUtil::Optimizer::OPTIMIZE_TEXTURE_SETTINGS;
       optimizer.optimize(res.getNode(), opts);
 
       // OSGFIXME