Used for setting the current image if it is an animation.
| 339 | |
| 340 | //! Used for setting the current image if it is an animation. |
| 341 | ILboolean ILAPIENTRY ilActiveImage(ILuint Number) |
| 342 | { |
| 343 | ILuint Current; |
| 344 | ILimage *iTempImage; |
| 345 | |
| 346 | if (iCurImage == NULL) { |
| 347 | ilSetError(IL_ILLEGAL_OPERATION); |
| 348 | return IL_FALSE; |
| 349 | } |
| 350 | |
| 351 | if (Number == 0) { |
| 352 | return IL_TRUE; |
| 353 | } |
| 354 | |
| 355 | iTempImage = iCurImage; |
| 356 | iCurImage = iCurImage->Next; |
| 357 | if (iCurImage == NULL) { |
| 358 | iCurImage = iTempImage; |
| 359 | ilSetError(IL_ILLEGAL_OPERATION); |
| 360 | return IL_FALSE; |
| 361 | } |
| 362 | |
| 363 | Number--; // Skip 0 (parent image) |
| 364 | for (Current = 0; Current < Number; Current++) { |
| 365 | iCurImage = iCurImage->Next; |
| 366 | if (iCurImage == NULL) { |
| 367 | ilSetError(IL_ILLEGAL_OPERATION); |
| 368 | iCurImage = iTempImage; |
| 369 | return IL_FALSE; |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | ParentImage = IL_FALSE; |
| 374 | |
| 375 | return IL_TRUE; |
| 376 | } |
| 377 | |
| 378 | |
| 379 | //! Used for setting the current face if it is a cubemap. |
nothing calls this directly
no test coverage detected