scenery: inline SGGenTile into its single caller.

This commit is contained in:
Mathias Froehlich 2012-03-03 10:45:15 +01:00
parent 9e46820c57
commit 9414874e1d
3 changed files with 6 additions and 18 deletions

View File

@ -53,6 +53,7 @@
#include "ReaderWriterSPT.hxx" #include "ReaderWriterSPT.hxx"
#include "ReaderWriterSTG.hxx" #include "ReaderWriterSTG.hxx"
#include "SGOceanTile.hxx"
#include "TileEntry.hxx" #include "TileEntry.hxx"
using std::string; using std::string;
@ -314,8 +315,11 @@ TileEntry::loadTileByFileName(const string& fileName,
} else { } else {
// ... or generate an ocean tile on the fly // ... or generate an ocean tile on the fly
SG_LOG(SG_TERRAIN, SG_INFO, " Generating ocean tile"); 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, SG_LOG( SG_TERRAIN, SG_ALERT,
"Warning: failed to generate ocean tile!" ); "Warning: failed to generate ocean tile!" );
} }

View File

@ -65,7 +65,6 @@
#include "GroundLightManager.hxx" #include "GroundLightManager.hxx"
#include "userdata.hxx"
#include "pt_lights.hxx" #include "pt_lights.hxx"
using namespace simgear; using namespace simgear;

View File

@ -36,28 +36,13 @@
#include <osg/Node> #include <osg/Node>
#include <osg/Group> #include <osg/Group>
#include "SGOceanTile.hxx"
using std::string; using std::string;
class SGBucket;
class SGMaterialLib; class SGMaterialLib;
namespace simgear { namespace simgear {
class SGReaderWriterOptions; 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* osg::Node*
SGLoadBTG(const std::string& path, SGLoadBTG(const std::string& path,
const simgear::SGReaderWriterOptions* options); const simgear::SGReaderWriterOptions* options);