mirror of
https://github.com/softdorothy/GliderPRO.git
synced 2024-11-26 18:49:33 +00:00
1 line
19 KiB
C
1 line
19 KiB
C
|
//============================================================================
//----------------------------------------------------------------------------
// Render.c
//----------------------------------------------------------------------------
//============================================================================
#include "Externs.h"
#include "Environ.h"
#include "MainWindow.h"
#include "Objects.h"
#include "Play.h"
#include "Player.h"
#include "RectUtils.h"
#include "Room.h"
#include "RubberBands.h"
#define kMaxGarbageRects 48
void DrawReflection (gliderPtr, Boolean);
void RenderFlames (void);
void RenderPendulums (void);
void RenderFlyingPoints (void);
void RenderSparkles (void);
void RenderStars (void);
void RenderBands (void);
void RenderShreds (void);
void CopyRectsQD (void);
void CopyRectsAssm (void);
Rect work2MainRects[kMaxGarbageRects];
Rect back2WorkRects[kMaxGarbageRects];
Rect shieldRect;
RgnHandle mirrorRgn;
Point shieldPt;
long nextFrame;
short numWork2Main, numBack2Work;
Boolean hasMirror;
extern bandPtr bands;
extern sparklePtr sparkles;
extern flyingPtPtr flyingPoints;
extern flamePtr flames, tikiFlames, bbqCoals;
extern pendulumPtr pendulums;
extern starPtr theStars;
extern shredPtr shreds;
extern Rect sparkleSrc[];
extern Rect pointsSrc[];
extern Rect bandRects[];
extern savedType savedMaps[];
extern Rect shadowSrc[], justRoomsRect, movieRect;
extern short numBands, numStars, numShredded;
extern short numSparkles, numFlyingPts, numPendulums, clockFrame;
extern short numFlames, numSavedMaps, numTikiFlames, numCoals;
extern Boolean evenFrame, shadowVisible, twoPlayerGame, tvOn;
//============================================================== Functions
//-------------------------------------------------------------- AddRectToWorkRects
void AddRectToWorkRects (Rect *theRect)
{
if (numWork2Main < (kMaxGarbageRects - 1))
{
work2MainRects[numWork2Main] = *theRect;
if (work2MainRects[numWork2Main].left < justRoomsRect.left)
work2MainRects[numWork2Main].left = justRoomsRect.left;
else if (work2MainRects[numWork2Main].right > justRoomsRect.right)
work2MainRects[numWork2Main].right = justRoomsRect.right;
if (work2MainRects[numWork2Main].top < justRoomsRect.top)
work2MainRects[numWork2Main].top = justRoomsRect.top;
else if (work2MainRects[numWork2Main].bottom > justRoomsRect.bottom)
work2MainRects[numWork2Main].bottom = justRoomsRect.bottom;
numWork2Main++;
}
}
//-------------------------------------------------------------- AddRectToBackRects
void AddRectToBackRects (Rect *theRect)
{
if (numBack2Work < (kMaxGarbageRects - 1))
{
back2WorkRects[numBack2Work] = *theRect;
if (back2WorkRects[numBack2Work].left < 0)
back2WorkRects[numBack2Work].left = 0;
else if (back2WorkRects[numBack2Work].right > workSrcRect.right)
back2WorkRects[numBack2Work].right = workSrcRect.right;
if (back2WorkRects[numBack2Work].top < 0)
back2WorkRects[numBack2Work].top = 0;
else if (back2WorkRects[numBack2Work].bottom > workSrcRect.bottom)
back2WorkRects[numBack2Work].bottom = workSrcRect.bottom;
numBack2Work++;
}
}
//-------------------------------------------------------------- AddRectToWorkRectsWhole
void AddRectToWorkRectsWhole (Rect *theRect)
{
if (numWork2Main < (kMaxGarbageRects - 1))
{
if ((theRect->right <= workSrcRect.left) ||
(theRect->bottom <= workSrcRect.top) ||
(theRect->left >= workSrcRect.right) ||
(theRect->top >= workSrcRect.bottom))
return;
work2MainRects[numWork2Main] = *theRect;
if (work2MainRects[numWork2Main].left < workSrcRect.left)
work2MainRects[numWork2Main].left = workSrcRect.left;
else if (work2MainRects[numWork2Main].right > workSrcRect.right)
work2MainRects[numWork2Main].right = workSrcRect.right;
if (work2MainRects[numWork2Main].top < workSrcRect.top)
work2MainRects[numWork2Main].top = workSrcRect.top;
else if (work2MainRects[numWork2Main].bottom > workSrcRect.bottom)
work2MainRects[numWork2Main].bottom = workSrcRect.bottom;
if ((work2MainRe
|