CCB * CrossFadeCels8 (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, or it can 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 cel's 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/assumptions mentioned above, any type of cels should work just fine (EG, coded/uncoded, packed/not-packed, any flags settings, any PLUT values, any size/perspective mapping, etc.). The two cels can be different types (EG, oldCel is coded6/newCel is uncoded16, oldCel is LRFORM/newCel isn't, etc.).
Each cel is drawn just once; no intermediate pre-scale-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'the one that restores the PIXCwords. You can also call any step multiple times.
CrossFadeCels