Internal function used to check if the HEADER is a valid .dds header.
| 151 | |
| 152 | // Internal function used to check if the HEADER is a valid .dds header. |
| 153 | ILboolean iCheckDds(DDSHEAD *Head) |
| 154 | { |
| 155 | if (strncmp((const char*)Head->Signature, "DDS ", 4)) |
| 156 | return IL_FALSE; |
| 157 | //note that if Size1 is "DDS " this is not a valid dds file according |
| 158 | //to the file spec. Some broken tool out there seems to produce files |
| 159 | //with this value in the size field, so we support reading them... |
| 160 | if (Head->Size1 != 124 && Head->Size1 != IL_MAKEFOURCC('D', 'D', 'S', ' ')) |
| 161 | return IL_FALSE; |
| 162 | if (Head->Size2 != 32) |
| 163 | return IL_FALSE; |
| 164 | if (Head->Width == 0 || Head->Height == 0) |
| 165 | return IL_FALSE; |
| 166 | return IL_TRUE; |
| 167 | } |
| 168 | |
| 169 | |
| 170 | //! Reads a .dds file |
no outgoing calls
no test coverage detected