Ryan C. Gordon
2011-05-10 838eea777ec1922ac887f6fa94a920768c1bbe0c

Ignore DDSCAPS_ALPHA flag.

1 files modified
4 ■■■ changed files
mojodds.c 4 ●●● patch | view | raw | blame | history
mojodds.c
@@ -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.