MCPcopy Create free account
hub / github.com/DentonW/DevIL / ILAPIENTRY ilActiveLayer

Function ILAPIENTRY ilActiveLayer

DevIL/src-IL/src/il_stack.cpp:420–455  ·  view source on GitHub ↗

Used for setting the current layer if layers exist.

Source from the content-addressed store, hash-verified

418
419//! Used for setting the current layer if layers exist.
420ILboolean ILAPIENTRY ilActiveLayer(ILuint Number)
421{
422 ILuint Current;
423 ILimage *iTempImage;
424
425 if (iCurImage == NULL) {
426 ilSetError(IL_ILLEGAL_OPERATION);
427 return IL_FALSE;
428 }
429
430 if (Number == 0) {
431 return IL_TRUE;
432 }
433
434 iTempImage = iCurImage;
435 iCurImage = iCurImage->Layers;
436 if (iCurImage == NULL) {
437 iCurImage = iTempImage;
438 ilSetError(IL_ILLEGAL_OPERATION);
439 return IL_FALSE;
440 }
441
442 //Number--; // Skip 0 (parent image)
443 for (Current = 1; Current < Number; Current++) {
444 iCurImage = iCurImage->Layers;
445 if (iCurImage == NULL) {
446 ilSetError(IL_ILLEGAL_OPERATION);
447 iCurImage = iTempImage;
448 return IL_FALSE;
449 }
450 }
451
452 ParentImage = IL_FALSE;
453
454 return IL_TRUE;
455}
456
457
458ILuint ILAPIENTRY ilCreateSubImage(ILenum Type, ILuint Num)

Callers

nothing calls this directly

Calls 1

ilSetErrorFunction · 0.85

Tested by

no test coverage detected