NEXTPTR
word of the first cel's CCB must point to the address (absolute or relative) of the CCB of the next cel. That cel's CCB must point (using NEXTPTR
) to the CCB of the next cel. And that cel's CCB must point to the CCB of the following cel. This chain of pointers ends at the CCB of the last cel in the group, which must have the LAST
flag of the FLAGS
word set to 1. This tells the cel engine to stop projection after it reaches this cel. The NEXTPTR
value of the last cel is ignored by the cel engine.
NEXTPTR
values in the CCBs for a linked group of cels. However, when prefabricated cels and their CCBs are loaded from CD-ROM files into RAM, it is impossible to know at their creation just where the set of CCBs will end up in RAM. In that case, it is best to use relative addressing for NEXTPTR
values.A relative address is figured as the offset from the current CCB's own address. This call returns a relative address:
long MakeCCBRelative( field, linkObject )
NEXTPTR
). The second argument should be the current absolute address of the next instance of the linked object (in this case, a CCB). For example, the following call fills in NEXTPTR
of one CCB with a relative address to the next CCB:
cel->ccb_NextPtr = (CCB *)MakeCCBRelative( &cel-> ccb_NextPtr, &NextCel );
NPABS
control flag in the FLAGS
word should be set to show that the address is relative.
int32 DrawCels( item bitmapItem, CCB *ccb)
To render a cel across different bitmaps within a multibitmap screen (or within a single-bitmap screen), use this call:
int32 DrawScreenCels( Item screenItem, CCB *ccb )
Once a cel is projected into the frame buffer, it remains written there until another cel is projected over it, primitive drawing commands draw over it, or the background is refreshed through the SPORT bus or other means.