Pararena2/Sources/RenderQD.c

1 line
30 KiB
C
Raw Permalink Normal View History

/*============================================================*/ /*============================================================*/ /*== ==*/ /*== QuickDraw Rendering Routines ==*/ /*== ==*/ /*============================================================*/ /*============================================================*/ /*======================================================== Includes */ #include "Globals.h" #include "UnivUtilities.h" #include "RenderQD.h" #include "Render.h" #include "PlayUtils.h" /*======================================================== Functions */ /*======================================================== RenderSceneQD1 */ void RenderSceneQD1 (void) { Rect wholeBall, wholePlayer, wholeOpponent, wholeCursor; /* find union of old & new position rects */ UnionRect(&thePlayer.isRect, &thePlayer.wasRect, &wholePlayer); UnionRect(&theOpponent.isRect, &theOpponent.wasRect, &wholeOpponent); UnionRect(&theBall.isRect, &theBall.wasRect, &wholeBall); UnionRect(&boardCursor.isRect, &boardCursor.wasRect, &wholeCursor); /* dick with the door */ if (theDoor.stateChanged) { CopyBits(&offPartsBits, &offWorkBits, &theDoor.srcRects[theDoor.doorOpen][theDoor.doorState], &theDoor.destRects[theDoor.doorOpen], srcCopy, kNilPointer); CopyBits(&offWorkBits, &offBackBits, &theDoor.destRects[theDoor.doorOpen], &theDoor.destRects[theDoor.doorOpen], srcCopy, kNilPointer); } if ((showBoardCursor) && (!disableBoardCursor) && (drawThisFrame)) { CopyMask(&offPartsBits, &offMaskMap, &offWorkBits, &boardCursor.srcRect, &boardCursor.srcRect, &boardCursor.isRect); } if ((theBall.mode == kBallRolling) && (!theBall.dontDraw) && (drawThisFrame)) CopyMask(&offPartsBits, &offMaskMap, &offWorkBits, &theBall.srcRect, &theBall.srcRect, &theBall.isRect); /* mask the bastards to the work map - back to front! */ if (playerInBack) { if ((thePlayer.mode != kInStasis) && (drawThisFrame)) CopyMask(&offPartsBits, &offMaskMap, &offWorkBits, &thePlayer.srcRect, &thePlayer.maskRect, &thePlayer.isRect); if ((theOpponent.mode != kInStasis) && (drawThisFrame)) CopyMask(&offPartsBits, &offMaskMap, &offWorkBits, &theOpponent.srcRect, &theOpponent.maskRect, &theOpponent.isRect); } else { if ((theOpponent.mode != kInStasis) && (drawThisFrame)) CopyMask(&offPartsBits, &offMaskMap, &offWorkBits, &theOpponent.srcRect, &theOpponent.maskRect, &theOpponent.isRect); if ((thePlayer.mode != kInStasis) && (drawThisFrame)) CopyMask(&offPartsBits, &offMaskMap, &offWorkBits, &thePlayer.srcRect, &thePlayer.maskRect, &thePlayer.isRect); } /* blast them to the screen */ if ((thePlayer.mode != kInStasis) && (drawThisFrame)) { CopyBits(&offWorkBits, &(mainWndo->portBits), &wholePlayer, &wholePlayer, srcCopy, kNilPointer); } if ((theOpponent.mode != kInStasis) && (drawThisFrame)) { CopyBits(&offWorkBits, &(mainWndo->portBits), &wholeOpponent, &wholeOpponent, srcCopy, kNilPointer); } if ((theBall.mode == kBallRolling) && (drawThisFrame)) { CopyBits(&offWorkBits, &(mainWndo->portBits), &wholeBall, &wholeBall, srcCopy, kNilPointer); } else if (theBall.eraseTheBall) { CopyBits(&offWorkBits, &(mainWndo->portBits), &theBall.eraser, &theBall.eraser, srcCopy, kNilPointer); theBall.eraseTheBall = FALSE; } if ((showBoardCursor) && (!disableBoardCursor) && (drawThisFrame)) { CopyBits(&offWorkBits, &(mainWndo->portBits), &wholeCursor, &wholeCursor, srcCopy, kNilPointer); } /* and re-dick with the door */ if (theDoor.stateChanged) { CopyBits(&offWorkBits, &(mainWndo->portBits), &theDoor.destRects[theDoor.doorOpen], &theDoor.destRects[theDoor.doorOpen], srcCopy, kNilPointer); CopyBits(&offPartsBits, &offBackBits, &theDoor.srcRects[theDoor.doorOpen][theDoor.doorState], &theDoor.destRects[theDoor.doorOpen], srcCopy, kNilPointer); CopyBits(&offWorkBits, &offBackBits, &theDoor.destRects[theDoor.doorOpen], &theDoor.destRects[theDoor.doorOp