Ignore DDSCAPS_ALPHA flag.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 10 May 2011 00:21:06 -0400
changeset 8 506dbbccee95
parent 7 341c4de6ffd3
child 9 50157857e7d8
Ignore DDSCAPS_ALPHA flag.
mojodds.c
--- a/mojodds.c	Tue May 10 00:08:55 2011 -0400
+++ b/mojodds.c	Tue May 10 00:21:06 2011 -0400
@@ -24,7 +24,6 @@
 
 #define STATICARRAYLEN(x) ( (sizeof ((x))) / (sizeof ((x)[0])) )
 
-
 #define DDS_MAGIC 0x20534444  // 'DDS ' in littleendian.
 #define DDS_HEADERSIZE 124
 #define DDS_PIXFMTSIZE 32
@@ -37,6 +36,7 @@
 #define DDSD_LINEARSIZE 0x80000
 #define DDSD_DEPTH 0x800000
 #define DDSD_REQ (DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_FMT)
+#define DDSCAPS_ALPHA 0x2
 #define DDSCAPS_COMPLEX 0x8
 #define DDSCAPS_MIPMAP 0x400000
 #define DDSCAPS_TEXTURE 0x1000
@@ -144,6 +144,8 @@
     width = header->dwWidth;
     height = header->dwHeight;
 
+    header->dwCaps &= ~DDSCAPS_ALPHA;  // we'll get this from the pixel format.
+
     if (header->dwSize != DDS_HEADERSIZE)   // header size must be 124.
         return 0;
     else if (header->ddspf.dwSize != DDS_PIXFMTSIZE)   // size must be 32.