The CCB Structure
The example below shows the structure definition for a CCB, taken from
graphics.h (part of the 3DO development environment #include files). The
comments explaining the different types are not in the header file, but
are included here for your information.
Caution: The datatypes of the different fields differ; a common source of programming problems.
Example 1: The CCB structure
typedef struct CCB {
uint32 ccb_Flags;
struct CCB *ccb_NextPtr;
CelData *ccb_SourcePtr;
void *ccb_PLUTPtr;
Coord ccb_XPos; /*16.16 (not int32!)*/
Coord ccb_YPos; /*16.16 (not int32!)*/
int32 ccb_HDX; /*12.20*/
int32 ccb_HDY; /*12.20*/
int32 ccb_VDX; /*16.16*/
int32 ccb_VDY; /*16.16*/
int32 ccb_HDDX; /*12.20, increment for drawing
*/
int32 ccb_HDDY; /*12.20, increment for drawing
*/
uint32 ccb_PIXC; /*P-Mode bit*/
uint32 ccb_PRE0; /*preamble*/
uint32 ccb_PRE1; /**preamble*/
int32 ccb_Width; /*don't change, change position
instead*
int32 ccb_Height; /*don't change, change position
instead*/
} CCB;
Frequently Accessed CCB Fields
About one-third of the fields in the CCB pertain to the cel's basic source
data.
ccb_SourcePtr
-a pointer to the data
ccb_PLUTPtr
-a pointer to the palette
ccb_PRE0
and ccb_PRE1
-two possible "preamble
words" that store extra data in some cel formats
ccb_Width
and ccb_Height
-the width and
height of the source data
ccb_XPos
and ccb_YPos
-the location of the
upper-left corner of the cel
ccB_Width
and ccB_Height
. This
gives the illusion of the beam in the jsanimation program.