]> git.mxchange.org Git - flightgear.git/commitdiff
New materials.xml format
authorStuart Buchanan <stuart_d_buchanan@yahoo.co.uk>
Sat, 9 Aug 2014 19:43:34 +0000 (20:43 +0100)
committerStuart Buchanan <stuart_d_buchanan@yahoo.co.uk>
Sat, 9 Aug 2014 19:43:34 +0000 (20:43 +0100)
src/ATC/trafficcontrol.cxx
src/Airports/groundnetwork.cxx
src/Scenery/tilemgr.cxx
utils/fgviewer/fgviewer.cxx

index 65d60ae529dca95546b4223598560420792df6b0..907818cfb27422e87ad7e59005b013cb06118468 100644 (file)
@@ -1409,9 +1409,9 @@ void FGStartupController::render(bool visible)
                     //osg::Node *custom_obj;
                     SGMaterial *mat;
                     if (segment->hasBlock(now)) {
-                        mat = matlib->find("UnidirectionalTaperRed");
+                        mat = matlib->find("UnidirectionalTaperRed", center);
                     } else {
-                        mat = matlib->find("UnidirectionalTaperGreen");
+                        mat = matlib->find("UnidirectionalTaperGreen", center);
                     }
                     if (mat)
                         geode->setEffect(mat->get_effect());
@@ -1487,9 +1487,9 @@ void FGStartupController::render(bool visible)
                         //osg::Node *custom_obj;
                         SGMaterial *mat;
                         if (segment->hasBlock(now)) {
-                            mat = matlib->find("UnidirectionalTaperRed");
+                            mat = matlib->find("UnidirectionalTaperRed", segCenter);
                         } else {
-                            mat = matlib->find("UnidirectionalTaperGreen");
+                            mat = matlib->find("UnidirectionalTaperGreen", segCenter);
                         }
                         if (mat)
                             geode->setEffect(mat->get_effect());
index 701c07570a93d55777885f847452cdd8608daa56..3c692629a7d29de13731fd346e4add6fe095bc7d 100644 (file)
@@ -1230,9 +1230,9 @@ void FGGroundNetwork::render(bool visible)
                 //osg::Node *custom_obj;
                 SGMaterial *mat;
                 if (segments[pos]->hasBlock(now)) {
-                    mat = matlib->find("UnidirectionalTaperRed");
+                    mat = matlib->find("UnidirectionalTaperRed", center);
                 } else {
-                    mat = matlib->find("UnidirectionalTaperGreen");
+                    mat = matlib->find("UnidirectionalTaperGreen", center);
                 }
                 if (mat)
                     geode->setEffect(mat->get_effect());
@@ -1304,9 +1304,9 @@ void FGGroundNetwork::render(bool visible)
                     //osg::Node *custom_obj;
                     SGMaterial *mat;
                     if (segments[k]->hasBlock(now)) {
-                        mat = matlib->find("UnidirectionalTaperRed");
+                        mat = matlib->find("UnidirectionalTaperRed", segCenter);
                     } else {
-                        mat = matlib->find("UnidirectionalTaperGreen");
+                        mat = matlib->find("UnidirectionalTaperGreen", segCenter);
                     }
                     if (mat)
                         geode->setEffect(mat->get_effect());
index 4ffd5d6f34372c4e255d256a376a7888c589f6c5..c2e635acd26595af480e2455a1dfedf578c7c4ef 100644 (file)
@@ -199,7 +199,6 @@ void FGTileMgr::reinit()
 void FGTileMgr::materialLibChanged()
 {
     _options->setMaterialLib(globals->get_matlib());
-    _options->getMaterialLib()->refreshActiveMaterials();
 }
 
 /* schedule a tile for loading, keep request for given amount of time.
@@ -304,7 +303,7 @@ void FGTileMgr::schedule_needed(const SGBucket& curr_bucket, double vis)
 }
 
 /**
- * Update the various queues maintained by the tilemagr (private
+ * Update the various queues maintained by the tilemgr (private
  * internal function, do not call directly.)
  */
 void FGTileMgr::update_queues(bool& isDownloadingScenery)
@@ -316,7 +315,6 @@ void FGTileMgr::update_queues(bool& isDownloadingScenery)
     TileEntry *e;
     int loading=0;
     int sz=0;
-    bool didRefreshMaterialCache = false;
     
     tile_cache.set_current_time( current_time );
     tile_cache.reset_traversal();
@@ -332,11 +330,6 @@ void FGTileMgr::update_queues(bool& isDownloadingScenery)
             e->prep_ssg_node(vis);
             
             if (!e->is_loaded()) {
-                if (!didRefreshMaterialCache) {
-                    didRefreshMaterialCache = true;
-                    globals->get_matlib()->refreshActiveMaterials();
-                }
-                
                 bool nonExpiredOrCurrent = !e->is_expired(current_time) || e->is_current_view();
                 bool downloading = isTileDirSyncing(e->tileFileName);
                 isDownloadingScenery |= downloading;
index e0ebcf250539cb0a2eb32d0b0d01c8ed5ffdd4c3..f5bb8e944b3c1326aaf6d6e5f852dda253c9631f 100644 (file)
@@ -188,7 +188,6 @@ main(int argc, char** argv)
         SG_LOG(SG_GENERAL, SG_ALERT, "Problems loading FlightGear materials.\n"
                << "Probably FG_ROOT is not properly set.");
     }
-    ml->refreshActiveMaterials();
     simgear::SGModelLib::init(fg_root, props);
 
     // Set up the reader/writer options