Changeset 3215

Show
Ignore:
Timestamp:
08/02/04 15:57:47 (10 years ago)
Author:
robert
Message:

Fixed warnings

Location:
OpenSceneGraph/trunk/src/osg
Files:
6 modified

Legend:

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

    r3171 r3215  
    191191void FragmentProgram::releaseGLObjects(State* state) const 
    192192{ 
    193     const_cast<FragmentProgram*>(this)->dirtyFragmentProgramObject(); 
     193    if (!state) const_cast<FragmentProgram*>(this)->dirtyFragmentProgramObject(); 
     194    else 
     195    { 
     196        unsigned int contextID = state->getContextID(); 
     197        if (_fragmentProgramIDList[contextID] != 0) 
     198        { 
     199            FragmentProgram::deleteFragmentProgramObject(contextID,_fragmentProgramIDList[contextID]); 
     200            _fragmentProgramIDList[contextID] = 0; 
     201        } 
     202    } 
    194203} 
    195204 
  • OpenSceneGraph/trunk/src/osg/PagedLOD.cpp

    r3099 r3215  
    186186        if (!_perRangeDataList[_children.size()-1]._filename.empty() && _perRangeDataList[_children.size()-1]._timeStamp<expiryTime) 
    187187        { 
    188             //removedChildren.push_back(_children[_children.size()-1].get()); 
    189             Group::removeChild(_children[_children.size()-1].get()); 
     188            osg::Node* nodeToRemove = _children[_children.size()-1].get(); 
     189            removedChildren.push_back(nodeToRemove); 
     190            Group::removeChild(nodeToRemove); 
    190191        } 
    191192    } 
  • OpenSceneGraph/trunk/src/osg/PointSprite.cpp

    r2773 r3215  
    2020int PointSprite::compare(const StateAttribute& sa) const 
    2121{ 
    22     // check the types are equal and then create the rhs variable 
    23     // used by the COMPARE_StateAttribute_Paramter macro's below. 
    24     COMPARE_StateAttribute_Types(PointSprite,sa) 
     22    if (this==&sa) return 0;\ 
     23    const std::type_info* type_lhs = &typeid(*this);\ 
     24    const std::type_info* type_rhs = &typeid(sa);\ 
     25    if (type_lhs->before(*type_rhs)) return -1;\ 
     26    if (*type_lhs != *type_rhs) return 1;\ 
     27 
    2528    return 0; // passed all the above comparison macro's, must be equal. 
    2629} 
  • OpenSceneGraph/trunk/src/osg/Referenced.cpp

    r2787 r3215  
    2424void Referenced::setDeleteHandler(DeleteHandler* handler) 
    2525{ 
    26 //    s_deleteHandler.reset(handler); 
     26#if defined(_MSC_VER) && (_MSC_VER <= 1200) // 1200 == VC++ 6.0 
     27    s_deleteHandler = handler; 
     28#else 
     29    s_deleteHandler.reset(handler); 
     30#endif 
    2731} 
    2832 
  • OpenSceneGraph/trunk/src/osg/Texture.cpp

    r3171 r3215  
    10711071void Texture::releaseGLObjects(State* state) const 
    10721072{ 
    1073     const_cast<Texture*>(this)->dirtyTextureObject(); 
     1073    if (!state) const_cast<Texture*>(this)->dirtyTextureObject(); 
     1074    else 
     1075    { 
     1076        unsigned int contextID = state->getContextID(); 
     1077        if (_textureObjectBuffer[contextID].valid())  
     1078        { 
     1079            OpenThreads::ScopedLock<OpenThreads::Mutex> lock(getTextureObjectManager()->_mutex); 
     1080             
     1081            getTextureObjectManager()->_textureObjectListMap[contextID].push_back(_textureObjectBuffer[contextID]); 
     1082            _textureObjectBuffer[contextID] = 0; 
     1083        } 
     1084    } 
    10741085} 
    10751086 
  • OpenSceneGraph/trunk/src/osg/VertexProgram.cpp

    r3171 r3215  
    192192void VertexProgram::releaseGLObjects(State* state) const 
    193193{ 
    194     const_cast<VertexProgram*>(this)->dirtyVertexProgramObject(); 
     194    if (!state) const_cast<VertexProgram*>(this)->dirtyVertexProgramObject(); 
     195    else 
     196    { 
     197        unsigned int contextID = state->getContextID(); 
     198        if (_vertexProgramIDList[contextID] != 0) 
     199        { 
     200            VertexProgram::deleteVertexProgramObject(contextID,_vertexProgramIDList[contextID]); 
     201            _vertexProgramIDList[contextID] = 0; 
     202        } 
     203    } 
    195204} 
    196205