DevIL icon indicating copy to clipboard operation
DevIL copied to clipboard

ilActiveImage() is unclear

Open bcampbell opened this issue 8 years ago • 1 comments

I've run into an oddity with ilActiveImage(), the function for switching between frames in a multi-frame image. I would have assumed that you could iterate through frames like this:

int numFrames = ilGetInteger(IL_NUM_IMAGES);
for (i=0; i<numFrames; ++i) {
    ilActiveImage(i);
    ... do stuff to the frame ...
}

However, this doesn't do what you'd probably expect. Instead, it skips though frames 0,1,2,4,8,16 etc... until it runs off the end. This is because it jumps to the Nth frame of the current image, rather than the root image (frame 0).

I'm pretty sure this is a bug, but I thought I should make sure before I fix it...

bcampbell avatar Jul 25 '16 09:07 bcampbell

While on the subject of multiple frames, it looks to me like the AnimList & AnimSize members in ILimage are unused. It looks to me like they are superseded by the Next chain instead. Can anyone confirm that?

bcampbell avatar Jul 25 '16 10:07 bcampbell