Changeset 6916

Show
Ignore:
Timestamp:
06/08/07 17:37:20
Author:
robert
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OpenSceneGraph/trunk/examples/osgdistortion/osgdistortion.cpp

    r6908 r6916  
    652652 
    653653    // if not loaded assume no arguments passed in, try use default mode instead. 
    654     if (!loadedModel) loadedModel = osgDB::readNodeFile("cessnafire.osg"); 
     654    if (!loadedModel) loadedModel = osgDB::readNodeFile("cow.osg"); 
    655655   
    656656    if (!loadedModel) 
  • OpenSceneGraph/trunk/examples/osghud/osghud.cpp

    r6263 r6916  
    192192    osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments); 
    193193     
     194    // if not loaded assume no arguments passed in, try use default mode instead. 
     195    if (!scene) scene = osgDB::readNodeFile("dumptruck.osg"); 
     196     
     197     
    194198    if (!scene) 
    195199    { 
  • OpenSceneGraph/trunk/examples/osglight/osglight.cpp

    r6051 r6916  
    308308    // load the nodes from the commandline arguments. 
    309309    osg::Node* loadedModel = osgDB::readNodeFiles(arguments); 
    310  
     310     
     311    // if not loaded assume no arguments passed in, try use default mode instead. 
     312    if (!loadedModel) loadedModel = osgDB::readNodeFile("glider.osg"); 
     313     
    311314    // create a room made of foor walls, a floor, a roof, and swinging light fitting. 
    312315    osg::Node* rootnode = createRoom(loadedModel); 
  • OpenSceneGraph/trunk/examples/osglogicop/osglogicop.cpp

    r5927 r6916  
    126126    // load the nodes from the commandline arguments. 
    127127    osg::Node* loadedModel = osgDB::readNodeFiles(arguments); 
     128     
     129    // if not loaded assume no arguments passed in, try use default mode instead. 
     130    if (!loadedModel) loadedModel = osgDB::readNodeFile("glider.osg"); 
     131     
    128132    if (!loadedModel) 
    129133    { 
  • OpenSceneGraph/trunk/examples/osgmotionblur/osgmotionblur.cpp

    r6088 r6916  
    8989    // read the scene from the list of file specified commandline args. 
    9090    osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); 
     91     
     92    // if not loaded assume no arguments passed in, try use default mode instead. 
     93    if (!loadedModel) loadedModel = osgDB::readNodeFile("cow.osg"); 
    9194 
    9295    // if no model has been successfully loaded report failure. 
  • OpenSceneGraph/trunk/examples/osgmultitexture/osgmultitexture.cpp

    r5927 r6916  
    2828    // load the nodes from the commandline arguments. 
    2929    osg::Node* rootnode = osgDB::readNodeFiles(arguments); 
     30     
     31    // if not loaded assume no arguments passed in, try use default mode instead. 
     32    if (!rootnode) rootnode = osgDB::readNodeFile("cessnafire.osg"); 
     33     
    3034    if (!rootnode) 
    3135    { 
  • OpenSceneGraph/trunk/examples/osgoccluder/osgoccluder.cpp

    r5951 r6916  
    298298    // load the nodes from the commandline arguments. 
    299299    osg::Node* loadedmodel = osgDB::readNodeFiles(arguments); 
     300     
     301    // if not loaded assume no arguments passed in, try use default mode instead. 
     302    if (!loadedmodel) loadedmodel = osgDB::readNodeFile("glider.osg"); 
     303     
    300304    if (!loadedmodel) 
    301305    { 
  • OpenSceneGraph/trunk/examples/osgpick/osgpick.cpp

    r6183 r6916  
    214214    // read the scene from the list of file specified commandline args. 
    215215    osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments); 
     216      
     217    // if not loaded assume no arguments passed in, try use default mode instead. 
     218    if (!scene) scene = osgDB::readNodeFile("fountain.osg"); 
    216219 
    217220    osg::ref_ptr<osg::Group> group = dynamic_cast<osg::Group*>(scene.get()); 
  • OpenSceneGraph/trunk/examples/osgprerender/osgprerender.cpp

    r6051 r6916  
    421421    // load the nodes from the commandline arguments. 
    422422    osg::Node* loadedModel = osgDB::readNodeFiles(arguments); 
     423     
     424    // if not loaded assume no arguments passed in, try use default mode instead. 
     425    if (!loadedModel) loadedModel = osgDB::readNodeFile("cessna.osg"); 
     426     
    423427    if (!loadedModel) 
    424428    { 
  • OpenSceneGraph/trunk/examples/osgreflect/osgreflect.cpp

    r6163 r6916  
    332332    // read the scene from the list of file specified commandline args. 
    333333    osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); 
     334     
     335    // if not loaded assume no arguments passed in, try use default mode instead. 
     336    if (!loadedModel) loadedModel = osgDB::readNodeFile("cessna.osg"); 
    334337 
    335338    // if no model has been successfully loaded report failure. 
  • OpenSceneGraph/trunk/examples/osgscribe/osgscribe.cpp

    r5954 r6916  
    2424    // load the nodes from the commandline arguments. 
    2525    osg::Node* loadedModel = osgDB::readNodeFiles(arguments); 
     26 
     27    // if not loaded assume no arguments passed in, try use default mode instead. 
     28    if (!loadedModel) loadedModel = osgDB::readNodeFile("cow.osg"); 
     29     
    2630    if (!loadedModel) 
    2731    { 
  • OpenSceneGraph/trunk/examples/osgsimplifier/osgsimplifier.cpp

    r5959 r6916  
    9494    // read the scene from the list of file specified commandline args. 
    9595    osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); 
    96  
     96   
     97    // if not loaded assume no arguments passed in, try use default mode instead. 
     98    if (!loadedModel) loadedModel = osgDB::readNodeFile("dumptruck.osg"); 
     99     
    97100    // if no model has been successfully loaded report failure. 
    98101    if (!loadedModel)  
  • OpenSceneGraph/trunk/examples/osgtexture1D/osgtexture1D.cpp

    r6051 r6916  
    150150    // load the images specified on command line 
    151151    osg::Node* loadedModel = osgDB::readNodeFiles(arguments); 
     152   
     153    // if not loaded assume no arguments passed in, try use default mode instead. 
     154    if (!loadedModel) loadedModel = osgDB::readNodeFile("dumptruck.osg"); 
    152155     
    153156    if (!loadedModel) 
  • OpenSceneGraph/trunk/examples/osgwindows/osgwindows.cpp

    r5964 r6916  
    2323    osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); 
    2424 
     25    // if not loaded assume no arguments passed in, try use default mode instead. 
     26    if (!loadedModel) loadedModel = osgDB::readNodeFile("cow.osg"); 
     27     
    2528    // if no model has been successfully loaded report failure. 
    2629    if (!loadedModel)