Changeset 324


Ignore:
Timestamp:
Jan 8, 2012, 6:49:34 PM (13 years ago)
Author:
Torben Dannhauer
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/src/core/visual_core.cpp

    r305 r324  
    1919#include <visual_util.h>
    2020#include <osgTerrain/Terrain>
     21#include <osgDB/FileNameUtils>
    2122
    2223using namespace osgVisual;
     
    174175bool visual_core::loadTerrain(osg::ArgumentParser& arguments_)
    175176{
    176         osg::ref_ptr<osg::Node> model = osgDB::readNodeFiles(util::getTerrainFromXMLConfig(configFilename));
     177        std::vector<std::string> terrainFile = util::getTerrainFromXMLConfig(configFilename);
     178
     179        // Add each terrain path to the FilePath list to help OSG to find the subtiles.
     180        for(unsigned int i=0;i<terrainFile.size();i++)
     181                osgDB::Registry::instance()->getDataFilePathList().push_back(osgDB::getFilePath(terrainFile[i]));
     182
     183        osg::ref_ptr<osg::Node> model = osgDB::readNodeFiles(terrainFile);
    177184        if( model.valid() )
    178185        {
Note: See TracChangeset for help on using the changeset viewer.