From Martin Lavery and Robert Osfield, added fallbacks for when now command line args are provided.
This commit is contained in:
@@ -651,7 +651,7 @@ int main(int argc, char** argv)
|
||||
osg::Node* loadedModel = osgDB::readNodeFiles(arguments);
|
||||
|
||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||
if (!loadedModel) loadedModel = osgDB::readNodeFile("cessnafire.osg");
|
||||
if (!loadedModel) loadedModel = osgDB::readNodeFile("cow.osg");
|
||||
|
||||
if (!loadedModel)
|
||||
{
|
||||
|
||||
@@ -191,6 +191,10 @@ int main( int argc, char **argv )
|
||||
// read the scene from the list of file specified commandline args.
|
||||
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments);
|
||||
|
||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||
if (!scene) scene = osgDB::readNodeFile("dumptruck.osg");
|
||||
|
||||
|
||||
if (!scene)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"No model loaded"<<std::endl;
|
||||
|
||||
@@ -307,7 +307,10 @@ int main( int argc, char **argv )
|
||||
|
||||
// load the nodes from the commandline arguments.
|
||||
osg::Node* loadedModel = osgDB::readNodeFiles(arguments);
|
||||
|
||||
|
||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||
if (!loadedModel) loadedModel = osgDB::readNodeFile("glider.osg");
|
||||
|
||||
// create a room made of foor walls, a floor, a roof, and swinging light fitting.
|
||||
osg::Node* rootnode = createRoom(loadedModel);
|
||||
|
||||
|
||||
@@ -125,6 +125,10 @@ int main( int argc, char **argv )
|
||||
|
||||
// load the nodes from the commandline arguments.
|
||||
osg::Node* loadedModel = osgDB::readNodeFiles(arguments);
|
||||
|
||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||
if (!loadedModel) loadedModel = osgDB::readNodeFile("glider.osg");
|
||||
|
||||
if (!loadedModel)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Please specify model filename on the command line."<<std::endl;
|
||||
|
||||
@@ -88,6 +88,9 @@ int main( int argc, char **argv )
|
||||
|
||||
// read the scene from the list of file specified commandline args.
|
||||
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
|
||||
|
||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||
if (!loadedModel) loadedModel = osgDB::readNodeFile("cow.osg");
|
||||
|
||||
// if no model has been successfully loaded report failure.
|
||||
if (!loadedModel)
|
||||
|
||||
@@ -27,6 +27,10 @@ int main( int argc, char **argv )
|
||||
|
||||
// load the nodes from the commandline arguments.
|
||||
osg::Node* rootnode = osgDB::readNodeFiles(arguments);
|
||||
|
||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||
if (!rootnode) rootnode = osgDB::readNodeFile("cessnafire.osg");
|
||||
|
||||
if (!rootnode)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Please specify and model filename on the command line."<<std::endl;
|
||||
|
||||
@@ -297,6 +297,10 @@ int main( int argc, char **argv )
|
||||
|
||||
// load the nodes from the commandline arguments.
|
||||
osg::Node* loadedmodel = osgDB::readNodeFiles(arguments);
|
||||
|
||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||
if (!loadedmodel) loadedmodel = osgDB::readNodeFile("glider.osg");
|
||||
|
||||
if (!loadedmodel)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Please sepecify and model filename on the command line."<<std::endl;
|
||||
|
||||
@@ -213,6 +213,9 @@ int main( int argc, char **argv )
|
||||
|
||||
// read the scene from the list of file specified commandline args.
|
||||
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments);
|
||||
|
||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||
if (!scene) scene = osgDB::readNodeFile("fountain.osg");
|
||||
|
||||
osg::ref_ptr<osg::Group> group = dynamic_cast<osg::Group*>(scene.get());
|
||||
if (!group)
|
||||
|
||||
@@ -420,6 +420,10 @@ int main( int argc, char **argv )
|
||||
|
||||
// load the nodes from the commandline arguments.
|
||||
osg::Node* loadedModel = osgDB::readNodeFiles(arguments);
|
||||
|
||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||
if (!loadedModel) loadedModel = osgDB::readNodeFile("cessna.osg");
|
||||
|
||||
if (!loadedModel)
|
||||
{
|
||||
return 1;
|
||||
|
||||
@@ -331,6 +331,9 @@ int main( int argc, char **argv )
|
||||
|
||||
// read the scene from the list of file specified commandline args.
|
||||
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
|
||||
|
||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||
if (!loadedModel) loadedModel = osgDB::readNodeFile("cessna.osg");
|
||||
|
||||
// if no model has been successfully loaded report failure.
|
||||
if (!loadedModel)
|
||||
|
||||
@@ -23,6 +23,10 @@ int main( int argc, char **argv )
|
||||
|
||||
// load the nodes from the commandline arguments.
|
||||
osg::Node* loadedModel = osgDB::readNodeFiles(arguments);
|
||||
|
||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||
if (!loadedModel) loadedModel = osgDB::readNodeFile("cow.osg");
|
||||
|
||||
if (!loadedModel)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Please specifiy a model filename on the command line."<<std::endl;
|
||||
|
||||
@@ -93,7 +93,10 @@ int main( int argc, char **argv )
|
||||
|
||||
// read the scene from the list of file specified commandline args.
|
||||
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
|
||||
|
||||
|
||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||
if (!loadedModel) loadedModel = osgDB::readNodeFile("dumptruck.osg");
|
||||
|
||||
// if no model has been successfully loaded report failure.
|
||||
if (!loadedModel)
|
||||
{
|
||||
|
||||
@@ -149,6 +149,9 @@ int main( int argc, char **argv )
|
||||
|
||||
// load the images specified on command line
|
||||
osg::Node* loadedModel = osgDB::readNodeFiles(arguments);
|
||||
|
||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||
if (!loadedModel) loadedModel = osgDB::readNodeFile("dumptruck.osg");
|
||||
|
||||
if (!loadedModel)
|
||||
{
|
||||
|
||||
@@ -22,6 +22,9 @@ int main( int argc, char **argv )
|
||||
// read the scene from the list of file specified commandline args.
|
||||
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
|
||||
|
||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||
if (!loadedModel) loadedModel = osgDB::readNodeFile("cow.osg");
|
||||
|
||||
// if no model has been successfully loaded report failure.
|
||||
if (!loadedModel)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user