AmaroK86.ImageFormat.DDSImage.getFormat C# (CSharp) Method

getFormat() private method

private getFormat ( ) : DDSFormat
return DDSFormat
        private DDSFormat getFormat()
        {
            switch (header.ddspf.dwFourCC)
            {
                case FOURCC_DXT1: return DDSFormat.DXT1;
                case FOURCC_DXT5: return DDSFormat.DXT5;
                case FOURCC_ATI2: return DDSFormat.ATI2;
                case 0: if (header.ddspf.dwRGBBitCount == 0x10 &&
                           header.ddspf.dwRBitMask == 0xFF &&
                           header.ddspf.dwGBitMask == 0xFF00 &&
                           header.ddspf.dwBBitMask == 0x00 &&
                           header.ddspf.dwABitMask == 0x00)
                        return DDSFormat.V8U8;
                    break;
                default: break;
            }
            throw new Exception("invalid texture format");
        }