]> git.mxchange.org Git - simgear.git/commitdiff
scenery: inline SGGenTile into its single caller.
authorMathias Froehlich <Mathias.Froehlich@web.de>
Sat, 3 Mar 2012 09:45:15 +0000 (10:45 +0100)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Sat, 3 Mar 2012 11:03:09 +0000 (12:03 +0100)
simgear/scene/tgdb/TileEntry.cxx
simgear/scene/tgdb/obj.cxx
simgear/scene/tgdb/obj.hxx

index a6c5575caf85b40df528b8a2c73727e8d7415cd8..dddba9847c7bac1c4e461336ceb54906ab5f44bf 100644 (file)
@@ -53,6 +53,7 @@
 
 #include "ReaderWriterSPT.hxx"
 #include "ReaderWriterSTG.hxx"
+#include "SGOceanTile.hxx"
 #include "TileEntry.hxx"
 
 using std::string;
@@ -314,8 +315,11 @@ TileEntry::loadTileByFileName(const string& fileName,
     } else {
         // ... or generate an ocean tile on the fly
         SG_LOG(SG_TERRAIN, SG_INFO, "  Generating ocean tile");
-        if ( !SGGenTile( path_list[0], tile_bucket,
-                        opt->getMaterialLib(), new_tile ) ) {
+
+        osg::Node* node = SGOceanTile(tile_bucket, opt->getMaterialLib());
+        if ( node ) {
+            new_tile->addChild(node);
+        } else {
             SG_LOG( SG_TERRAIN, SG_ALERT,
                     "Warning: failed to generate ocean tile!" );
         }
index a7286cb9e48c36887670a989e553afc044866531..1d41422d324d49888a52d62cd86d4d49e2aec76f 100644 (file)
@@ -65,7 +65,6 @@
 #include "GroundLightManager.hxx"
 
 
-#include "userdata.hxx"
 #include "pt_lights.hxx"
 
 using namespace simgear;
index b84f21d990e9cea9e5fc693b43c258956701e439..c78bb463caedd1215d010d5fc9a5f1d32c4658ed 100644 (file)
 #include <osg/Node>
 #include <osg/Group>
 
-#include "SGOceanTile.hxx"
-
 using std::string;
 
-class SGBucket;
 class SGMaterialLib;
 namespace simgear {
 class SGReaderWriterOptions;
 }
 
-// Generate an ocean tile
-inline bool SGGenTile( const std::string&, const SGBucket& b,
-                       SGMaterialLib *matlib, osg::Group* group )
-{
-  // Generate an ocean tile
-  osg::Node* node = SGOceanTile(b, matlib);
-  if (!node)
-    return false;
-  group->addChild(node);
-  return true;
-}
-
 osg::Node*
 SGLoadBTG(const std::string& path, 
           const simgear::SGReaderWriterOptions* options);