Improved indentation

This commit is contained in:
Robert Osfield 2018-03-12 15:12:44 +00:00
parent 556089e6a1
commit 7ce1938543

View File

@ -241,7 +241,7 @@ Image::Image(const Image& image,const CopyOp& copyop):
{ {
unsigned int size = image.getTotalSizeInBytesIncludingMipmaps(); unsigned int size = image.getTotalSizeInBytesIncludingMipmaps();
setData(new unsigned char [size],USE_NEW_DELETE); setData(new unsigned char [size],USE_NEW_DELETE);
if (unsigned char* dest_ptr = _data) if (unsigned char* dest_ptr = _data)
{ {
for(DataIterator itr(&image); itr.valid(); ++itr) for(DataIterator itr(&image); itr.valid(); ++itr)
{ {
@ -813,7 +813,7 @@ osg::Vec3i Image::computeBlockFootprint(GLenum pixelFormat) {
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT) : case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT) :
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT) : case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT) :
return osg::Vec3i(4,4,4);//opengl 3d dxt: r value means (max)4 consecutive blocks in r direction packed into a slab. return osg::Vec3i(4,4,4);//opengl 3d dxt: r value means (max)4 consecutive blocks in r direction packed into a slab.
case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT) : case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT) :
case(GL_COMPRESSED_RED_RGTC1_EXT) : case(GL_COMPRESSED_RED_RGTC1_EXT) :
case(GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT) : case(GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT) :
@ -863,7 +863,7 @@ osg::Vec3i Image::computeBlockFootprint(GLenum pixelFormat) {
case (GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR) : return osg::Vec3i(10, 10, 1); case (GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR) : return osg::Vec3i(10, 10, 1);
case (GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR) : return osg::Vec3i(12, 10, 1); case (GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR) : return osg::Vec3i(12, 10, 1);
case (GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR) : return osg::Vec3i(12, 12, 1); case (GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR) : return osg::Vec3i(12, 12, 1);
default: default:
break; break;
} }
@ -1611,13 +1611,16 @@ void Image::copySubImage(int s_offset, int t_offset, int r_offset, const osg::Im
if (isCompressed()) if (isCompressed())
{ {
osg::Vec3i footprint = computeBlockFootprint(_pixelFormat); osg::Vec3i footprint = computeBlockFootprint(_pixelFormat);
if (footprint.x() == 4 && footprint.y() == 4) { if (footprint.x() == 4 && footprint.y() == 4)
if ((source->s() & 0x3) || (source->t() & 0x3) || (s_offset & 0x3) || (t_offset & 0x3))
{ {
OSG_WARN << "Error Image::copySubImage() did not succeed : size " << source->s() << "x" << source->t() << " or offset " << s_offset<< "," << t_offset << " not multiple of 4." << std::endl; if ((source->s() & 0x3) || (source->t() & 0x3) || (s_offset & 0x3) || (t_offset & 0x3))
return; {
OSG_WARN << "Error Image::copySubImage() did not succeed : size " << source->s() << "x" << source->t() << " or offset " << s_offset<< "," << t_offset << " not multiple of 4." << std::endl;
return;
}
} }
} else { else
{
if ((source->s() % footprint.x()) || (source->t() % footprint.y()) || (s_offset % footprint.x()) || (t_offset% footprint.y())) if ((source->s() % footprint.x()) || (source->t() % footprint.y()) || (s_offset % footprint.x()) || (t_offset% footprint.y()))
{ {
OSG_WARN << "Error Image::copySubImage() did not succeed : size " << source->s() << "x" << source->t() << " or offset " << s_offset << "," << t_offset << " not multiple of footprint " << footprint.x() << "x" << footprint.y() << std::endl; OSG_WARN << "Error Image::copySubImage() did not succeed : size " << source->s() << "x" << source->t() << " or offset " << s_offset << "," << t_offset << " not multiple of footprint " << footprint.x() << "x" << footprint.y() << std::endl;