diff options
author | CrystalPT <CrystalPT@svn> | 2010-07-03 03:11:40 +0000 |
---|---|---|
committer | CrystalPT <CrystalPT@svn> | 2010-07-03 03:11:40 +0000 |
commit | f5c761c5df8acf2dea344f24e628c01b5ea38400 (patch) | |
tree | 33055e2d2dbed7df36d44b05812fd0b45acc754a /guilib | |
parent | af64b1551789f6fc1aac2945939164380c24fe7c (diff) |
changed: improved parsing of pixel format in .dds files
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@31589 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib')
-rw-r--r-- | guilib/DDSImage.cpp | 21 | ||||
-rw-r--r-- | guilib/DDSImage.h | 7 |
2 files changed, 20 insertions, 8 deletions
diff --git a/guilib/DDSImage.cpp b/guilib/DDSImage.cpp index 34d1489e89..9163f94d8c 100644 --- a/guilib/DDSImage.cpp +++ b/guilib/DDSImage.cpp @@ -61,14 +61,19 @@ unsigned int CDDSImage::GetHeight() const unsigned int CDDSImage::GetFormat() const { - if (strncmp((const char *)&m_desc.pixelFormat.fourcc, "DXT1", 4) == 0) - return XB_FMT_DXT1; - if (strncmp((const char *)&m_desc.pixelFormat.fourcc, "DXT3", 4) == 0) - return XB_FMT_DXT3; - if (strncmp((const char *)&m_desc.pixelFormat.fourcc, "DXT5", 4) == 0) - return XB_FMT_DXT5; - if (strncmp((const char *)&m_desc.pixelFormat.fourcc, "ARGB", 4) == 0) - return XB_FMT_A8R8G8B8; + if (m_desc.pixelFormat.flags & DDPF_RGB) + return 0; // Not supported + if (m_desc.pixelFormat.flags & DDPF_FOURCC) + { + if (strncmp((const char *)&m_desc.pixelFormat.fourcc, "DXT1", 4) == 0) + return XB_FMT_DXT1; + if (strncmp((const char *)&m_desc.pixelFormat.fourcc, "DXT3", 4) == 0) + return XB_FMT_DXT3; + if (strncmp((const char *)&m_desc.pixelFormat.fourcc, "DXT5", 4) == 0) + return XB_FMT_DXT5; + if (strncmp((const char *)&m_desc.pixelFormat.fourcc, "ARGB", 4) == 0) + return XB_FMT_A8R8G8B8; + } return 0; } diff --git a/guilib/DDSImage.h b/guilib/DDSImage.h index f4f0eaf7fd..b814e62e99 100644 --- a/guilib/DDSImage.h +++ b/guilib/DDSImage.h @@ -114,6 +114,13 @@ private: uint32_t aBitMask; } ddpixelformat; +#define DDPF_ALPHAPIXELS 0x00000001 +#define DDPF_ALPHA 0x00000002 +#define DDPF_FOURCC 0x00000004 +#define DDPF_RGB 0x00000040 +#define DDPF_YUV 0x00000200 +#define DDPF_LUMINANCE 0x00020000 + typedef struct { uint32_t flags1; |