From Martin Lavery and Robert Osfield, added fallbacks for when now command line args are provided.

This commit is contained in:
Robert Osfield
2007-06-08 15:37:20 +00:00
parent c4b1c27a31
commit ce0f30cfcb
14 changed files with 48 additions and 3 deletions

View File

@@ -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)
{

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;

View File

@@ -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)

View File

@@ -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;

View File

@@ -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;

View File

@@ -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)

View File

@@ -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;

View File

@@ -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)

View File

@@ -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;

View File

@@ -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)
{

View File

@@ -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)
{

View File

@@ -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)
{