Show
Ignore:
Timestamp:
06/08/07 14:15:16 (7 years ago)
Author:
robert
Message:

Added default command line arg

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgfxbrowser/osgfxbrowser.cpp

    r6835 r6909  
    312312    } 
    313313 
    314     if (arguments.argc() <= 1) { 
    315         arguments.getApplicationUsage()->write(std::cout, osg::ApplicationUsage::COMMAND_LINE_OPTION); 
    316         return 1; 
    317     } 
    318  
    319     osg::Timer timer; 
    320     osg::Timer_t start_tick = timer.tick(); 
    321  
    322314    // read the scene from the list of file specified commandline args. 
    323315    osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); 
    324316 
    325     // if no model has been successfully loaded report failure. 
    326     if (!loadedModel) { 
    327         std::cout << arguments.getApplicationName() << ": No data loaded" << std::endl; 
     317    // if not loaded assume no arguments passed in, try use default mode instead. 
     318    if (!loadedModel) loadedModel = osgDB::readNodeFile("dumptruck.osg"); 
     319   
     320    if (!loadedModel) 
     321    { 
     322        std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl; 
    328323        return 1; 
    329324    } 
    330  
    331     osg::Timer_t end_tick = timer.tick(); 
    332  
    333     std::cout << "Time to load = " << timer.delta_s(start_tick,end_tick) << std::endl; 
    334325 
    335326    // optimize the scene graph, remove rendundent nodes and state etc.