spt: Make use of newly provided earth texture.

This commit is contained in:
Mathias Froehlich 2012-03-04 20:10:22 +01:00
parent 036c0034c3
commit 9700e46e47

View File

@ -67,6 +67,12 @@ ReaderWriterSPT::readObject(const std::string& fileName, const osgDB::Options* o
stateSet->setAttributeAndModes(new osg::CullFace);
std::string imageFileName = options->getPluginStringData("SimGear::FG_WORLD_TEXTURE");
if (imageFileName.empty()) {
imageFileName = options->getPluginStringData("SimGear::FG_ROOT");
imageFileName = osgDB::concatPaths(imageFileName, "Textures");
imageFileName = osgDB::concatPaths(imageFileName, "Globe");
imageFileName = osgDB::concatPaths(imageFileName, "world.topo.bathy.200407.3x4096x2048.png");
}
if (osg::Image* image = osgDB::readImageFile(imageFileName, options)) {
osg::Texture2D* texture = new osg::Texture2D;
texture->setImage(image);