Use readRef version of osgDB methods to give us thread safety
This commit is contained in:
parent
6e2443d268
commit
9639b63d44
3 changed files with 4 additions and 4 deletions
|
@ -84,7 +84,7 @@ namespace canvas
|
|||
{
|
||||
SGPath valid_path = fgValidatePath(p, false);
|
||||
if( !valid_path.isNull() )
|
||||
return osgDB::readImageFile(valid_path.local8BitStr());
|
||||
return osgDB::readRefImageFile(valid_path.local8BitStr());
|
||||
|
||||
SG_LOG(SG_IO, SG_ALERT, "canvas::Image: reading '" << path << "' denied");
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ void FGPgtTerrain::init( osg::Group* terrain ) {
|
|||
options->setDem(_dem);
|
||||
|
||||
SG_LOG(SG_TERRAIN, SG_INFO, "Terrain init - Load w180s90-360x180.pgt" );
|
||||
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile("w180s90-360x180.pgt", options.get());
|
||||
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFile("w180s90-360x180.pgt", options.get());
|
||||
if ( loadedModel ) {
|
||||
terrain_branch->addChild( loadedModel.get() );
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ SplashScreen::~SplashScreen()
|
|||
|
||||
void SplashScreen::createNodes()
|
||||
{
|
||||
_splashImage = osgDB::readImageFile(selectSplashImage());
|
||||
_splashImage = osgDB::readRefImageFile(selectSplashImage());
|
||||
|
||||
int width = _splashImage->s();
|
||||
int height = _splashImage->t();
|
||||
|
@ -281,7 +281,7 @@ void SplashScreen::setupLogoImage()
|
|||
return;
|
||||
}
|
||||
|
||||
_logoImage = osgDB::readImageFile(logoPath.utf8Str());
|
||||
_logoImage = osgDB::readRefImageFile(logoPath.utf8Str());
|
||||
if (!_logoImage) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue