| 303 | |
| 304 | |
| 305 | ILboolean ILAPIENTRY ilRegisterMipNum(ILuint Num) |
| 306 | { |
| 307 | ILimage *Next, *Prev; |
| 308 | |
| 309 | ilBindImage(ilGetCurName()); // Make sure the current image is actually bound. |
| 310 | ilCloseImage(iCurImage->Mipmaps); // Close any current mipmaps. |
| 311 | |
| 312 | iCurImage->Mipmaps = NULL; |
| 313 | if (Num == 0) // Just gets rid of all the mipmaps. |
| 314 | return IL_TRUE; |
| 315 | |
| 316 | iCurImage->Mipmaps = ilNewImage(1, 1, 1, 1, 1); |
| 317 | if (iCurImage->Mipmaps == NULL) |
| 318 | return IL_FALSE; |
| 319 | Next = iCurImage->Mipmaps; |
| 320 | Num--; |
| 321 | |
| 322 | while (Num) { |
| 323 | Next->Next = ilNewImage(1, 1, 1, 1, 1); |
| 324 | if (Next->Next == NULL) { |
| 325 | // Clean up before we error out. |
| 326 | Prev = iCurImage->Mipmaps; |
| 327 | while (Prev) { |
| 328 | Next = Prev->Next; |
| 329 | ilCloseImage(Prev); |
| 330 | Prev = Next; |
| 331 | } |
| 332 | return IL_FALSE; |
| 333 | } |
| 334 | Next = Next->Next; |
| 335 | Num--; |
| 336 | } |
| 337 | |
| 338 | return IL_TRUE; |
| 339 | } |
| 340 | |
| 341 | |
| 342 | ILboolean ILAPIENTRY ilRegisterNumImages(ILuint Num) |
nothing calls this directly
no test coverage detected