From Vladimir Shabanov, "The DDS plugin didn't correctly read mipmapped A8L8 textures.

I've attached a small fix for this.

Cause: uncompressed mipmap handling was done only for RGB pixel format.

Fix: added condition for handling alpha and luminance formats too."
This commit is contained in:
Robert Osfield
2006-10-30 12:23:37 +00:00
parent baeb41a416
commit f9b9efec16

View File

@@ -392,7 +392,7 @@ osg::Image* ReadDDSFile(std::istream& _istream)
//###[afarre_051904] osgImage->setMipmapData(mipmaps);
}
// Handle uncompressed mipmaps
if(ddsd.ddpfPixelFormat.dwFlags & DDPF_RGB)
if(ddsd.ddpfPixelFormat.dwFlags & (DDPF_RGB | DDPF_LUMINANCE | DDPF_ALPHA))
{
int offset = 0;
int width = ddsd.dwWidth;