| | 268 | std::string configfile; |
| | 269 | while (arguments.read("--config", configfile)) |
| | 270 | { |
| | 271 | osg::notify(osg::NOTICE)<<"Trying to read config file "<<configfile<<std::endl; |
| | 272 | osg::ref_ptr<osg::Object> object = osgDB::readObjectFile(configfile); |
| | 273 | osgViewer::View* view = dynamic_cast<osgViewer::View*>(object.get()); |
| | 274 | if (view) |
| | 275 | { |
| | 276 | osg::notify(osg::NOTICE)<<"Read config file succesfully"<<std::endl; |
| | 277 | } |
| | 278 | else |
| | 279 | { |
| | 280 | osg::notify(osg::NOTICE)<<"Failed to read config file : "<<configfile<<std::endl; |
| | 281 | return 1; |
| | 282 | } |
| | 283 | } |
| | 284 | |
| | 285 | while (arguments.read("--write-config", configfile)) { osgDB::writeObjectFile(viewer, configfile); } |
| | 286 | |