Helper function to convert IWI formats to DevIL formats and Bpp.
| 223 | |
| 224 | // Helper function to convert IWI formats to DevIL formats and Bpp. |
| 225 | ILenum IwiGetFormat(ILubyte Format, ILubyte *Bpp) |
| 226 | { |
| 227 | switch (Format) |
| 228 | { |
| 229 | case IWI_ARGB8: |
| 230 | *Bpp = 4; |
| 231 | return IL_BGRA; |
| 232 | case IWI_RGB8: |
| 233 | *Bpp = 3; |
| 234 | return IL_BGR; |
| 235 | case IWI_ARGB4: |
| 236 | *Bpp = 4; |
| 237 | return IL_BGRA; |
| 238 | case IWI_A8: |
| 239 | *Bpp = 1; |
| 240 | return IL_ALPHA; |
| 241 | case IWI_DXT1: |
| 242 | *Bpp = 4; |
| 243 | return IL_RGBA; |
| 244 | case IWI_DXT3: |
| 245 | *Bpp = 4; |
| 246 | return IL_RGBA; |
| 247 | case IWI_DXT5: |
| 248 | *Bpp = 4; |
| 249 | return IL_RGBA; |
| 250 | } |
| 251 | |
| 252 | return 0; // Will never reach this. |
| 253 | } |
| 254 | |
| 255 | |
| 256 | // Function to intialize the mipmaps and determine the number of mipmaps. |