CCB * CrossFadeCels (Item screen, int32 step, CCB *oldCel, CCB *newCel)
The screen parameter can be either a Screen or Bitmap item, in which case the cels are drawn on each call. It can also be zero, in which case the calculations are done but the cels are not drawn. In the latter case, the return value is a pointer to the cels you must draw; the oldCel and newCel CCBs will be linked together in the right order for drawing. As the crossfade progresses the order in which the cels are drawn changes, so if you pass zero for the screen item you must draw the cels based on this function's return value.
This function make certain assumptions about the cels. If the cels don't match the assumptions your mileage may vary, visually. Both cels should be single cels, not lists of cels and not anti-aliased cels. Both cels should project to the same screen area. If the cels contain transparency in differing locations and there are non-black pixels under the transparency area in the bitmap, the results may not be what you expect in that area. Coded-8 cels won't work because their AMV-based scaling can't be mixed with the PIXC-based scaling set up by this function. The ccb_NextPtr, PIXC word, and CCB_LAST flag values in both cels are modified on each call. After the last call (step=15) both cel's PIXC words are reset to 0x1F001F00, both cel's CCB_LAST flags are set, and both cels' ccb_NextPtr links are NULL. If this doesn't work for your needs, save and restore these values yourself, or clone the CCBs and pass the clones to this function.
Other than the limitations and assumptions mentioned above, any type of cels should work just fine (E.G., coded/uncoded, packed/not-packed, any flags settings, any PLUT values, any size/perspective mapping, etc.). The two cels can be different types.
Each cel is drawn just once; no intermediate prescale-the-bitmap drawing is done.
This function is coded so that you can start at any fade level, and skip intermediate levels if you want. The last step should not be skipped, because it's the one that restores the PIXC words. You can call anystep multiple times.
CrossFadeCels8