A: Several factors influence rendering speed:
A new feature called super clipping helps speed things up when portions of a cel extend beyond the boundaries of the screen.
Q: I am drawing a cel in a variety of shapes and sizes. Are there any guidelines to determine the optimum size (number of pixels) for the original image?
A: Here are two hints for drawing cels quickly:
CPU and DMA
Q: The 3DO system uses the DMA when displaying cels. Can the CPU do other work during that time?
A: When the cel engine is running, the CPU can't operate. When the cel engine finishes, the CPU can operate again.
Remember, however, that the cel engine renders graphics much faster than the CPU.
The cel engine pauses for CPU interrupts so that time critical events to maintain the system still function.
When Cel-Display Calls Return
Q: I need to determine when a display process starts and be notified when it's finished.
A: A DisplayScreen()
call returns immediately. The specified screen is displayed after the next vertical blank.
A DrawCels()
call does not return until the cels have been rendered.
Displaying Text as a Cel
Q: How do I render text into a cel so that I can take advantage of the cel engine's features. None of the text calls takes or returns a CCB.
A: Currently text routines can only render into a bitmap, so you need to have the cel engine extract the text from an off-screen bitmap.
Make sure the CCB for the extracting cel correctly represents the data in the off-screen bitmap. Pay special attention to the CCB preamble words.
Using Relative Addressing with Cels
Below is a code snippet. The trick is to use the call MakeCCBRelative
.
CCB* testCelP;
CCB* nextCelP;
// assign the relative offset to the next cel
testCelP->ccb_NextPtr = (CCB*)MakeCCBRelative(&testCelP->ccb_NextPtr,
nextCelP);
// be sure to clear this bit!
ClearFlag(testCelP->ccb_Flags, CCB_NPABS);
The macros MakeCCBRelative and ClearFlag are defined in
graphics.h.