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/Texture1D.cpp

    r12912 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*/ 
     
    6363            else 
    6464            { 
    65                 return 1; // valid lhs._image is greater than null.  
     65                return 1; // valid lhs._image is greater than null. 
    6666            } 
    6767        } 
    68         else if (rhs._image.valid())  
    69         { 
    70             return -1; // valid rhs._image is greater than null.  
     68        else if (rhs._image.valid()) 
     69        { 
     70            return -1; // valid rhs._image is greater than null. 
    7171        } 
    7272    } 
     
    108108    _image = image; 
    109109    _modifiedCount.setAllElementsTo(0); 
    110      
     110 
    111111    if (_image.valid() && _image->requiresUpdateCall()) 
    112112    { 
     
    120120{ 
    121121#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) 
    122     // get the contextID (user defined ID of 0 upwards) for the  
     122    // get the contextID (user defined ID of 0 upwards) for the 
    123123    // current OpenGL context. 
    124124    const unsigned int contextID = state.getContextID(); 
     
    172172    { 
    173173 
    174         // we don't have a applyTexImage1D_subload yet so can't reuse.. so just generate a new texture object.         
     174        // we don't have a applyTexImage1D_subload yet so can't reuse.. so just generate a new texture object. 
    175175        _textureObjectBuffer[contextID] = textureObject = generateTextureObject(this, contextID, GL_TEXTURE_1D); 
    176176 
     
    193193    { 
    194194 
    195         // we don't have a applyTexImage1D_subload yet so can't reuse.. so just generate a new texture object.         
     195        // we don't have a applyTexImage1D_subload yet so can't reuse.. so just generate a new texture object. 
    196196        textureObject = generateTextureObject(this, contextID,GL_TEXTURE_1D); 
    197197 
     
    206206        // update the modified count to show that it is upto date. 
    207207        getModifiedCount(contextID) = _image->getModifiedCount(); 
    208      
     208 
    209209        _textureObjectBuffer[contextID] = textureObject; 
    210      
     210 
    211211        // unref image data? 
    212212        if (isSafeToUnrefImageData(state) && _image->getDataVariance()==STATIC) 
     
    215215            non_const_this->_image = NULL; 
    216216        } 
    217          
     217 
    218218    } 
    219219    else if ( (_textureWidth!=0) && (_internalFormat!=0) ) 
     
    221221        _textureObjectBuffer[contextID] = textureObject = generateTextureObject( 
    222222                this,contextID,GL_TEXTURE_1D,_numMipmapLevels,_internalFormat,_textureWidth,1,1,0); 
    223          
     223 
    224224        textureObject->bind(); 
    225225 
     
    231231                     _sourceFormat ? _sourceFormat : _internalFormat, 
    232232                     _sourceType ? _sourceType : GL_UNSIGNED_BYTE, 
    233                      0);                 
    234                       
     233                     0); 
     234 
    235235        if (_readPBuffer.valid()) 
    236236        { 
     
    256256void Texture1D::computeInternalFormat() const 
    257257{ 
    258     if (_image.valid()) computeInternalFormatWithImage(*_image);  
     258    if (_image.valid()) computeInternalFormatWithImage(*_image); 
    259259    else computeInternalFormatType(); 
    260260} 
     
    267267        return; 
    268268 
    269     // get the contextID (user defined ID of 0 upwards) for the  
     269    // get the contextID (user defined ID of 0 upwards) for the 
    270270    // current OpenGL context. 
    271271    const unsigned int contextID = state.getContextID(); 
     
    278278    // select the internalFormat required for the texture. 
    279279    bool compressed = isCompressedInternalFormat(_internalFormat); 
    280      
     280 
    281281    //Rescale if resize hint is set or NPOT not supported or dimension exceeds max size 
    282282    if( _resizeNonPowerOfTwoHint || !extensions->isNonPowerOfTwoTextureSupported(_min_filter) || inwidth > extensions->maxTextureSize() ) 
     
    289289    glPixelStorei(GL_UNPACK_ROW_LENGTH,image->getRowLength()); 
    290290 
    291     static MyCompressedTexImage1DArbProc glCompressedTexImage1D_ptr =  
     291    static MyCompressedTexImage1DArbProc glCompressedTexImage1D_ptr = 
    292292        convertPointerType<MyCompressedTexImage1DArbProc, void*>(getGLExtensionFuncPtr("glCompressedTexImage1DARB")); 
    293293 
     
    307307        { 
    308308            numMipmapLevels = 1; 
    309             GLint blockSize = ( _internalFormat == GL_COMPRESSED_RGB_S3TC_DXT1_EXT ? 8 : 16 );  
     309            GLint blockSize = ( _internalFormat == GL_COMPRESSED_RGB_S3TC_DXT1_EXT ? 8 : 16 ); 
    310310            GLint size = ((image->s()+3)/4)*((image->t()+3)/4)*blockSize; 
    311             glCompressedTexImage1D_ptr(target, 0, _internalFormat,  
    312                   image->s(), _borderWidth,  
    313                   size,  
    314                   image->data());                 
     311            glCompressedTexImage1D_ptr(target, 0, _internalFormat, 
     312                  image->s(), _borderWidth, 
     313                  size, 
     314                  image->data()); 
    315315 
    316316        } 
     
    352352            else if(glCompressedTexImage1D_ptr) 
    353353            { 
    354                 GLint blockSize = ( _internalFormat == GL_COMPRESSED_RGB_S3TC_DXT1_EXT ? 8 : 16 );  
    355                 GLint size = 0;  
     354                GLint blockSize = ( _internalFormat == GL_COMPRESSED_RGB_S3TC_DXT1_EXT ? 8 : 16 ); 
     355                GLint size = 0; 
    356356                for( GLsizei k = 0 ; k < numMipmapLevels  && width ;k++) 
    357357                { 
    358358 
    359359                    size = ((width+3)/4)*blockSize; 
    360                     glCompressedTexImage1D_ptr(target, k, _internalFormat,  
    361                         width,  _borderWidth, size, image->getMipmapData(k));                 
     360                    glCompressedTexImage1D_ptr(target, k, _internalFormat, 
     361                        width,  _borderWidth, size, image->getMipmapData(k)); 
    362362 
    363363                    width >>= 1; 
     
    394394        } 
    395395        // the relevent texture object is not of the right size so 
    396         // needs to been deleted     
    397         // remove previously bound textures.  
     396        // needs to been deleted 
     397        // remove previously bound textures. 
    398398        dirtyTextureObject(); 
    399399        // note, dirtyTextureObject() dirties all the texture objects for 
     
    402402        // RO July 2001. 
    403403    } 
    404      
    405      
     404 
     405 
    406406    // remove any previously assigned images as these are nolonger valid. 
    407407    _image = NULL; 
     
    421421    _textureWidth = width; 
    422422    _numMipmapLevels = 1; 
    423      
     423 
    424424    textureObject->setAllocated(_numMipmapLevels,_internalFormat,_textureWidth,1,1,0); 
    425425 
     
    470470    // get the texture object for the current contextID. 
    471471    TextureObject* textureObject = getTextureObject(contextID); 
    472      
     472 
    473473    if (textureObject && _textureWidth != 0) 
    474474    { 
     
    482482        // we do not reallocate the level 0, since it was already allocated 
    483483        width >>= 1; 
    484          
     484 
    485485        for( GLsizei k = 1; k < numMipmapLevels  && width; k++) 
    486486        { 
     
    495495            width >>= 1; 
    496496        } 
    497                  
     497 
    498498        // inform state that this texture is the current one bound. 
    499         state.haveAppliedTextureAttribute(state.getActiveTextureUnit(), this);         
     499        state.haveAppliedTextureAttribute(state.getActiveTextureUnit(), this); 
    500500    } 
    501501#else