Ignore:
Timestamp:
Jan 7, 2011, 12:05:14 PM (14 years ago)
Author:
Torben Dannhauer
Message:

Adapted Sky_Silverlining to be aware of the XML configuration. The sky can now be disabled by XML configuration.

All calls to sky must be wrapped with if(sky.valid()) { ...} to ensure that it is only called when available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/src/sky_Silverlining/visual_skySilverLining.cpp

    r144 r182  
    1919using namespace osgVisual;
    2020
    21 visual_skySilverLining::visual_skySilverLining(osgViewer::Viewer* viewer_, std::string configFileName)
    22 {
    23         OSG_NOTIFY( osg::ALWAYS ) << "Initialize visual_skySilverlining..." << std::endl;
     21visual_skySilverLining::visual_skySilverLining(osgViewer::Viewer* viewer_, std::string configFileName, bool& disabled)
     22{
     23        OSG_NOTIFY( osg::ALWAYS ) << "Initialize visual_skySilverlining...";
    2424
    2525        atmosphereInitialized = false;
     
    3535                cloudLayerSlots.back().slot_id = i;
    3636        }
     37
     38        // Check if the module is en- or diabled by XML configuration.
     39        xmlDoc* tmpDoc;
     40        xmlNode* config = util::getModuleXMLConfig( configFileName, "sky_silverlining", tmpDoc, disabled );
     41        if( disabled)
     42                OSG_NOTIFY( osg::ALWAYS ) << "..disabled by XML configuration file." << std::endl;
     43        else
     44                OSG_NOTIFY( osg::ALWAYS ) << std::endl;
     45        if(config)
     46                xmlFreeDoc(tmpDoc); xmlCleanupParser();
     47
    3748}
    3849
Note: See TracChangeset for help on using the changeset viewer.