Show
Ignore:
Timestamp:
03/21/12 18:36:20 (2 years ago)
Author:
robert
Message:

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osg/State.cpp

    r12974 r13041  
    1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield  
     1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
    22 * 
    3  * This library is open source and may be redistributed and/or modified under   
    4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or  
     3 * This library is open source and may be redistributed and/or modified under 
     4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
    55 * (at your option) any later version.  The full license is in LICENSE file 
    66 * included with this distribution, and on the openscenegraph.org website. 
    7  *  
     7 * 
    88 * This library is distributed in the hope that it will be useful, 
    99 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
     10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1111 * OpenSceneGraph Public License for more details. 
    1212*/ 
     
    5858        _useModelViewAndProjectionUniforms = true; 
    5959        _useVertexAttributeAliasing = true; 
    60     #else     
     60    #else 
    6161        _useModelViewAndProjectionUniforms = false; 
    6262        _useVertexAttributeAliasing = false; 
    6363    #endif 
    64      
     64 
    6565    _modelViewMatrixUniform = new Uniform(Uniform::FLOAT_MAT4,"osg_ModelViewMatrix"); 
    6666    _projectionMatrixUniform = new Uniform(Uniform::FLOAT_MAT4,"osg_ProjectionMatrix"); 
     
    110110    } 
    111111 
    112     _abortRenderingPtr = NULL;     
     112    _abortRenderingPtr = NULL; 
    113113 
    114114    _checkGLErrors = ONCE_PER_FRAME; 
     
    135135    _isVertexBufferObjectSupportResolved = false; 
    136136    _isVertexBufferObjectSupported = false; 
    137      
     137 
    138138    _lastAppliedProgramObject = 0; 
    139139 
     
    187187    const Program::PerContextProgram* ppcp = reinterpret_cast<const Program::PerContextProgram*>(object); 
    188188    AppliedProgramObjectSet::iterator itr = _appliedProgramObjectSet.find(ppcp); 
    189     if (itr != _appliedProgramObjectSet.end())  
     189    if (itr != _appliedProgramObjectSet.end()) 
    190190    { 
    191191        // OSG_NOTICE<<"Removing _appliedProgramObjectSet entry "<<ppcp<<std::endl; 
     
    206206        ms.last_applied_value = !ms.global_default_value; 
    207207        ms.changed = true; 
    208     }         
     208    } 
    209209#else 
    210210    _modeMap.clear(); 
     
    213213    _modeMap[GL_DEPTH_TEST].global_default_value = true; 
    214214    _modeMap[GL_DEPTH_TEST].changed = true; 
    215      
     215 
    216216    // go through all active StateAttribute's, setting to change to force update, 
    217217    // the idea is to leave only the global defaults left. 
     
    226226        as.changed = true; 
    227227    } 
    228      
     228 
    229229    // we can do a straight clear, we arn't interested in GL_DEPTH_TEST defaults in texture modes. 
    230230    for(TextureModeMapList::iterator tmmItr=_textureModeMapList.begin(); 
     
    255255 
    256256    _stateStateStack.clear(); 
    257      
     257 
    258258    _modelView = _identity; 
    259259    _projection = _identity; 
    260      
     260 
    261261    dirtyAllVertexArrays(); 
    262      
     262 
    263263#if 0 
    264264    // reset active texture unit values and call OpenGL 
    265265    // note, this OpenGL op precludes the use of State::reset() without a 
    266     // valid graphics context, therefore the new implementation below  
     266    // valid graphics context, therefore the new implementation below 
    267267    // is preferred. 
    268268    setActiveTextureUnit(0); 
     
    285285        (*apitr)->removeObserver(this); 
    286286    } 
    287      
     287 
    288288    _appliedProgramObjectSet.clear(); 
    289      
    290      
     289 
     290 
    291291    // what about uniforms??? need to clear them too... 
    292292    // go through all active Unfirom's, setting to change to force update, 
     
    333333        pushModeList(_modeMap,dstate->getModeList()); 
    334334 
    335         // iterator through texture modes.         
     335        // iterator through texture modes. 
    336336        unsigned int unit; 
    337337        const StateSet::TextureModeList& ds_textureModeList = dstate->getTextureModeList(); 
     
    361361 
    362362    while (!_stateStateStack.empty()) popStateSet(); 
    363      
     363 
    364364    applyProjectionMatrix(0); 
    365365    applyModelViewMatrix(0); 
    366      
     366 
    367367    _lastAppliedProgramObject = 0; 
    368368} 
     
    373373 
    374374    if (_stateStateStack.empty()) return; 
    375      
    376      
     375 
     376 
    377377    const StateSet* dstate = _stateStateStack.back(); 
    378378 
     
    382382        popModeList(_modeMap,dstate->getModeList()); 
    383383 
    384         // iterator through texture modes.         
     384        // iterator through texture modes. 
    385385        unsigned int unit; 
    386386        const StateSet::TextureModeList& ds_textureModeList = dstate->getTextureModeList(); 
     
    402402 
    403403    } 
    404      
     404 
    405405    // remove the top draw state from the stack. 
    406406    _stateStateStack.pop_back(); 
     
    410410{ 
    411411    StateSetStack tempStack; 
    412      
     412 
    413413    // first pop the StateSet above the position we need to insert at 
    414414    while (_stateStateStack.size()>pos) 
     
    420420    // push our new stateset 
    421421    pushStateSet(dstate); 
    422      
     422 
    423423    // push back the original ones 
    424424    for(StateSetStack::reverse_iterator itr = tempStack.rbegin(); 
     
    438438        return; 
    439439    } 
    440      
     440 
    441441    // record the StateSet above the one we intend to remove 
    442442    StateSetStack tempStack; 
     
    447447    } 
    448448 
    449     // remove the intended StateSet as well     
     449    // remove the intended StateSet as well 
    450450    popStateSet(); 
    451451 
     
    463463    // empty the stateset first. 
    464464    stateset.clear(); 
    465      
     465 
    466466    for(ModeMap::const_iterator mitr=_modeMap.begin(); 
    467467        mitr!=_modeMap.end(); 
     
    474474            stateset.setMode(mitr->first,ms.valueVec.back()); 
    475475        } 
    476     }         
     476    } 
    477477 
    478478    for(AttributeMap::const_iterator aitr=_attributeMap.begin(); 
     
    485485            stateset.setAttribute(const_cast<StateAttribute*>(as.attributeVec.back().first)); 
    486486        } 
    487     }         
     487    } 
    488488 
    489489} 
     
    571571    // go through all active StateAttribute's, applying where appropriate. 
    572572    applyAttributeMap(_attributeMap); 
    573         
     573 
    574574    unsigned int unit; 
    575575    unsigned int unitMax = maximum(_textureModeMapList.size(),_textureAttributeMapList.size()); 
     
    702702 
    703703    // will need to disable this mode on next apply so set it to changed. 
    704     ms.changed = true;     
     704    ms.changed = true; 
    705705} 
    706706 
     
    715715 
    716716    // will need to disable this mode on next apply so set it to changed. 
    717     ms.changed = true;     
     717    ms.changed = true; 
    718718} 
    719719 
     
    734734void State::haveAppliedAttribute(AttributeMap& attributeMap,StateAttribute::Type type, unsigned int member) 
    735735{ 
    736      
     736 
    737737    AttributeMap::iterator itr = attributeMap.find(StateAttribute::TypeMemberPair(type,member)); 
    738738    if (itr!=attributeMap.end()) 
     
    782782        ModeStack& ms = mitr->second; 
    783783        ms.last_applied_value = !ms.last_applied_value; 
    784         ms.changed = true;     
    785  
    786     }         
     784        ms.changed = true; 
     785 
     786    } 
    787787 
    788788    for(TextureModeMapList::iterator tmmItr=_textureModeMapList.begin(); 
     
    796796            ModeStack& ms = mitr->second; 
    797797            ms.last_applied_value = !ms.last_applied_value; 
    798             ms.changed = true;     
    799  
    800         }         
     798            ms.changed = true; 
     799 
     800        } 
    801801    } 
    802802} 
     
    812812        as.changed = true; 
    813813    } 
    814      
     814 
    815815 
    816816    for(TextureAttributeMapList::iterator tamItr=_textureAttributeMapList.begin(); 
     
    10321032* note, only updates values that change.*/ 
    10331033void State::setVertexAttribPointer( unsigned int index, 
    1034                                       GLint size, GLenum type, GLboolean normalized,  
     1034                                      GLint size, GLenum type, GLboolean normalized, 
    10351035                                    GLsizei stride, const GLvoid *ptr ) 
    10361036{ 
     
    10581058        eap._dirty = false; 
    10591059    } 
    1060 }       
     1060} 
    10611061 
    10621062/** wrapper around DisableVertexAttribArrayARB(index); 
     
    10771077        } 
    10781078    } 
    1079 }         
     1079} 
    10801080 
    10811081void State::disableVertexAttribPointersAboveAndIncluding( unsigned int index ) 
     
    12881288 
    12891289    OSG_INFO<<"++Before Converted source "<<std::endl<<source<<std::endl<<"++++++++"<<std::endl; 
    1290      
     1290 
    12911291    // replace ftransform as it only works with built-ins 
    12921292    State_Utils::replace(source, "ftransform()", "gl_ModelViewProjectionMatrix * gl_Vertex"); 
     
    14261426{ 
    14271427    // OSG_NOTICE<<"State::drawQuads("<<first<<", "<<count<<")"<<std::endl; 
    1428      
     1428 
    14291429    unsigned int array = first % 4; 
    14301430    unsigned int offsetFirst = ((first-array) / 4) * 6; 
     
    14321432    unsigned int numIndices = numQuads * 6; 
    14331433    unsigned int endOfIndices = offsetFirst+numIndices; 
    1434      
     1434 
    14351435    if (endOfIndices<65536) 
    14361436    {