Sets the current mipmap level
| 301 | |
| 302 | //! Sets the current mipmap level |
| 303 | ILboolean ILAPIENTRY ilActiveMipmap(ILuint Number) |
| 304 | { |
| 305 | ILuint Current; |
| 306 | ILimage *iTempImage; |
| 307 | |
| 308 | if (iCurImage == NULL) { |
| 309 | ilSetError(IL_ILLEGAL_OPERATION); |
| 310 | return IL_FALSE; |
| 311 | } |
| 312 | |
| 313 | if (Number == 0) { |
| 314 | return IL_TRUE; |
| 315 | } |
| 316 | |
| 317 | iTempImage = iCurImage; |
| 318 | iCurImage = iCurImage->Mipmaps; |
| 319 | if (iCurImage == NULL) { |
| 320 | iCurImage = iTempImage; |
| 321 | ilSetError(IL_ILLEGAL_OPERATION); |
| 322 | return IL_FALSE; |
| 323 | } |
| 324 | |
| 325 | for (Current = 1; Current < Number; Current++) { |
| 326 | iCurImage = iCurImage->Mipmaps; |
| 327 | if (iCurImage == NULL) { |
| 328 | ilSetError(IL_ILLEGAL_OPERATION); |
| 329 | iCurImage = iTempImage; |
| 330 | return IL_FALSE; |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | ParentImage = IL_FALSE; |
| 335 | |
| 336 | return IL_TRUE; |
| 337 | } |
| 338 | |
| 339 | |
| 340 | //! Used for setting the current image if it is an animation. |
nothing calls this directly
no test coverage detected