Changeset 3224

Show
Ignore:
Timestamp:
08/03/04 20:06:36 (10 years ago)
Author:
robert
Message:

From Pavel Moloshtan, fix to Image copy constructor so that it used the
correct size of image including mipmaps.

Files:
1 modified

Legend:

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

    r3190 r3224  
    5757    if (image._data) 
    5858    { 
    59         int num_components =  
    60             _pixelFormat == GL_LUMINANCE ? 1 : 
    61             _pixelFormat == GL_LUMINANCE_ALPHA ? 2 : 
    62             _pixelFormat == GL_RGB ? 3 : 
    63             _pixelFormat == GL_RGBA ? 4 : 4; 
    64  
    65         int size = _s*_t*_r*num_components; 
     59        int size = image.getTotalSizeInBytesIncludingMipmaps(); 
    6660        setData(new unsigned char [size],USE_NEW_DELETE); 
    6761        memcpy(_data,image._data,size);