diff --git a/examples/osgAndroidExampleGLES1/jni/OsgMainApp.cpp b/examples/osgAndroidExampleGLES1/jni/OsgMainApp.cpp index c1d930c55..bddcb75df 100644 --- a/examples/osgAndroidExampleGLES1/jni/OsgMainApp.cpp +++ b/examples/osgAndroidExampleGLES1/jni/OsgMainApp.cpp @@ -23,7 +23,7 @@ void OsgMainApp::loadModels(){ newModel = _vModelsToLoad[i]; osg::notify(osg::ALWAYS)<<"Loading: "< loadedModel = osgDB::readNodeFile(newModel.filename); + osg::ref_ptr loadedModel = osgDB::readRefNodeFile(newModel.filename); if (loadedModel == 0) { osg::notify(osg::ALWAYS)<<"Model not loaded"< loadedModel = osgDB::readNodeFile(newModel.filename); + osg::ref_ptr loadedModel = osgDB::readRefNodeFile(newModel.filename); if (loadedModel == 0) { osg::notify(osg::ALWAYS)<<"Model not loaded"< node = fc->getInputFileName().empty() ? 0 : osgDB::readNodeFile(fc->getInputFileName()); + osg::ref_ptr node; + if (!fc->getInputFileName().empty()) + { + osgDB::readRefNodeFile(fc->getInputFileName()); + } if (node.valid()) { cp->setToModel(node.get()); @@ -522,7 +526,7 @@ int main( int argc, char **argv ) gsc::CaptureSettings* fc = itr->get(); screenShot->_frameCapture = fc; - osg::ref_ptr model = osgDB::readNodeFile(fc->getInputFileName()); + osg::ref_ptr model = osgDB::readRefNodeFile(fc->getInputFileName()); if (!model) break; viewer.setSceneData(model.get()); diff --git a/examples/osgstaticviewer/osgstaticviewer.cpp b/examples/osgstaticviewer/osgstaticviewer.cpp index 80983bc70..e01a99cbe 100644 --- a/examples/osgstaticviewer/osgstaticviewer.cpp +++ b/examples/osgstaticviewer/osgstaticviewer.cpp @@ -170,7 +170,7 @@ int main(int argc, char** argv) } // load the data - osg::ref_ptr loadedModel = osgDB::readNodeFiles(arguments); + osg::ref_ptr loadedModel = osgDB::readRefNodeFiles(arguments); if (!loadedModel) { std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl; diff --git a/examples/osgviewerCocoa/ViewerCocoa.mm b/examples/osgviewerCocoa/ViewerCocoa.mm index 84333c449..ea24ba825 100644 --- a/examples/osgviewerCocoa/ViewerCocoa.mm +++ b/examples/osgviewerCocoa/ViewerCocoa.mm @@ -1193,7 +1193,7 @@ A -respondsToSelector: check has been used to provide compatibility with previou // int number_of_files = [file_names count]; // Exercise for the reader: Try loading all files in the array NSString* single_file = [file_names objectAtIndex:0]; - osg::ref_ptr loaded_model = osgDB::readNodeFile([single_file fileSystemRepresentation]); + osg::ref_ptr loaded_model = osgDB::readRefNodeFile([single_file fileSystemRepresentation]); if(!loaded_model) { NSLog(@"File: %@ failed to load", single_file); @@ -1212,7 +1212,7 @@ A -respondsToSelector: check has been used to provide compatibility with previou return NO; } NSString* file_path = [file_url path]; - osg::ref_ptr loaded_model = osgDB::readNodeFile([file_path fileSystemRepresentation]); + osg::ref_ptr loaded_model = osgDB::readRefNodeFile([file_path fileSystemRepresentation]); if(!loaded_model) { NSLog(@"URL: %@ failed to load, %@", file_url, file_path); diff --git a/examples/osgviewerFOX/FOX_OSG_MDIView.cpp b/examples/osgviewerFOX/FOX_OSG_MDIView.cpp index df6124e2e..9dccc0791 100644 --- a/examples/osgviewerFOX/FOX_OSG_MDIView.cpp +++ b/examples/osgviewerFOX/FOX_OSG_MDIView.cpp @@ -39,7 +39,7 @@ FOX_OSG_MDIView::FOX_OSG_MDIView(FXMDIClient *p, const FXString &name, viewer->setKeyEventSetsDone(0); // load the scene. - osg::ref_ptr loadedModel = osgDB::readNodeFile("cow.osgt"); + osg::ref_ptr loadedModel = osgDB::readRefNodeFile("cow.osgt"); if (!loadedModel) { return ; diff --git a/examples/osgviewerGTK/osgviewerGTK.cpp b/examples/osgviewerGTK/osgviewerGTK.cpp index 8c77071d5..810ba3b82 100644 --- a/examples/osgviewerGTK/osgviewerGTK.cpp +++ b/examples/osgviewerGTK/osgviewerGTK.cpp @@ -69,7 +69,7 @@ class ExampleOSGGTKDrawingArea : public OSGGTKDrawingArea { if(gtk_dialog_run(GTK_DIALOG(of)) == GTK_RESPONSE_ACCEPT) { char* file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(of)); - osg::ref_ptr model = osgDB::readNodeFile(file); + osg::ref_ptr model = osgDB::readRefNodeFile(file); if(model.valid()) { setSceneData(model.get()); @@ -170,7 +170,7 @@ int main(int argc, char** argv) { if(da.createWidget(640, 480)) { if(argc >= 2) { - osg::ref_ptr model = osgDB::readNodeFile(argv[1]); + osg::ref_ptr model = osgDB::readRefNodeFile(argv[1]); if(model.valid()) da.setSceneData(model.get()); } diff --git a/examples/osgviewerIPhone/iphoneViewerAppDelegate.mm b/examples/osgviewerIPhone/iphoneViewerAppDelegate.mm index 05654eee9..fc328b2c3 100644 --- a/examples/osgviewerIPhone/iphoneViewerAppDelegate.mm +++ b/examples/osgviewerIPhone/iphoneViewerAppDelegate.mm @@ -337,7 +337,7 @@ private: _root->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::OVERRIDE); //load and attach scene model - osg::ref_ptr model = osgDB::readNodeFile(osgDB::findDataFile("lz.osg")); + osg::ref_ptr model = osgDB::readRefNodeFile(osgDB::findDataFile("lz.osg")); if (!model) { osg::Geode* geode = new osg::Geode(); osg::ShapeDrawable* drawable = new osg::ShapeDrawable(new osg::Box(osg::Vec3(0,0,0), 1));