From 219adb7419837a2a199fcbd7d2806a0a299de3b0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 17 Feb 2021 17:50:21 +0000 Subject: [PATCH] Ran dos2unix to fix line endings --- src/osg/Image.cpp | 60 ++++++++++++++++++++++---------------------- src/osg/Texture.cpp | 52 +++++++++++++++++++------------------- src/osg/dxtctool.cpp | 10 ++++---- 3 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/osg/Image.cpp b/src/osg/Image.cpp index 9d116f0dd..04668f6a3 100644 --- a/src/osg/Image.cpp +++ b/src/osg/Image.cpp @@ -538,10 +538,10 @@ unsigned int Image::computeNumComponents(GLenum pixelFormat) { case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): return 3; case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): return 3; - case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): return 4; - case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): return 4; - case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): return 4; - case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): return 4; + case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): return 4; + case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): return 4; + case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): return 4; + case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): return 4; case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT): return 4; case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT): return 1; case(GL_COMPRESSED_RED_RGTC1_EXT): return 1; @@ -721,13 +721,13 @@ unsigned int Image::computePixelSizeInBits(GLenum format,GLenum type) switch(format) { - case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): return 4; - case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): return 4; - case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): return 4; - case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): return 4; - case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): return 8; - case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): return 8; - case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): return 8; + case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): return 4; + case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): return 4; + case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): return 4; + case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): return 4; + case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): return 8; + case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): return 8; + case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): return 8; case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT): return 8; case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT): return 4; case(GL_COMPRESSED_RED_RGTC1_EXT): return 4; @@ -948,14 +948,14 @@ unsigned int Image::computeBlockSize(GLenum pixelFormat, GLenum packing) { switch(pixelFormat) { - case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): - case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): - case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): - case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): - return osg::maximum(8u, packing); // block size of 8 - case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): - case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): - case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): + case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): + case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): + case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): + case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): + return osg::maximum(8u, packing); // block size of 8 + case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): + case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): + case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT): case(GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG): case(GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG): @@ -1106,12 +1106,12 @@ bool Image::isCompressed() const case(GL_COMPRESSED_RGBA_ARB): case(GL_COMPRESSED_RGB_ARB): case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): - case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): - case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): - case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): - case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): - case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): - case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): + case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): + case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): + case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): + case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): + case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): + case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT): case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT): case(GL_COMPRESSED_RED_RGTC1_EXT): @@ -2030,11 +2030,11 @@ bool Image::isImageTranslucent() const case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): return false; - case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): - case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): - case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): - case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): - case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): + case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): + case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): + case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): + case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): + case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT): return dxtc_tool::isCompressedImageTranslucent(_s, _t, _pixelFormat, _data); default: diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index b286acc52..8a1faa0b4 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -304,18 +304,18 @@ void Texture::TextureProfile::computeSize() case(GL_RGBA): numBitsPerTexel = 32; break; case(4): numBitsPerTexel = 32; break; - case(GL_COMPRESSED_ALPHA_ARB): numBitsPerTexel = 4; break; - case(GL_COMPRESSED_INTENSITY_ARB): numBitsPerTexel = 4; break; + case(GL_COMPRESSED_ALPHA_ARB): numBitsPerTexel = 4; break; + case(GL_COMPRESSED_INTENSITY_ARB): numBitsPerTexel = 4; break; case(GL_COMPRESSED_LUMINANCE_ALPHA_ARB): numBitsPerTexel = 4; break; - case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): numBitsPerTexel = 4; break; - case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): numBitsPerTexel = 4; break; - case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): numBitsPerTexel = 4; break; - case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): numBitsPerTexel = 4; break; - - case(GL_COMPRESSED_RGB_ARB): numBitsPerTexel = 8; break; - case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): numBitsPerTexel = 8; break; - case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): numBitsPerTexel = 8; break; - case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): numBitsPerTexel = 8; break; + case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): numBitsPerTexel = 4; break; + case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): numBitsPerTexel = 4; break; + case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): numBitsPerTexel = 4; break; + case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): numBitsPerTexel = 4; break; + + case(GL_COMPRESSED_RGB_ARB): numBitsPerTexel = 8; break; + case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): numBitsPerTexel = 8; break; + case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): numBitsPerTexel = 8; break; + case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): numBitsPerTexel = 8; break; case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT): numBitsPerTexel = 8; break; case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT): numBitsPerTexel = 4; break; @@ -1797,8 +1797,8 @@ bool Texture::isCompressedInternalFormat(GLint internalFormat) case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): - case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): - case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): + case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): + case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT): case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT): case(GL_COMPRESSED_RED_RGTC1_EXT): @@ -2156,19 +2156,19 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima OSG_NOTICE<<"Received a request to compress an image, but image size is not a multiple of four ("<> 2) * ((height + 3) >> 2); switch(format) { - case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): - case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): - return false; - - case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): + case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): + case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): + return false; + + case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): { const DXT1TexelsBlock *texelsBlock = reinterpret_cast(imageData);