Ignore:
Timestamp:
Nov 7, 2010, 8:02:38 PM (13 years ago)
Author:
Torben Dannhauer
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/src/distortion/visual_distortion.cpp

    r147 r148  
    2323        OSG_NOTIFY (osg::ALWAYS ) << "visual_distortion instantiated." << std::endl;
    2424
     25        this->configFileName = configFileName;
    2526        initialized = false;
    2627        distortionEnabled = false;
     
    3738{
    3839        OSG_NOTIFY (osg::ALWAYS ) << "visual_distortion destroyed." << std::endl;
     40}
     41
     42bool visual_distortion::processXMLConfiguration()
     43{
     44        // Init XML
     45        xmlDoc* tmpDoc;
     46        xmlNode* config = util::getModuleXMLConfig( configFileName, "distortion", tmpDoc );
     47        if(config)
     48        {
     49                xmlNode* a_node = config;
     50                // Extract infos
     51                std::string name = "";
     52                bool enabled = false;
     53
     54                xmlAttr  *attr = a_node->properties;
     55                while ( attr )
     56                {
     57                        std::string attr_name=reinterpret_cast<const char*>(attr->name);
     58                        std::string attr_value=reinterpret_cast<const char*>(attr->children->content);
     59                        if( attr_name == "name" )
     60                                name = reinterpret_cast<const char*>(attr->children->content);
     61                        if( attr_name == "enabled" && attr_value== "yes" )
     62                                enabled = true;
     63                        if( attr_name == "enabled" && attr_value== "no" )
     64                                enabled = false;
     65
     66                        attr = attr->next;
     67                }
     68                OSG_ALWAYS << "Module '" << name << "' found. Enabled = " << enabled << std::endl;
     69        }
     70
     71        // extract configuration values
     72
     73        // clean up
     74        if(tmpDoc)
     75        {
     76                xmlFreeDoc(tmpDoc); xmlCleanupParser();
     77                return true;
     78        }
     79
     80        return true;
    3981}
    4082
     
    64106
    65107        // Read out Distortion CMDLine arguments
    66         while (arguments.read("--width", tex_width)) {}
    67     while (arguments.read("--height", tex_height)) {}
    68 
    69         while (arguments.read("--fbo")) { renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; }
    70     while (arguments.read("--pbuffer")) { renderImplementation = osg::Camera::PIXEL_BUFFER; }
    71     while (arguments.read("--pbuffer-rtt")) { renderImplementation = osg::Camera::PIXEL_BUFFER_RTT; }
    72     while (arguments.read("--fb")) { renderImplementation = osg::Camera::FRAME_BUFFER; }
    73     while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPERATE_WINDOW; }
    74 
    75     while (arguments.read("--texture-rectangle")) { useTextureRectangle = true; }
    76 
    77     while (arguments.read("--shaderDistortion")) { useShaderDistortion = true; }
    78 
    79     while (arguments.read("--hdr")) { useHDR = true; }
    80 
    81         while (arguments.read("--distortionmap", distortMapFileName)) { }
    82     while (arguments.read("--blendmap", blendMapFileName)) { }
     108        //while (arguments.read("--width", tex_width)) {}
     109    //while (arguments.read("--height", tex_height)) {}
     110
     111        //while (arguments.read("--fbo")) { renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; }
     112        //while (arguments.read("--pbuffer")) { renderImplementation = osg::Camera::PIXEL_BUFFER; }
     113        //while (arguments.read("--pbuffer-rtt")) { renderImplementation = osg::Camera::PIXEL_BUFFER_RTT; }
     114        //while (arguments.read("--fb")) { renderImplementation = osg::Camera::FRAME_BUFFER; }
     115        //while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPERATE_WINDOW; }
     116
     117    //while (arguments.read("--texture-rectangle")) { useTextureRectangle = true; }
     118
     119    //while (arguments.read("--shaderDistortion")) { useShaderDistortion = true; }
     120
     121    //while (arguments.read("--hdr")) { useHDR = true; }
     122
     123        //while (arguments.read("--distortionmap", distortMapFileName)) { }
     124    //while (arguments.read("--blendmap", blendMapFileName)) { }
    83125
    84126        std::string pre_cfg("..\\resources\\distortion\\view_");
Note: See TracChangeset for help on using the changeset viewer.