From 9414874e1dcb7cea4abc0a5991e3b60f11957111 Mon Sep 17 00:00:00 2001 From: Mathias Froehlich Date: Sat, 3 Mar 2012 10:45:15 +0100 Subject: [PATCH] scenery: inline SGGenTile into its single caller. --- simgear/scene/tgdb/TileEntry.cxx | 8 ++++++-- simgear/scene/tgdb/obj.cxx | 1 - simgear/scene/tgdb/obj.hxx | 15 --------------- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/simgear/scene/tgdb/TileEntry.cxx b/simgear/scene/tgdb/TileEntry.cxx index a6c5575c..dddba984 100644 --- a/simgear/scene/tgdb/TileEntry.cxx +++ b/simgear/scene/tgdb/TileEntry.cxx @@ -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!" ); } diff --git a/simgear/scene/tgdb/obj.cxx b/simgear/scene/tgdb/obj.cxx index a7286cb9..1d41422d 100644 --- a/simgear/scene/tgdb/obj.cxx +++ b/simgear/scene/tgdb/obj.cxx @@ -65,7 +65,6 @@ #include "GroundLightManager.hxx" -#include "userdata.hxx" #include "pt_lights.hxx" using namespace simgear; diff --git a/simgear/scene/tgdb/obj.hxx b/simgear/scene/tgdb/obj.hxx index b84f21d9..c78bb463 100644 --- a/simgear/scene/tgdb/obj.hxx +++ b/simgear/scene/tgdb/obj.hxx @@ -36,28 +36,13 @@ #include #include -#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); -- 2.39.5