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

    r12993 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*/ 
     
    7373            else 
    7474            { 
    75                 return 1; // valid lhs._image is greater than null.  
     75                return 1; // valid lhs._image is greater than null. 
    7676            } 
    7777        } 
    78         else if (rhs._image.valid())  
    79         { 
    80             return -1; // valid rhs._image is greater than null.  
     78        else if (rhs._image.valid()) 
     79        { 
     80            return -1; // valid rhs._image is greater than null. 
    8181        } 
    8282    } 
     
    154154    if (height>extensions->maxTexture3DSize()) height = extensions->maxTexture3DSize(); 
    155155    if (depth>extensions->maxTexture3DSize()) depth = extensions->maxTexture3DSize(); 
    156      
     156 
    157157    inwidth = width; 
    158158    inheight = height; 
    159159    indepth = depth; 
    160      
     160 
    161161    bool useHardwareMipMapGeneration = !image.isMipmap() && _useHardwareMipMapGeneration && texExtensions->isGenerateMipMapSupported(); 
    162162 
     
    185185            height >>= 1; 
    186186            depth >>= 1; 
    187         }     
     187        } 
    188188    } 
    189189} 
     
    192192{ 
    193193 
    194     // get the contextID (user defined ID of 0 upwards) for the  
     194    // get the contextID (user defined ID of 0 upwards) for the 
    195195    // current OpenGL context. 
    196196    const unsigned int contextID = state.getContextID(); 
     
    201201 
    202202    const Extensions* extensions = getExtensions(contextID,true); 
    203                                          
     203 
    204204    if (!extensions->isTexture3DSupported()) 
    205205    { 
     
    311311        _textureObjectBuffer[contextID] = textureObject = generateTextureObject( 
    312312                this, contextID,GL_TEXTURE_3D,_numMipmapLevels,_internalFormat,_textureWidth,_textureHeight,_textureDepth,0); 
    313          
     313 
    314314        textureObject->bind(); 
    315315 
     
    322322                     _sourceFormat ? _sourceFormat : _internalFormat, 
    323323                     _sourceType ? _sourceType : GL_UNSIGNED_BYTE, 
    324                      0);                 
    325                       
     324                     0); 
     325 
    326326        if (_readPBuffer.valid()) 
    327327        { 
    328328            _readPBuffer->bindPBufferToTexture(GL_FRONT); 
    329329        } 
    330          
     330 
    331331    } 
    332332    else 
     
    334334        glBindTexture( GL_TEXTURE_3D, 0 ); 
    335335    } 
    336      
     336 
    337337    // if texture object is now valid and we have to allocate mipmap levels, then 
    338338    if (textureObject != 0 && _texMipmapGenerationDirtyList[contextID]) 
     
    344344void Texture3D::computeInternalFormat() const 
    345345{ 
    346     if (_image.valid()) computeInternalFormatWithImage(*_image);  
     346    if (_image.valid()) computeInternalFormatWithImage(*_image); 
    347347    else computeInternalFormatType(); 
    348348} 
     
    354354        return; 
    355355 
    356     // get the contextID (user defined ID of 0 upwards) for the  
     356    // get the contextID (user defined ID of 0 upwards) for the 
    357357    // current OpenGL context. 
    358358    const unsigned int contextID = state.getContextID(); 
    359     const Extensions* extensions = getExtensions(contextID,true);     
     359    const Extensions* extensions = getExtensions(contextID,true); 
    360360    const Texture::Extensions* texExtensions = Texture::getExtensions(contextID,true); 
    361361 
     
    371371        //OSG_WARN<<"Warning::cannot currently use compressed format with 3D textures."<<std::endl; 
    372372        //return; 
    373     }     
    374      
     373    } 
     374 
    375375    //Rescale if resize hint is set or NPOT not supported or dimensions exceed max size 
    376376    if( _resizeNonPowerOfTwoHint || !texExtensions->isNonPowerOfTwoTextureSupported(_min_filter) 
     
    390390    { 
    391391        bool hardwareMipMapOn = false; 
    392         if (_min_filter != LINEAR && _min_filter != NEAREST)  
     392        if (_min_filter != LINEAR && _min_filter != NEAREST) 
    393393        { 
    394394            if (useHardwareMipMapGeneration) glTexParameteri(GL_TEXTURE_3D, GL_GENERATE_MIPMAP_SGIS,GL_TRUE); 
     
    415415            getCompressedSize(_internalFormat, inwidth, inheight, indepth, blockSize,size); 
    416416 
    417             extensions->glCompressedTexImage3D(target, 0, _internalFormat,  
    418                 inwidth, inheight, indepth,  
     417            extensions->glCompressedTexImage3D(target, 0, _internalFormat, 
     418                inwidth, inheight, indepth, 
    419419                _borderWidth, 
    420                 size,  
     420                size, 
    421421                image->data()); 
    422422        } 
     
    473473    inheight = image->t(); 
    474474    indepth  = image->r(); 
    475      
     475 
    476476} 
    477477 
     
    510510    // get the texture object for the current contextID. 
    511511    TextureObject* textureObject = getTextureObject(contextID); 
    512      
     512 
    513513    if (textureObject && _textureWidth != 0 && _textureHeight != 0 && _textureDepth != 0) 
    514514    { 
    515515        const Extensions* extensions = getExtensions(contextID,true); 
    516      
     516 
    517517        // bind texture 
    518518        textureObject->bind(); 
     
    528528        height >>= 1; 
    529529        depth >>= 1; 
    530                  
     530 
    531531        for( GLsizei k = 1; k < numMipmapLevels  && (width || height || depth); k++) 
    532532        { 
     
    547547            depth >>= 1; 
    548548        } 
    549                  
     549 
    550550        // inform state that this texture is the current one bound. 
    551         state.haveAppliedTextureAttribute(state.getActiveTextureUnit(), this);         
     551        state.haveAppliedTextureAttribute(state.getActiveTextureUnit(), this); 
    552552    } 
    553553} 
     
    609609    if (_isTexture3DFast) _isTexture3DSupported = true; 
    610610    else _isTexture3DSupported = strncmp((const char*)glGetString(GL_VERSION),"1.2",3)>=0; 
    611      
     611 
    612612    _maxTexture3DSize = 0; 
    613613    glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &_maxTexture3DSize);