mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 03:59:36 +00:00
Refactoring. Add line drawing.
This commit is contained in:
@@ -42,13 +42,12 @@ extern Boolean quickerTransitions, demoGoing, isUseSecondScreen;
|
||||
void DrawBanner (Point *topLeft)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
Rect wholePage, partPage, mapBounds;
|
||||
GWorldPtr tempMap;
|
||||
GWorldPtr tempMask;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&wholePage, 0, 0, 330, 220);
|
||||
mapBounds = thisMac.screen;
|
||||
@@ -58,7 +57,7 @@ void DrawBanner (Point *topLeft)
|
||||
topLeft->v = wholePage.top;
|
||||
partPage = wholePage;
|
||||
partPage.bottom = partPage.top + 190;
|
||||
SetGWorld(workSrcMap, nil);
|
||||
SetGraphicsPort(workSrcMap);
|
||||
LoadScaledGraphic(kBannerPageTopPICT, &partPage);
|
||||
|
||||
partPage = wholePage;
|
||||
@@ -66,20 +65,19 @@ void DrawBanner (Point *topLeft)
|
||||
mapBounds = partPage;
|
||||
ZeroRectCorner(&mapBounds);
|
||||
theErr = CreateOffScreenGWorld(&tempMap, &mapBounds, kPreferredDepth);
|
||||
SetGWorld(tempMap, nil);
|
||||
SetGraphicsPort(tempMap);
|
||||
LoadGraphic(kBannerPageBottomPICT);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&tempMask, &mapBounds, 1);
|
||||
SetGWorld(tempMask, nil);
|
||||
SetGraphicsPort(tempMask);
|
||||
LoadGraphic(kBannerPageBottomMask);
|
||||
|
||||
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
|
||||
(BitMap *)*GetGWorldPixMap(tempMask),
|
||||
(BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
&mapBounds, &mapBounds, &partPage);
|
||||
SetPort((GrafPtr)workSrcMap);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
DisposeGWorld(tempMap);
|
||||
DisposeGWorld(tempMask);
|
||||
}
|
||||
@@ -116,11 +114,9 @@ void DrawBannerMessage (Point topLeft)
|
||||
Str255 bannerStr, subStr;
|
||||
short count;
|
||||
|
||||
CGrafPtr wasGWorld;
|
||||
GDHandle wasDevice;
|
||||
GetGWorld(&wasGWorld, &wasDevice);
|
||||
CGrafPtr wasGWorld = GetGraphicsPort();
|
||||
|
||||
SetGWorld(workSrcMap, nullptr);
|
||||
SetGraphicsPort(workSrcMap);
|
||||
|
||||
PasStringCopy((*thisHouse)->banner, bannerStr);
|
||||
|
||||
@@ -163,7 +159,7 @@ void DrawBannerMessage (Point topLeft)
|
||||
}
|
||||
ForeColor(blackColor);
|
||||
|
||||
SetGWorld(wasGWorld, wasDevice);
|
||||
SetGraphicsPort(wasGWorld);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- BringUpBanner
|
||||
|
||||
@@ -289,7 +289,6 @@ void CheckOurEnvirons (void)
|
||||
thisMac.hasQT = DoWeHaveQuickTime();
|
||||
thisMac.hasDrag = DoWeHaveDragManager();
|
||||
|
||||
FindOurDevice();
|
||||
thisMac.can1Bit = true;
|
||||
thisMac.can4Bit = true;
|
||||
thisMac.can8Bit = true;
|
||||
|
||||
@@ -253,23 +253,22 @@ void InitDiedGameOver (void)
|
||||
#define kPageBackUp 128
|
||||
short i;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&pageSrcRect, 0, 0, 25, 32 * 8);
|
||||
theErr = CreateOffScreenGWorld(&gameOverSrcMap, &pageSrcRect, kPreferredDepth);
|
||||
SetGWorld(gameOverSrcMap, nil);
|
||||
SetGraphicsPort(gameOverSrcMap);
|
||||
LoadGraphic(kLettersPictID);
|
||||
|
||||
QSetRect(&pageSrcRect, 0, 0, 32, 32 * kPageFrames);
|
||||
theErr = CreateOffScreenGWorld(&pageSrcMap, &pageSrcRect, kPreferredDepth);
|
||||
SetGWorld(pageSrcMap, nil);
|
||||
SetGraphicsPort(pageSrcMap);
|
||||
LoadGraphic(kPagesPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&pageMaskMap, &pageSrcRect, 1);
|
||||
SetGWorld(pageMaskMap, nil);
|
||||
SetGraphicsPort(pageMaskMap);
|
||||
LoadGraphic(kPagesMaskID);
|
||||
|
||||
for (i = 0; i < kPageFrames; i++) // initialize src page rects
|
||||
|
||||
@@ -103,19 +103,16 @@ void HandleGrease (void)
|
||||
}
|
||||
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
CGrafPtr wasCPort = GetGraphicsPort();
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
|
||||
SetGWorld(backSrcMap, nil);
|
||||
SetGraphicsPort(backSrcMap);
|
||||
PaintRect(&src);
|
||||
|
||||
SetGWorld(workSrcMap, nil);
|
||||
SetGraphicsPort(workSrcMap);
|
||||
PaintRect(&src);
|
||||
AddRectToWorkRects(&src);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
if (grease[i].isRight)
|
||||
@@ -270,7 +267,6 @@ void SpillGrease (short who, short index)
|
||||
void RedrawAllGrease (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
Rect src;
|
||||
short i;
|
||||
|
||||
@@ -286,16 +282,16 @@ void RedrawAllGrease (void)
|
||||
{
|
||||
QOffsetRect(&src, playOriginH, playOriginV);
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
SetGWorld(backSrcMap, nil);
|
||||
SetGraphicsPort(backSrcMap);
|
||||
PaintRect(&src);
|
||||
|
||||
SetGWorld(workSrcMap, nil);
|
||||
SetGraphicsPort(workSrcMap);
|
||||
PaintRect(&src);
|
||||
AddRectToWorkRects(&src);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,6 @@ void DrawHighScores (void)
|
||||
{
|
||||
GWorldPtr tempMap, tempMask;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
houseType *thisHousePtr;
|
||||
Rect tempRect, tempRect2;
|
||||
@@ -107,15 +106,15 @@ void DrawHighScores (void)
|
||||
scoreLeft = ((thisMac.screen.right - thisMac.screen.left) - kScoreWide) / 2;
|
||||
dropIt = 129 + splashOriginV;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&tempRect, 0, 0, 332, 30);
|
||||
theErr = CreateOffScreenGWorld(&tempMap, &tempRect, kPreferredDepth);
|
||||
SetGWorld(tempMap, nil);
|
||||
SetGraphicsPort(tempMap);
|
||||
LoadGraphic(kHighScoresPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&tempMask, &tempRect, 1);
|
||||
SetGWorld(tempMask, nil);
|
||||
SetGraphicsPort(tempMask);
|
||||
LoadGraphic(kHighScoresMaskID);
|
||||
|
||||
tempRect2 = tempRect;
|
||||
@@ -129,7 +128,7 @@ void DrawHighScores (void)
|
||||
DisposeGWorld(tempMap);
|
||||
DisposeGWorld(tempMask);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
TextFont(applFont);
|
||||
TextFace(bold);
|
||||
|
||||
@@ -46,7 +46,6 @@ short splashOriginH, splashOriginV;
|
||||
short theMode;
|
||||
Boolean fadeGraysOut, isDoColorFade, splashDrawn;
|
||||
|
||||
extern GDHandle thisGDevice;
|
||||
extern short toolSelected;
|
||||
extern Boolean noRoomAtAll, isUseSecondScreen;
|
||||
extern Boolean quickerTransitions, houseIsReadOnly;
|
||||
|
||||
@@ -724,19 +724,18 @@ Boolean QueryNewRoom (void)
|
||||
void CreateNailOffscreen (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
if (nailSrcMap == nil)
|
||||
{
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&nailSrcRect, 0, 0, kMapRoomWidth, kMapRoomHeight * (kNumBackgrounds + 1));
|
||||
theErr = CreateOffScreenGWorld(&nailSrcMap, &nailSrcRect, kPreferredDepth);
|
||||
SetGWorld(nailSrcMap, nil);
|
||||
SetGraphicsPort(nailSrcMap);
|
||||
LoadGraphic(kThumbnailPictID);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -38,7 +38,7 @@ void DoMarquee (void)
|
||||
return;
|
||||
|
||||
SetPortWindowPort(mainWindow);
|
||||
PenMode(patXor);
|
||||
PenInvertMode(true);
|
||||
PenPat(&theMarquee.pats[theMarquee.index]);
|
||||
DrawMarquee();
|
||||
theMarquee.index++;
|
||||
@@ -64,7 +64,7 @@ void StartMarquee (Rect *theRect)
|
||||
theMarquee.active = true;
|
||||
theMarquee.paused = false;
|
||||
theMarquee.handled = false;
|
||||
PenMode(patXor);
|
||||
PenInvertMode(true);
|
||||
PenPat(&theMarquee.pats[theMarquee.index]);
|
||||
DrawMarquee();
|
||||
PenNormal();
|
||||
@@ -127,7 +127,7 @@ void StartMarqueeHandled (Rect *theRect, short direction, short dist)
|
||||
theMarquee.direction = direction;
|
||||
theMarquee.dist = dist;
|
||||
|
||||
PenMode(patXor);
|
||||
PenInvertMode(true);
|
||||
PenPat(&theMarquee.pats[theMarquee.index]);
|
||||
DrawMarquee();
|
||||
PenNormal();
|
||||
@@ -148,7 +148,7 @@ void StopMarquee (void)
|
||||
return;
|
||||
|
||||
SetPortWindowPort(mainWindow);
|
||||
PenMode(patXor);
|
||||
PenInvertMode(true);
|
||||
PenPat(&theMarquee.pats[theMarquee.index]);
|
||||
DrawMarquee();
|
||||
PenNormal();
|
||||
@@ -192,7 +192,7 @@ void DragOutMarqueeRect (Point start, Rect *theRect)
|
||||
SetPortWindowPort(mainWindow);
|
||||
InitCursor();
|
||||
QSetRect(theRect, start.h, start.v, start.h, start.v);
|
||||
PenMode(patXor);
|
||||
PenInvertMode(true);
|
||||
PenPat(&theMarquee.pats[theMarquee.index]);
|
||||
FrameRect(theRect);
|
||||
wasPt = start;
|
||||
@@ -222,7 +222,7 @@ void DragMarqueeRect (Point start, Rect *theRect, Boolean lockH, Boolean lockV)
|
||||
|
||||
SetCursor(&handCursor);
|
||||
StopMarquee();
|
||||
PenMode(patXor);
|
||||
PenInvertMode(true);
|
||||
PenPat(&theMarquee.pats[theMarquee.index]);
|
||||
theMarquee.bounds = *theRect;
|
||||
FrameRect(&theMarquee.bounds);
|
||||
@@ -266,7 +266,7 @@ void DragMarqueeHandle (Point start, short *dragged)
|
||||
else
|
||||
SetCursor(&horiCursor);
|
||||
StopMarquee();
|
||||
PenMode(patXor);
|
||||
PenInvertMode(true);
|
||||
PenPat(&theMarquee.pats[theMarquee.index]);
|
||||
FrameRect(&theMarquee.bounds);
|
||||
PaintRect(&theMarquee.handle);
|
||||
@@ -349,7 +349,7 @@ void DragMarqueeCorner (Point start, short *hDragged, short *vDragged, Boolean i
|
||||
|
||||
SetCursor(&diagCursor);
|
||||
StopMarquee();
|
||||
PenMode(patXor);
|
||||
PenInvertMode(true);
|
||||
PenPat(&theMarquee.pats[theMarquee.index]);
|
||||
FrameRect(&theMarquee.bounds);
|
||||
PaintRect(&theMarquee.handle);
|
||||
|
||||
@@ -74,10 +74,9 @@ void DrawTiki (Rect *theRect, short down)
|
||||
#define kTikiPoleBase 300
|
||||
long darkGrayC, lightWoodC, darkWoodC;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
{
|
||||
@@ -106,7 +105,7 @@ void DrawTiki (Rect *theRect, short down)
|
||||
theRect->left + 15, kTikiPoleBase + down - 1, darkGrayC);
|
||||
}
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
CopyMask((BitMap *)*GetGWorldPixMap(blowerSrcMap),
|
||||
(BitMap *)*GetGWorldPixMap(blowerMaskMap),
|
||||
@@ -120,16 +119,15 @@ void DrawInvisibleBlower (Rect *theRect)
|
||||
{
|
||||
Rect tempRect;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
QSetRect(&tempRect, 0, 0, 24, 24);
|
||||
QOffsetRect(&tempRect, theRect->left, theRect->top);
|
||||
|
||||
ColorFrameRect(&tempRect, 192);
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawLiftArea
|
||||
@@ -137,12 +135,11 @@ void DrawInvisibleBlower (Rect *theRect)
|
||||
void DrawLiftArea (Rect *theRect)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
ColorFrameRect(theRect, 192);
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawTable
|
||||
@@ -156,7 +153,6 @@ void DrawTable (Rect *tableTop, short down)
|
||||
long brownC, tanC, dkRedC, blackC;
|
||||
short hCenter, vShadow;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
Pattern dummyPattern;
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
@@ -174,8 +170,8 @@ void DrawTable (Rect *tableTop, short down)
|
||||
blackC = k8BlackColor;
|
||||
}
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
QSetRect(&tempRect, tableTop->left, 0, tableTop->right,
|
||||
RectWide(tableTop) / 10);
|
||||
@@ -183,7 +179,7 @@ void DrawTable (Rect *tableTop, short down)
|
||||
-HalfRectTall(&tempRect) + kTableShadowTop + down);
|
||||
QOffsetRect(&tempRect, kTableShadowOffset, -kTableShadowOffset);
|
||||
PenPat(GetQDGlobalsGray(&dummyPattern));
|
||||
PenMode(patOr);
|
||||
PenMask(true);
|
||||
if (thisMac.isDepth == 4)
|
||||
ColorOval(&tempRect, 15);
|
||||
else
|
||||
@@ -250,7 +246,7 @@ void DrawTable (Rect *tableTop, short down)
|
||||
}
|
||||
}
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
tempRect = tableSrc;
|
||||
QOffsetRect(&tempRect, -HalfRectWide(&tableSrc) + tableTop->left +
|
||||
@@ -273,7 +269,6 @@ void DrawShelf (Rect *shelfTop)
|
||||
long brownC, ltTanC, tanC, dkRedC, blackC;
|
||||
RgnHandle shadowRgn;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
Pattern dummyPattern;
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
@@ -293,8 +288,8 @@ void DrawShelf (Rect *shelfTop)
|
||||
blackC = k8BlackColor;
|
||||
}
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
shadowRgn = NewRgn();
|
||||
if (shadowRgn == nil)
|
||||
@@ -312,7 +307,7 @@ void DrawShelf (Rect *shelfTop)
|
||||
OpenRgn();
|
||||
CloseRgn(shadowRgn);
|
||||
PenPat(GetQDGlobalsGray(&dummyPattern));
|
||||
PenMode(patOr);
|
||||
PenMask(true);
|
||||
if (thisMac.isDepth == 4)
|
||||
ColorRegion(shadowRgn, 15);
|
||||
else
|
||||
@@ -343,7 +338,7 @@ void DrawShelf (Rect *shelfTop)
|
||||
ColorLine(shelfTop->right - 1, shelfTop->top + 1,
|
||||
shelfTop->right - 1, shelfTop->bottom - 2, blackC);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
tempRect = shelfSrc;
|
||||
ZeroRectCorner(&tempRect);
|
||||
@@ -372,7 +367,6 @@ void DrawCabinet (Rect *cabinet)
|
||||
long brownC, dkGrayC, ltTanC, tanC, dkRedC, blackC;
|
||||
RgnHandle shadowRgn;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
Pattern dummyPattern;
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
@@ -394,8 +388,8 @@ void DrawCabinet (Rect *cabinet)
|
||||
blackC = k8BlackColor;
|
||||
}
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
MoveTo(cabinet->left, cabinet->bottom);
|
||||
shadowRgn = NewRgn();
|
||||
@@ -409,7 +403,7 @@ void DrawCabinet (Rect *cabinet)
|
||||
LineTo(cabinet->left, cabinet->bottom);
|
||||
CloseRgn(shadowRgn);
|
||||
PenPat(GetQDGlobalsGray(&dummyPattern));
|
||||
PenMode(patOr);
|
||||
PenMask(true);
|
||||
if (thisMac.isDepth == 4)
|
||||
ColorRegion(shadowRgn, 15);
|
||||
else
|
||||
@@ -462,7 +456,7 @@ void DrawCabinet (Rect *cabinet)
|
||||
ColorLine(cabinet->left + kCabinetDeep + 10, cabinet->bottom - 10,
|
||||
cabinet->right - 11, cabinet->bottom - 10, tanC);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
tempRect = hingeSrc;
|
||||
ZeroRectCorner(&tempRect);
|
||||
@@ -515,7 +509,6 @@ void DrawCounter (Rect *counter)
|
||||
long brownC, dkGrayC, tanC, blackC, dkstRedC;
|
||||
short nRects, width, i;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
Pattern dummyPattern;
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
@@ -535,8 +528,8 @@ void DrawCounter (Rect *counter)
|
||||
dkstRedC = k8DkRed2Color;
|
||||
}
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
MoveTo(counter->right - 2, counter->bottom);
|
||||
shadowRgn = NewRgn();
|
||||
@@ -551,7 +544,7 @@ void DrawCounter (Rect *counter)
|
||||
LineTo(counter->right - 2, counter->bottom);
|
||||
CloseRgn(shadowRgn);
|
||||
PenPat(GetQDGlobalsGray(&dummyPattern));
|
||||
PenMode(patOr);
|
||||
PenMask(true);
|
||||
if (thisMac.isDepth == 4)
|
||||
ColorRegion(shadowRgn, 15);
|
||||
else
|
||||
@@ -628,7 +621,7 @@ void DrawCounter (Rect *counter)
|
||||
ColorLine(counter->left + 1, counter->top + 8,
|
||||
counter->right - 2, counter->top + 8, dkstRedC);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
nRects = RectWide(counter) / 40;
|
||||
if (nRects == 0)
|
||||
@@ -660,7 +653,6 @@ void DrawDresser (Rect *dresser)
|
||||
RgnHandle shadowRgn;
|
||||
short nRects, height, i;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
Pattern dummyPattern;
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
@@ -680,8 +672,8 @@ void DrawDresser (Rect *dresser)
|
||||
dkstRedC = k8DkRed2Color;
|
||||
}
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
MoveTo(dresser->left + 10, dresser->bottom + 9);
|
||||
shadowRgn = NewRgn();
|
||||
@@ -696,7 +688,7 @@ void DrawDresser (Rect *dresser)
|
||||
LineTo(dresser->left + 10, dresser->bottom + 9);
|
||||
CloseRgn(shadowRgn);
|
||||
PenPat(GetQDGlobalsGray(&dummyPattern));
|
||||
PenMode(patOr);
|
||||
PenMask(true);
|
||||
if (thisMac.isDepth == 4)
|
||||
ColorRegion(shadowRgn, 15);
|
||||
else
|
||||
@@ -756,7 +748,7 @@ void DrawDresser (Rect *dresser)
|
||||
QOffsetRect(&tempRect, 0, kDresserTopThick + height);
|
||||
}
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
dest = leftFootSrc;
|
||||
ZeroRectCorner(&dest);
|
||||
@@ -789,7 +781,6 @@ void DrawDeckTable (Rect *tableTop, short down)
|
||||
long bambooC, brownC, dkGrayC;
|
||||
short hCenter, vShadow;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
Pattern dummyPattern;
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
@@ -805,8 +796,8 @@ void DrawDeckTable (Rect *tableTop, short down)
|
||||
dkGrayC = k8DkstGrayColor;
|
||||
}
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
QSetRect(&tempRect, tableTop->left, 0, tableTop->right,
|
||||
RectWide(tableTop) / 10);
|
||||
@@ -814,7 +805,7 @@ void DrawDeckTable (Rect *tableTop, short down)
|
||||
-HalfRectTall(&tempRect) + kTableShadowTop + down);
|
||||
QOffsetRect(&tempRect, kTableShadowOffset, -kTableShadowOffset);
|
||||
PenPat(GetQDGlobalsGray(&dummyPattern));
|
||||
PenMode(patOr);
|
||||
PenMask(true);
|
||||
ColorOval(&tempRect, dkGrayC);
|
||||
PenNormal();
|
||||
|
||||
@@ -878,7 +869,7 @@ void DrawDeckTable (Rect *tableTop, short down)
|
||||
}
|
||||
}
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
tempRect = deckSrc;
|
||||
ZeroRectCorner(&tempRect);
|
||||
@@ -897,10 +888,9 @@ void DrawStool (Rect *theRect, short down)
|
||||
#define kStoolBase 304
|
||||
long grayC, dkGrayC;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
{
|
||||
@@ -929,7 +919,7 @@ void DrawStool (Rect *theRect, short down)
|
||||
theRect->left + 26, kStoolBase + down - 1, dkGrayC);
|
||||
}
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
CopyMask((BitMap *)*GetGWorldPixMap(furnitureSrcMap),
|
||||
(BitMap *)*GetGWorldPixMap(furnitureMaskMap),
|
||||
@@ -942,12 +932,11 @@ void DrawStool (Rect *theRect, short down)
|
||||
void DrawInvisObstacle (Rect *theRect)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
ColorFrameRect(theRect, k8BrownColor);
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawInvisBounce
|
||||
@@ -955,12 +944,11 @@ void DrawInvisObstacle (Rect *theRect)
|
||||
void DrawInvisBounce (Rect *theRect)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
ColorFrameRect(theRect, k8RedColor);
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawRedClock
|
||||
@@ -1071,10 +1059,9 @@ void DrawCuckoo (Rect *theRect)
|
||||
void DrawClockHands (Point where, short bigHand, short littleHand)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
MoveTo(where.h, where.v);
|
||||
switch (bigHand)
|
||||
{
|
||||
@@ -1179,7 +1166,7 @@ void DrawClockHands (Point where, short bigHand, short littleHand)
|
||||
break;
|
||||
}
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawClockHands
|
||||
@@ -1187,10 +1174,9 @@ void DrawClockHands (Point where, short bigHand, short littleHand)
|
||||
void DrawLargeClockHands (Point where, short bigHand, short littleHand)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
ForeColor(whiteColor);
|
||||
|
||||
MoveTo(where.h, where.v);
|
||||
@@ -1298,7 +1284,7 @@ void DrawLargeClockHands (Point where, short bigHand, short littleHand)
|
||||
}
|
||||
|
||||
ForeColor(blackColor);
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawSimplePrizes
|
||||
@@ -1317,7 +1303,6 @@ void DrawGreaseRt (Rect *theRect, short distance, Boolean state)
|
||||
{
|
||||
Rect spill, dest;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
dest = *theRect;
|
||||
if (state) // grease upright
|
||||
@@ -1335,12 +1320,12 @@ void DrawGreaseRt (Rect *theRect, short distance, Boolean state)
|
||||
(BitMap *)*GetGWorldPixMap(backSrcMap),
|
||||
&greaseSrcRt[3], &greaseSrcRt[3], &dest);
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
QSetRect(&spill, 0, -2, distance - 5, 0);
|
||||
QOffsetRect(&spill, dest.right - 1, dest.bottom);
|
||||
PaintRect(&spill);
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1350,7 +1335,6 @@ void DrawGreaseLf (Rect *theRect, short distance, Boolean state)
|
||||
{
|
||||
Rect spill, dest;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
dest = *theRect;
|
||||
if (state) // grease upright
|
||||
@@ -1368,12 +1352,12 @@ void DrawGreaseLf (Rect *theRect, short distance, Boolean state)
|
||||
(BitMap *)*GetGWorldPixMap(backSrcMap),
|
||||
&greaseSrcLf[3], &greaseSrcLf[3], &dest);
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
QSetRect(&spill, -distance + 5, -2, 0, 0);
|
||||
QOffsetRect(&spill, dest.left + 1, dest.bottom);
|
||||
PaintRect(&spill);
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1392,12 +1376,11 @@ void DrawFoil (Rect *theRect)
|
||||
void DrawInvisBonus (Rect *theRect)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
ColorFrameOval(theRect, 227);
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawSlider
|
||||
@@ -1405,11 +1388,10 @@ void DrawInvisBonus (Rect *theRect)
|
||||
void DrawSlider (Rect *theRect)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
FrameRect(theRect);
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
|
||||
@@ -117,11 +117,10 @@ void DrawMailboxLeft (Rect *theRect, short down)
|
||||
GWorldPtr tempMask;
|
||||
long darkGrayC, lightWoodC, darkWoodC;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
{
|
||||
@@ -168,15 +167,15 @@ void DrawMailboxLeft (Rect *theRect, short down)
|
||||
theRect->left + 62, down + kMailboxBase + 3, darkGrayC);
|
||||
}
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
bounds = srcRects[kMailboxLf];
|
||||
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredDepth);
|
||||
SetGWorld(tempMap, nil);
|
||||
SetGraphicsPort(tempMap);
|
||||
LoadGraphic(kMailboxLeftPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&tempMask, &bounds, 1);
|
||||
SetGWorld(tempMask, nil);
|
||||
SetGraphicsPort(tempMask);
|
||||
LoadGraphic(kMailboxLeftMaskID);
|
||||
|
||||
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
|
||||
@@ -184,7 +183,7 @@ void DrawMailboxLeft (Rect *theRect, short down)
|
||||
(BitMap *)*GetGWorldPixMap(backSrcMap),
|
||||
&srcRects[kMailboxLf], &srcRects[kMailboxLf], theRect);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
DisposeGWorld(tempMap);
|
||||
DisposeGWorld(tempMask);
|
||||
@@ -200,11 +199,10 @@ void DrawMailboxRight (Rect *theRect, short down)
|
||||
GWorldPtr tempMask;
|
||||
long darkGrayC, lightWoodC, darkWoodC;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
{
|
||||
@@ -251,15 +249,15 @@ void DrawMailboxRight (Rect *theRect, short down)
|
||||
theRect->left + 47, down + kMailboxBase + 3, darkGrayC);
|
||||
}
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
bounds = srcRects[kMailboxRt];
|
||||
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredDepth);
|
||||
SetGWorld(tempMap, nil);
|
||||
SetGraphicsPort(tempMap);
|
||||
LoadGraphic(kMailboxRightPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&tempMask, &bounds, 1);
|
||||
SetGWorld(tempMask, nil);
|
||||
SetGraphicsPort(tempMask);
|
||||
LoadGraphic(kMailboxRightMaskID);
|
||||
|
||||
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
|
||||
@@ -267,7 +265,7 @@ void DrawMailboxRight (Rect *theRect, short down)
|
||||
(BitMap *)*GetGWorldPixMap(backSrcMap),
|
||||
&srcRects[kMailboxRt], &srcRects[kMailboxRt], theRect);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
DisposeGWorld(tempMap);
|
||||
DisposeGWorld(tempMask);
|
||||
@@ -289,12 +287,11 @@ void DrawSimpleTransport (short what, Rect *theRect)
|
||||
void DrawInvisTransport (Rect *theRect)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
ColorFrameRect(theRect, 32);
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawLightSwitch
|
||||
@@ -376,12 +373,11 @@ void DrawKnifeSwitch (Rect *theRect, Boolean state)
|
||||
void DrawInvisibleSwitch (Rect *theRect)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
ColorFrameRect(theRect, kIntenseGreenColor);
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawTrigger
|
||||
@@ -389,12 +385,11 @@ void DrawInvisibleSwitch (Rect *theRect)
|
||||
void DrawTrigger (Rect *theRect)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
ColorFrameRect(theRect, kIntenseBlueColor);
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawSoundTrigger
|
||||
@@ -402,12 +397,11 @@ void DrawTrigger (Rect *theRect)
|
||||
void DrawSoundTrigger (Rect *theRect)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
ColorFrameRect(theRect, kIntenseYellowColor);
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawSimpleLight
|
||||
@@ -427,7 +421,6 @@ void DrawFlourescent (Rect *theRect)
|
||||
Rect partRect;
|
||||
long grayC, gray2C, gray3C, gray4C, violetC;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
{
|
||||
@@ -446,8 +439,8 @@ void DrawFlourescent (Rect *theRect)
|
||||
violetC = kPaleVioletColor;
|
||||
}
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
ColorLine(theRect->left + 16, theRect->top,
|
||||
theRect->right - 17, theRect->top, grayC);
|
||||
@@ -474,7 +467,7 @@ void DrawFlourescent (Rect *theRect)
|
||||
ColorLine(theRect->left + 16, theRect->top + 11,
|
||||
theRect->right - 17, theRect->top + 11, violetC);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
partRect = flourescentSrc1;
|
||||
ZeroRectCorner(&partRect);
|
||||
@@ -505,7 +498,6 @@ void DrawTrackLight (Rect *theRect)
|
||||
long grayC, gray2C, gray3C, gray4C;
|
||||
short which, howMany, i, spread;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
{
|
||||
@@ -522,8 +514,8 @@ void DrawTrackLight (Rect *theRect)
|
||||
gray4C = k8DkGrayColor;
|
||||
}
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
ColorLine(theRect->left, theRect->top - 3,
|
||||
theRect->right - 1, theRect->top - 3, gray2C);
|
||||
@@ -538,7 +530,7 @@ void DrawTrackLight (Rect *theRect)
|
||||
ColorLine(theRect->left, theRect->top + 2,
|
||||
theRect->right - 1, theRect->top + 2, gray3C);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
partRect = trackLightSrc[0]; // left most track light
|
||||
ZeroRectCorner(&partRect);
|
||||
@@ -587,12 +579,11 @@ void DrawTrackLight (Rect *theRect)
|
||||
void DrawInvisLight (Rect *theRect)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
ColorFrameOval(theRect, 17);
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawSimpleAppliance
|
||||
@@ -644,20 +635,19 @@ void DrawTV (Rect *theRect, Boolean isOn, Boolean isLit)
|
||||
GWorldPtr tempMap;
|
||||
GWorldPtr tempMask;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
if (isLit)
|
||||
{
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
bounds = srcRects[kTV];
|
||||
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredDepth);
|
||||
SetGWorld(tempMap, nil);
|
||||
SetGraphicsPort(tempMap);
|
||||
LoadGraphic(kTVPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&tempMask, &bounds, 1);
|
||||
SetGWorld(tempMask, nil);
|
||||
SetGraphicsPort(tempMask);
|
||||
LoadGraphic(kTVMaskID);
|
||||
|
||||
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
|
||||
@@ -665,7 +655,7 @@ void DrawTV (Rect *theRect, Boolean isOn, Boolean isLit)
|
||||
(BitMap *)*GetGWorldPixMap(backSrcMap),
|
||||
&srcRects[kTV], &srcRects[kTV], theRect);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
DisposeGWorld(tempMap);
|
||||
DisposeGWorld(tempMask);
|
||||
@@ -738,20 +728,19 @@ void DrawVCR (Rect *theRect, Boolean isOn, Boolean isLit)
|
||||
GWorldPtr tempMap;
|
||||
GWorldPtr tempMask;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
if (isLit)
|
||||
{
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
bounds = srcRects[kVCR];
|
||||
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredDepth);
|
||||
SetGWorld(tempMap, nil);
|
||||
SetGraphicsPort(tempMap);
|
||||
LoadGraphic(kVCRPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&tempMask, &bounds, 1);
|
||||
SetGWorld(tempMask, nil);
|
||||
SetGraphicsPort(tempMask);
|
||||
LoadGraphic(kVCRMaskID);
|
||||
|
||||
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
|
||||
@@ -759,7 +748,7 @@ void DrawVCR (Rect *theRect, Boolean isOn, Boolean isLit)
|
||||
(BitMap *)*GetGWorldPixMap(backSrcMap),
|
||||
&srcRects[kVCR], &srcRects[kVCR], theRect);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
DisposeGWorld(tempMap);
|
||||
DisposeGWorld(tempMask);
|
||||
@@ -792,21 +781,20 @@ void DrawStereo (Rect *theRect, Boolean isOn, Boolean isLit)
|
||||
GWorldPtr tempMap;
|
||||
GWorldPtr tempMask;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
|
||||
if (isLit)
|
||||
{
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
bounds = srcRects[kStereo];
|
||||
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredDepth);
|
||||
SetGWorld(tempMap, nil);
|
||||
SetGraphicsPort(tempMap);
|
||||
LoadGraphic(kStereoPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&tempMask, &bounds, 1);
|
||||
SetGWorld(tempMask, nil);
|
||||
SetGraphicsPort(tempMask);
|
||||
LoadGraphic(kStereoMaskID);
|
||||
|
||||
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
|
||||
@@ -814,7 +802,7 @@ void DrawStereo (Rect *theRect, Boolean isOn, Boolean isLit)
|
||||
(BitMap *)*GetGWorldPixMap(backSrcMap),
|
||||
&srcRects[kStereo], &srcRects[kStereo], theRect);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
DisposeGWorld(tempMap);
|
||||
DisposeGWorld(tempMask);
|
||||
@@ -847,21 +835,20 @@ void DrawMicrowave (Rect *theRect, Boolean isOn, Boolean isLit)
|
||||
GWorldPtr tempMap;
|
||||
GWorldPtr tempMask;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
|
||||
if (isLit)
|
||||
{
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
bounds = srcRects[kMicrowave];
|
||||
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredDepth);
|
||||
SetGWorld(tempMap, nil);
|
||||
SetGraphicsPort(tempMap);
|
||||
LoadGraphic(kMicrowavePictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&tempMask, &bounds, 1);
|
||||
SetGWorld(tempMask, nil);
|
||||
SetGraphicsPort(tempMask);
|
||||
LoadGraphic(kMicrowaveMaskID);
|
||||
|
||||
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
|
||||
@@ -869,7 +856,7 @@ void DrawMicrowave (Rect *theRect, Boolean isOn, Boolean isLit)
|
||||
(BitMap *)*GetGWorldPixMap(backSrcMap),
|
||||
&srcRects[kMicrowave], &srcRects[kMicrowave], theRect);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
DisposeGWorld(tempMap);
|
||||
DisposeGWorld(tempMask);
|
||||
@@ -987,7 +974,6 @@ void DrawMirror (Rect *mirror)
|
||||
Rect tempRect;
|
||||
long grayC;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
{
|
||||
@@ -998,8 +984,8 @@ void DrawMirror (Rect *mirror)
|
||||
grayC = k8DkGray2Color;
|
||||
}
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
tempRect = *mirror;
|
||||
ColorRect(&tempRect, k8WhiteColor);
|
||||
@@ -1011,7 +997,7 @@ void DrawMirror (Rect *mirror)
|
||||
InsetRect(&tempRect, 1, 1);
|
||||
ColorFrameRect(&tempRect, grayC);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawSimpleClutter
|
||||
@@ -1043,7 +1029,6 @@ void DrawWallWindow (Rect *window)
|
||||
long brownC, tanC, dkstRedC;
|
||||
short halfWay;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
{
|
||||
@@ -1058,8 +1043,8 @@ void DrawWallWindow (Rect *window)
|
||||
dkstRedC = k8DkRed2Color;
|
||||
}
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
tempRect = *window;
|
||||
InsetRect(&tempRect, 3, 0);
|
||||
@@ -1125,7 +1110,7 @@ void DrawWallWindow (Rect *window)
|
||||
ColorLine(tempRect2.left - 5, tempRect2.top - 7,
|
||||
tempRect2.right + 5, tempRect2.top - 7, tanC);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawCalendar
|
||||
@@ -1137,10 +1122,9 @@ void DrawCalendar (Rect *theRect)
|
||||
PicHandle thePicture;
|
||||
Str255 monthStr;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
thePicture = GetPicture(kCalendarPictID);
|
||||
if (thePicture == nil)
|
||||
@@ -1161,7 +1145,7 @@ void DrawCalendar (Rect *theRect)
|
||||
MoveTo(theRect->left + ((64 - StringWidth(monthStr)) / 2), theRect->top + 55);
|
||||
ColorText(monthStr, kDarkFleshColor);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawBulletin
|
||||
@@ -1171,10 +1155,9 @@ void DrawBulletin (Rect *theRect)
|
||||
Rect bounds;
|
||||
PicHandle thePicture;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
thePicture = GetPicture(kBulletinPictID);
|
||||
if (thePicture == nil)
|
||||
@@ -1186,7 +1169,7 @@ void DrawBulletin (Rect *theRect)
|
||||
DrawPicture(thePicture, &bounds);
|
||||
ReleaseResource((Handle)thePicture);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawPictObject
|
||||
@@ -1197,7 +1180,6 @@ void DrawPictObject (short what, Rect *theRect)
|
||||
PicHandle thePicture;
|
||||
short pictID;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
switch (what)
|
||||
{
|
||||
@@ -1230,8 +1212,8 @@ void DrawPictObject (short what, Rect *theRect)
|
||||
break;
|
||||
}
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
thePicture = GetPicture(pictID);
|
||||
if (thePicture == nil)
|
||||
@@ -1242,7 +1224,7 @@ void DrawPictObject (short what, Rect *theRect)
|
||||
DrawPicture(thePicture, &bounds);
|
||||
ReleaseResource((Handle)thePicture);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawPictWithMaskObject
|
||||
@@ -1254,10 +1236,9 @@ void DrawPictWithMaskObject (short what, Rect *theRect)
|
||||
GWorldPtr tempMask;
|
||||
short pictID, maskID;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
switch (what)
|
||||
{
|
||||
@@ -1274,11 +1255,11 @@ void DrawPictWithMaskObject (short what, Rect *theRect)
|
||||
|
||||
bounds = srcRects[what];
|
||||
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredDepth);
|
||||
SetGWorld(tempMap, nil);
|
||||
SetGraphicsPort(tempMap);
|
||||
LoadGraphic(pictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&tempMask, &bounds, 1);
|
||||
SetGWorld(tempMask, nil);
|
||||
SetGraphicsPort(tempMask);
|
||||
LoadGraphic(maskID);
|
||||
|
||||
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
|
||||
@@ -1286,7 +1267,7 @@ void DrawPictWithMaskObject (short what, Rect *theRect)
|
||||
(BitMap *)*GetGWorldPixMap(backSrcMap),
|
||||
&srcRects[what], &srcRects[what], theRect);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
DisposeGWorld(tempMap);
|
||||
DisposeGWorld(tempMask);
|
||||
@@ -1302,10 +1283,9 @@ void DrawPictSansWhiteObject (short what, Rect *theRect)
|
||||
CGrafPtr tempMap;
|
||||
short pictID;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
switch (what)
|
||||
{
|
||||
@@ -1392,14 +1372,14 @@ void DrawPictSansWhiteObject (short what, Rect *theRect)
|
||||
|
||||
bounds = srcRects[what];
|
||||
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredDepth);
|
||||
SetGWorld(tempMap, nil);
|
||||
SetGraphicsPort(tempMap);
|
||||
LoadGraphic(pictID);
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(tempMap),
|
||||
(BitMap *)*GetGWorldPixMap(backSrcMap),
|
||||
&srcRects[what], theRect, transparent, nil);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
DisposeGWorld(tempMap);
|
||||
// SetPort((GrafPtr)backSrcMap);
|
||||
@@ -1411,22 +1391,21 @@ void DrawCustPictSansWhite (short pictID, Rect *theRect)
|
||||
Rect bounds;
|
||||
GWorldPtr tempMap;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
bounds = *theRect;
|
||||
ZeroRectCorner(&bounds);
|
||||
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredDepth);
|
||||
SetGWorld(tempMap, nil);
|
||||
SetGraphicsPort(tempMap);
|
||||
LoadGraphic(pictID);
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(tempMap),
|
||||
(BitMap *)*GetGWorldPixMap(backSrcMap),
|
||||
&bounds, theRect, transparent, nil);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
DisposeGWorld(tempMap);
|
||||
// SetPort((GrafPtr)backSrcMap);
|
||||
|
||||
@@ -2303,11 +2303,10 @@ void DrawThisRoomsObjects (void)
|
||||
Rect tempRect;
|
||||
short i;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
Pattern dummyPattern;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
if ((noRoomAtAll) || (!houseUnlocked))
|
||||
return;
|
||||
@@ -2315,7 +2314,7 @@ void DrawThisRoomsObjects (void)
|
||||
{
|
||||
if (GetNumberOfLights(thisRoomNumber) <= 0)
|
||||
{
|
||||
PenMode(srcOr);
|
||||
PenMask(true);
|
||||
PenPat(GetQDGlobalsGray(&dummyPattern));
|
||||
PaintRect(&backSrcRect);
|
||||
PenNormal();
|
||||
@@ -2657,8 +2656,6 @@ void DrawThisRoomsObjects (void)
|
||||
}
|
||||
}
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
|
||||
if (isFirstRoom)
|
||||
{
|
||||
CopyMask((BitMap *)*GetGWorldPixMap(glidSrcMap),
|
||||
@@ -2698,7 +2695,7 @@ void HiliteAllObjects (void)
|
||||
PauseMarquee();
|
||||
SetPort((GrafPtr)mainWindow);
|
||||
PenPat(GetQDGlobalsGray(&dummyPattern));
|
||||
PenMode(patXor);
|
||||
PenInvertMode(true);
|
||||
|
||||
for (i = 0; i < kMaxRoomObs; i++)
|
||||
FrameRect(&roomObjectRects[i]);
|
||||
|
||||
@@ -254,20 +254,17 @@ void NewGame (short mode)
|
||||
|
||||
if (!gameOver)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
CGrafPtr wasCPort = GetGraphicsPort();
|
||||
|
||||
InvalWindowRect(mainWindow, &mainWindowRect);
|
||||
|
||||
SetGWorld(workSrcMap, nil);
|
||||
SetGraphicsPort(workSrcMap);
|
||||
PaintRect(&workSrcRect);
|
||||
QSetRect(&tempRect, 0, 0, 640, 460);
|
||||
QOffsetRect(&tempRect, splashOriginH, splashOriginV);
|
||||
LoadScaledGraphic(kSplash8BitPICT, &tempRect);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
WaitCommandQReleased();
|
||||
demoGoing = false;
|
||||
@@ -498,10 +495,7 @@ void PlayGame (void)
|
||||
countDown--;
|
||||
if (countDown <= 0)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
CGrafPtr wasCPort = GetGraphicsPort();
|
||||
|
||||
HideGlider(&theGlider);
|
||||
RefreshScoreboard(kNormalTitleMode);
|
||||
@@ -509,7 +503,7 @@ void PlayGame (void)
|
||||
#if BUILD_ARCADE_VERSION
|
||||
// Need to paint over the scoreboard black.
|
||||
|
||||
SetGWorld(boardSrcMap, nil);
|
||||
SetGraphicsPort(boardSrcMap);
|
||||
PaintRect(&boardSrcRect);
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(boardSrcMap),
|
||||
@@ -543,26 +537,23 @@ void PlayGame (void)
|
||||
else
|
||||
DoGameOver();
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if BUILD_ARCADE_VERSION
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
CGrafPtr wasCPort = GetGraphicsPort();
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
|
||||
SetGWorld(boardSrcMap, nil);
|
||||
SetGraphicsPort(boardSrcMap);
|
||||
PaintRect(&boardSrcRect);
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(boardSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(mainWindow)),
|
||||
&boardSrcRect, &boardDestRect, srcCopy, 0L);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -45,7 +45,6 @@ void DrawLocale (void)
|
||||
short i, roomV;
|
||||
char wasState;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
ZeroFlamesAndTheLike();
|
||||
ZeroDinahs();
|
||||
@@ -67,8 +66,8 @@ void DrawLocale (void)
|
||||
}
|
||||
ListAllLocalObjects();
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
PaintRect(&backSrcRect);
|
||||
|
||||
if (numNeighbors > 3)
|
||||
@@ -115,14 +114,14 @@ void DrawLocale (void)
|
||||
DrawRoomBackground(localNumbers[kCentralRoom], kCentralRoom, roomV);
|
||||
DrawARoomsObjects(kCentralRoom, false);
|
||||
DrawLighting();
|
||||
|
||||
|
||||
if (numNeighbors > 3)
|
||||
DrawFloorSupport();
|
||||
RestoreWorkMap();
|
||||
shadowVisible = IsShadowVisible();
|
||||
takingTheStairs = false;
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- LoadGraphicSpecial
|
||||
@@ -170,14 +169,13 @@ void DrawRoomBackground (short who, short where, short elevation)
|
||||
if ((numLights == 0) && (who != kRoomIsEmpty))
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
PaintRect(&localRoomsDest[where]);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -186,14 +184,13 @@ void DrawRoomBackground (short who, short where, short elevation)
|
||||
if (wardBitSet)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
|
||||
PaintRect(&localRoomsDest[where]);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -247,10 +244,9 @@ void DrawFloorSupport (void)
|
||||
Rect src, dest, whoCares;
|
||||
short i;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
SetGWorld(backSrcMap, nil);
|
||||
|
||||
wasCPort = GetGraphicsPort();
|
||||
SetGraphicsPort(backSrcMap);
|
||||
src = suppSrcRect;
|
||||
|
||||
if (isStructure[kNorthWestRoom])
|
||||
@@ -360,7 +356,7 @@ void DrawFloorSupport (void)
|
||||
}
|
||||
}
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- ReadyBackMap
|
||||
|
||||
@@ -130,7 +130,7 @@ void DragMiniTile (Point mouseIs, short *newTileOver)
|
||||
QOffsetRect(&dragRect,
|
||||
tileSrc.left + (tileOver * kMiniTileWide),
|
||||
tileSrc.top);
|
||||
PenMode(patXor);
|
||||
PenInvertMode(true);
|
||||
PenPat(GetQDGlobalsGray(&dummyPattern));
|
||||
FrameRect(&dragRect);
|
||||
mouseWas = mouseIs;
|
||||
@@ -170,7 +170,7 @@ void DragMiniTile (Point mouseIs, short *newTileOver)
|
||||
}
|
||||
ForeColor(blackColor);
|
||||
PenNormal();
|
||||
PenMode(patXor);
|
||||
PenInvertMode(true);
|
||||
PenPat(GetQDGlobalsGray(&dummyPattern));
|
||||
wasTileOver = *newTileOver;
|
||||
}
|
||||
@@ -191,7 +191,7 @@ void DragMiniTile (Point mouseIs, short *newTileOver)
|
||||
Line(kMiniTileWide, 0);
|
||||
ForeColor(blackColor);
|
||||
PenNormal();
|
||||
PenMode(patXor);
|
||||
PenInvertMode(true);
|
||||
PenPat(GetQDGlobalsGray(&dummyPattern));
|
||||
wasTileOver = -1;
|
||||
}
|
||||
@@ -211,7 +211,7 @@ void DragMiniTile (Point mouseIs, short *newTileOver)
|
||||
Line(kMiniTileWide, 0);
|
||||
ForeColor(blackColor);
|
||||
PenNormal();
|
||||
PenMode(patXor);
|
||||
PenInvertMode(true);
|
||||
PenPat(GetQDGlobalsGray(&dummyPattern));
|
||||
wasTileOver = -1;
|
||||
}
|
||||
@@ -386,10 +386,9 @@ void DoRoomInfo (void)
|
||||
Boolean leaving, wasFirstRoom, forceDraw;
|
||||
ModalFilterUPP roomFilterUPP;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
roomFilterUPP = NewModalFilterUPP(RoomFilter);
|
||||
|
||||
tileOver = -1;
|
||||
@@ -406,7 +405,7 @@ void DoRoomInfo (void)
|
||||
ParamText(floorStr, suiteStr, objectsStr, PSTR(""));
|
||||
|
||||
theErr = CreateOffScreenGWorld(&tileSrcMap, &tileSrcRect, kPreferredDepth);
|
||||
SetGWorld(tileSrcMap, nil);
|
||||
SetGraphicsPort(tileSrcMap);
|
||||
// CreateOffScreenPixMap(&tileSrcRect, &tileSrcMap);
|
||||
// SetPort((GrafPtr)tileSrcMap);
|
||||
if ((tempBack > kStars) && (!PictIDExists(tempBack)))
|
||||
@@ -420,7 +419,7 @@ void DoRoomInfo (void)
|
||||
else
|
||||
LoadScaledGraphic(tempBack, &tileSrcRect);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
|
||||
for (i = 0; i < kNumTiles; i++)
|
||||
tempTiles[i] = thisRoom->tiles[i];
|
||||
|
||||
@@ -61,18 +61,17 @@ void InitScoreboardMap (void)
|
||||
Rect bounds;
|
||||
PicHandle thePicture;
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
short hOffset;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
wasScoreboardMode = kScoreboardHigh;
|
||||
boardSrcRect = houseRect;
|
||||
ZeroRectCorner(&boardSrcRect);
|
||||
boardSrcRect.bottom = kScoreboardTall;
|
||||
theErr = CreateOffScreenGWorld(&boardSrcMap, &boardSrcRect, kPreferredDepth);
|
||||
SetGWorld(boardSrcMap, nil);
|
||||
SetGraphicsPort(boardSrcMap);
|
||||
|
||||
if (boardSrcRect.right >= 640)
|
||||
hOffset = (RectWide(&boardSrcRect) - kMaxViewWidth) / 2;
|
||||
@@ -89,7 +88,7 @@ void InitScoreboardMap (void)
|
||||
|
||||
QSetRect(&badgeSrcRect, 0, 0, 32, 66); // 2144 pixels
|
||||
theErr = CreateOffScreenGWorld(&badgeSrcMap, &badgeSrcRect, kPreferredDepth);
|
||||
SetGWorld(badgeSrcMap, nil);
|
||||
SetGraphicsPort(badgeSrcMap);
|
||||
LoadGraphic(kBadgePictID);
|
||||
|
||||
boardDestRect = boardSrcRect;
|
||||
@@ -100,7 +99,7 @@ void InitScoreboardMap (void)
|
||||
|
||||
QSetRect(&boardTSrcRect, 0, 0, 256, 12); // room title
|
||||
theErr = CreateOffScreenGWorld(&boardTSrcMap, &boardTSrcRect, kPreferredDepth);
|
||||
SetGWorld(boardTSrcMap, nil);
|
||||
SetGraphicsPort(boardTSrcMap);
|
||||
boardTDestRect = boardTSrcRect;
|
||||
QOffsetRect(&boardTDestRect, 137 + hOffset, 5);
|
||||
TextFont(applFont);
|
||||
@@ -109,7 +108,7 @@ void InitScoreboardMap (void)
|
||||
|
||||
QSetRect(&boardGSrcRect, 0, 0, 20, 10); // # gliders
|
||||
theErr = CreateOffScreenGWorld(&boardGSrcMap, &boardGSrcRect, kPreferredDepth);
|
||||
SetGWorld(boardGSrcMap, nil);
|
||||
SetGraphicsPort(boardGSrcMap);
|
||||
boardGDestRect = boardGSrcRect;
|
||||
QOffsetRect(&boardGDestRect, 526 + hOffset, 5);
|
||||
TextFont(applFont);
|
||||
@@ -118,7 +117,7 @@ void InitScoreboardMap (void)
|
||||
|
||||
QSetRect(&boardPSrcRect, 0, 0, 64, 10); // points
|
||||
theErr = CreateOffScreenGWorld(&boardPSrcMap, &boardPSrcRect, kPreferredDepth);
|
||||
SetGWorld(boardPSrcMap, nil);
|
||||
SetGraphicsPort(boardPSrcMap);
|
||||
boardPDestRect = boardPSrcRect;
|
||||
QOffsetRect(&boardPDestRect, 570 + hOffset, 5); // total = 6396 pixels
|
||||
boardPQDestRect = boardPDestRect;
|
||||
@@ -153,8 +152,8 @@ void InitScoreboardMap (void)
|
||||
QOffsetRect(&badgesDestRects[2], 467 + hOffset, 1);
|
||||
QSetRect(&badgesDestRects[3], 0, 0, 16, 17); // helium
|
||||
QOffsetRect(&badgesDestRects[3], 467 + hOffset, 1);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- InitGliderMap
|
||||
@@ -164,23 +163,22 @@ void InitScoreboardMap (void)
|
||||
void InitGliderMap (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
short i;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&glidSrcRect, 0, 0, kGliderWide, 668); // 32112 pixels
|
||||
theErr = CreateOffScreenGWorld(&glidSrcMap, &glidSrcRect, kPreferredDepth);
|
||||
SetGWorld(glidSrcMap, nil);
|
||||
SetGraphicsPort(glidSrcMap);
|
||||
LoadGraphic(kGliderPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&glid2SrcMap, &glidSrcRect, kPreferredDepth);
|
||||
SetGWorld(glid2SrcMap, nil);
|
||||
SetGraphicsPort(glid2SrcMap);
|
||||
LoadGraphic(kGlider2PictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&glidMaskMap, &glidSrcRect, 1);
|
||||
SetGWorld(glidMaskMap, nil);
|
||||
SetGraphicsPort(glidMaskMap);
|
||||
LoadGraphic(kGliderPictID + 1000);
|
||||
|
||||
for (i = 0; i <= 20; i++)
|
||||
@@ -201,11 +199,11 @@ void InitGliderMap (void)
|
||||
|
||||
QSetRect(&shadowSrcRect, 0, 0, kGliderWide, kShadowHigh * kNumShadowSrcRects);
|
||||
theErr = CreateOffScreenGWorld(&shadowSrcMap, &shadowSrcRect, kPreferredDepth);
|
||||
SetGWorld(shadowSrcMap, nil);
|
||||
SetGraphicsPort(shadowSrcMap);
|
||||
LoadGraphic(kShadowPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&shadowMaskMap, &shadowSrcRect, 1);
|
||||
SetGWorld(shadowMaskMap, nil);
|
||||
SetGraphicsPort(shadowMaskMap);
|
||||
LoadGraphic(kShadowPictID + 1000);
|
||||
|
||||
for (i = 0; i < kNumShadowSrcRects; i++)
|
||||
@@ -216,11 +214,11 @@ void InitGliderMap (void)
|
||||
|
||||
QSetRect(&bandsSrcRect, 0, 0, 16, 18); // 304 pixels
|
||||
theErr = CreateOffScreenGWorld(&bandsSrcMap, &bandsSrcRect, kPreferredDepth);
|
||||
SetGWorld(bandsSrcMap, nil);
|
||||
SetGraphicsPort(bandsSrcMap);
|
||||
LoadGraphic(kRubberBandsPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&bandsMaskMap, &bandsSrcRect, 1);
|
||||
SetGWorld(bandsMaskMap, nil);
|
||||
SetGraphicsPort(bandsMaskMap);
|
||||
LoadGraphic(kRubberBandsPictID + 1000);
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
@@ -229,7 +227,7 @@ void InitGliderMap (void)
|
||||
QOffsetRect(&bandRects[i], 0, 6 * i);
|
||||
}
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- InitBlowers
|
||||
@@ -239,19 +237,18 @@ void InitGliderMap (void)
|
||||
void InitBlowers (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
short i;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&blowerSrcRect, 0, 0, 48, 402); // 19344 pixels
|
||||
theErr = CreateOffScreenGWorld(&blowerSrcMap, &blowerSrcRect, kPreferredDepth);
|
||||
SetGWorld(blowerSrcMap, nil);
|
||||
SetGraphicsPort(blowerSrcMap);
|
||||
LoadGraphic(kBlowerPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&blowerMaskMap, &blowerSrcRect, 1);
|
||||
SetGWorld(blowerMaskMap, nil);
|
||||
SetGraphicsPort(blowerMaskMap);
|
||||
LoadGraphic(kBlowerPictID + 1000);
|
||||
|
||||
for (i = 0; i < kNumCandleFlames; i++)
|
||||
@@ -278,7 +275,7 @@ void InitBlowers (void)
|
||||
QSetRect(&rightStartGliderSrc, 0, 0, 48, 16);
|
||||
QOffsetRect(&rightStartGliderSrc, 0, 374);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- InitFurniture
|
||||
@@ -288,18 +285,17 @@ void InitBlowers (void)
|
||||
void InitFurniture (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&furnitureSrcRect, 0, 0, 64, 278); // 17856 pixels
|
||||
theErr = CreateOffScreenGWorld(&furnitureSrcMap, &furnitureSrcRect, kPreferredDepth);
|
||||
SetGWorld(furnitureSrcMap, nil);
|
||||
SetGraphicsPort(furnitureSrcMap);
|
||||
LoadGraphic(kFurniturePictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&furnitureMaskMap, &furnitureSrcRect, 1);
|
||||
SetGWorld(furnitureMaskMap, nil);
|
||||
SetGraphicsPort(furnitureMaskMap);
|
||||
LoadGraphic(kFurniturePictID + 1000);
|
||||
|
||||
QSetRect(&tableSrc, 0, 0, 64, 22);
|
||||
@@ -326,7 +322,7 @@ void InitFurniture (void)
|
||||
QSetRect(&deckSrc, 0, 0, 64, 21);
|
||||
QOffsetRect(&deckSrc, 0, 162);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- InitPrizes
|
||||
@@ -336,19 +332,18 @@ void InitFurniture (void)
|
||||
void InitPrizes (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
short i;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&bonusSrcRect, 0, 0, 88, 378); // 33264 pixels
|
||||
theErr = CreateOffScreenGWorld(&bonusSrcMap, &bonusSrcRect, kPreferredDepth);
|
||||
SetGWorld(bonusSrcMap, nil);
|
||||
SetGraphicsPort(bonusSrcMap);
|
||||
LoadGraphic(kBonusPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&bonusMaskMap, &bonusSrcRect, 1);
|
||||
SetGWorld(bonusMaskMap, nil);
|
||||
SetGraphicsPort(bonusMaskMap);
|
||||
LoadGraphic(kBonusPictID + 1000);
|
||||
|
||||
for (i = 0; i < 11; i++)
|
||||
@@ -397,11 +392,11 @@ void InitPrizes (void)
|
||||
|
||||
QSetRect(&pointsSrcRect, 0, 0, 24, 120); // 2880 pixels
|
||||
theErr = CreateOffScreenGWorld(&pointsSrcMap, &pointsSrcRect, kPreferredDepth);
|
||||
SetGWorld(pointsSrcMap, nil);
|
||||
SetGraphicsPort(pointsSrcMap);
|
||||
LoadGraphic(kPointsPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&pointsMaskMap, &pointsSrcRect, 1);
|
||||
SetGWorld(pointsMaskMap, nil);
|
||||
SetGraphicsPort(pointsMaskMap);
|
||||
LoadGraphic(kPointsPictID + 1000);
|
||||
|
||||
for (i = 0; i < 15; i++)
|
||||
@@ -410,7 +405,7 @@ void InitPrizes (void)
|
||||
QOffsetRect(&pointsSrc[i], 0, i * 8);
|
||||
}
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- InitTransports
|
||||
@@ -420,21 +415,20 @@ void InitPrizes (void)
|
||||
void InitTransports (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld); // GlidePort: this line was missing?
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&transSrcRect, 0, 0, 56, 32); // 1848 pixels
|
||||
theErr = CreateOffScreenGWorld(&transSrcMap, &transSrcRect, kPreferredDepth);
|
||||
SetGWorld(transSrcMap, nil);
|
||||
SetGraphicsPort(transSrcMap);
|
||||
LoadGraphic(kTransportPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&transMaskMap, &transSrcRect, 1);
|
||||
SetGWorld(transMaskMap, nil);
|
||||
SetGraphicsPort(transMaskMap);
|
||||
LoadGraphic(kTransportPictID + 1000);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- InitSwitches
|
||||
@@ -444,14 +438,13 @@ void InitTransports (void)
|
||||
void InitSwitches (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&switchSrcRect, 0, 0, 32, 104); // 3360 pixels
|
||||
theErr = CreateOffScreenGWorld(&switchSrcMap, &switchSrcRect, kPreferredDepth);
|
||||
SetGWorld(switchSrcMap, nil);
|
||||
SetGraphicsPort(switchSrcMap);
|
||||
LoadGraphic(kSwitchPictID);
|
||||
|
||||
QSetRect(&lightSwitchSrc[0], 0, 0, 15, 24);
|
||||
@@ -479,7 +472,7 @@ void InitSwitches (void)
|
||||
QSetRect(&knifeSwitchSrc[1], 0, 0, 16, 24);
|
||||
QOffsetRect(&knifeSwitchSrc[1], 16, 80);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- InitLights
|
||||
@@ -489,19 +482,18 @@ void InitSwitches (void)
|
||||
void InitLights (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
short i;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&lightSrcRect, 0, 0, 72, 126); // 9144 pixels
|
||||
theErr = CreateOffScreenGWorld(&lightSrcMap, &lightSrcRect, kPreferredDepth);
|
||||
SetGWorld(lightSrcMap, nil);
|
||||
SetGraphicsPort(lightSrcMap);
|
||||
LoadGraphic(kLightPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&lightMaskMap, &lightSrcRect, 1);
|
||||
SetGWorld(lightMaskMap, nil);
|
||||
SetGraphicsPort(lightMaskMap);
|
||||
LoadGraphic(kLightPictID + 1000);
|
||||
|
||||
QSetRect(&flourescentSrc1, 0, 0, 16, 12);
|
||||
@@ -516,7 +508,7 @@ void InitLights (void)
|
||||
QOffsetRect(&trackLightSrc[i], 24 * i, 102);
|
||||
}
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- InitAppliances
|
||||
@@ -526,37 +518,36 @@ void InitLights (void)
|
||||
void InitAppliances (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
short i;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&applianceSrcRect, 0, 0, 80, 269); // 21600 pixels
|
||||
theErr = CreateOffScreenGWorld(&applianceSrcMap, &applianceSrcRect, kPreferredDepth);
|
||||
SetGWorld(applianceSrcMap, nil);
|
||||
SetGraphicsPort(applianceSrcMap);
|
||||
LoadGraphic(kAppliancePictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&applianceMaskMap, &applianceSrcRect, 1);
|
||||
SetGWorld(applianceMaskMap, nil);
|
||||
SetGraphicsPort(applianceMaskMap);
|
||||
LoadGraphic(kAppliancePictID + 1000);
|
||||
|
||||
QSetRect(&toastSrcRect, 0, 0, 32, 174); // 5600 pixels
|
||||
theErr = CreateOffScreenGWorld(&toastSrcMap, &toastSrcRect, kPreferredDepth);
|
||||
SetGWorld(toastSrcMap, nil);
|
||||
SetGraphicsPort(toastSrcMap);
|
||||
LoadGraphic(kToastPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&toastMaskMap, &toastSrcRect, 1);
|
||||
SetGWorld(toastMaskMap, nil);
|
||||
SetGraphicsPort(toastMaskMap);
|
||||
LoadGraphic(kToastPictID + 1000);
|
||||
|
||||
QSetRect(&shredSrcRect, 0, 0, 40, 35); // 1440 pixels
|
||||
theErr = CreateOffScreenGWorld(&shredSrcMap, &shredSrcRect, kPreferredDepth);
|
||||
SetGWorld(shredSrcMap, nil);
|
||||
SetGraphicsPort(shredSrcMap);
|
||||
LoadGraphic(kShreddedPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&shredMaskMap, &shredSrcRect, 1);
|
||||
SetGWorld(shredMaskMap, nil);
|
||||
SetGraphicsPort(shredMaskMap);
|
||||
LoadGraphic(kShreddedPictID + 1000);
|
||||
|
||||
QSetRect(&plusScreen1, 0, 0, 32, 22);
|
||||
@@ -601,7 +592,7 @@ void InitAppliances (void)
|
||||
QSetRect(µOff, 0, 0, 16, 35);
|
||||
QOffsetRect(µOff, 64, 187);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- InitEnemies
|
||||
@@ -611,73 +602,72 @@ void InitAppliances (void)
|
||||
void InitEnemies (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
short i;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&balloonSrcRect, 0, 0, 24, 30 * kNumBalloonFrames);
|
||||
theErr = CreateOffScreenGWorld(&balloonSrcMap, &balloonSrcRect, kPreferredDepth);
|
||||
SetGWorld(balloonSrcMap, nil);
|
||||
SetGraphicsPort(balloonSrcMap);
|
||||
LoadGraphic(kBalloonPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&balloonMaskMap, &balloonSrcRect, 1);
|
||||
SetGWorld(balloonMaskMap, nil);
|
||||
SetGraphicsPort(balloonMaskMap);
|
||||
LoadGraphic(kBalloonPictID + 1000);
|
||||
|
||||
QSetRect(&copterSrcRect, 0, 0, 32, 30 * kNumCopterFrames);
|
||||
theErr = CreateOffScreenGWorld(&copterSrcMap, &copterSrcRect, kPreferredDepth);
|
||||
SetGWorld(copterSrcMap, nil);
|
||||
SetGraphicsPort(copterSrcMap);
|
||||
LoadGraphic(kCopterPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&copterMaskMap, &copterSrcRect, 1);
|
||||
SetGWorld(copterMaskMap, nil);
|
||||
SetGraphicsPort(copterMaskMap);
|
||||
LoadGraphic(kCopterPictID + 1000);
|
||||
|
||||
QSetRect(&dartSrcRect, 0, 0, 64, 19 * kNumDartFrames);
|
||||
theErr = CreateOffScreenGWorld(&dartSrcMap, &dartSrcRect, kPreferredDepth);
|
||||
SetGWorld(dartSrcMap, nil);
|
||||
SetGraphicsPort(dartSrcMap);
|
||||
LoadGraphic(kDartPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&dartMaskMap, &dartSrcRect, 1);
|
||||
SetGWorld(dartMaskMap, nil);
|
||||
SetGraphicsPort(dartMaskMap);
|
||||
LoadGraphic(kDartPictID + 1000);
|
||||
|
||||
QSetRect(&ballSrcRect, 0, 0, 32, 32 * kNumBallFrames);
|
||||
theErr = CreateOffScreenGWorld(&ballSrcMap, &ballSrcRect, kPreferredDepth);
|
||||
SetGWorld(ballSrcMap, nil);
|
||||
SetGraphicsPort(ballSrcMap);
|
||||
LoadGraphic(kBallPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&ballMaskMap, &ballSrcRect, 1);
|
||||
SetGWorld(ballMaskMap, nil);
|
||||
SetGraphicsPort(ballMaskMap);
|
||||
LoadGraphic(kBallPictID + 1000);
|
||||
|
||||
QSetRect(&dripSrcRect, 0, 0, 16, 12 * kNumDripFrames);
|
||||
theErr = CreateOffScreenGWorld(&dripSrcMap, &dripSrcRect, kPreferredDepth);
|
||||
SetGWorld(dripSrcMap, nil);
|
||||
SetGraphicsPort(dripSrcMap);
|
||||
LoadGraphic(kDripPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&dripMaskMap, &dripSrcRect, 1);
|
||||
SetGWorld(dripMaskMap, nil);
|
||||
SetGraphicsPort(dripMaskMap);
|
||||
LoadGraphic(kDripPictID + 1000);
|
||||
|
||||
QSetRect(&enemySrcRect, 0, 0, 36, 33);
|
||||
theErr = CreateOffScreenGWorld(&enemySrcMap, &enemySrcRect, kPreferredDepth);
|
||||
SetGWorld(enemySrcMap, nil);
|
||||
SetGraphicsPort(enemySrcMap);
|
||||
LoadGraphic(kEnemyPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&enemyMaskMap, &enemySrcRect, 1);
|
||||
SetGWorld(enemyMaskMap, nil);
|
||||
SetGraphicsPort(enemyMaskMap);
|
||||
LoadGraphic(kEnemyPictID + 1000);
|
||||
|
||||
QSetRect(&fishSrcRect, 0, 0, 16, 16 * kNumFishFrames);
|
||||
theErr = CreateOffScreenGWorld(&fishSrcMap, &fishSrcRect, kPreferredDepth);
|
||||
SetGWorld(fishSrcMap, nil);
|
||||
SetGraphicsPort(fishSrcMap);
|
||||
LoadGraphic(kFishPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&fishMaskMap, &fishSrcRect, 1);
|
||||
SetGWorld(fishMaskMap, nil);
|
||||
SetGraphicsPort(fishMaskMap);
|
||||
LoadGraphic(kFishPictID + 1000);
|
||||
|
||||
for (i = 0; i < kNumBalloonFrames; i++)
|
||||
@@ -716,6 +706,6 @@ void InitEnemies (void)
|
||||
QOffsetRect(&fishSrc[i], 0, 16 * i);
|
||||
}
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ void InitAngel (void);
|
||||
|
||||
extern Rect suppSrcRect, justRoomsRect;
|
||||
extern Rect tileSrcRect, angelSrcRect;
|
||||
extern GDHandle thisGDevice;
|
||||
extern CGrafPtr tileSrcMap;
|
||||
extern FSSpecPtr theHousesSpecs;
|
||||
extern hotPtr hotSpots;
|
||||
@@ -54,18 +53,17 @@ extern short maxFiles;
|
||||
void InitClutter (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&clutterSrcRect, 0, 0, 128, 69);
|
||||
theErr = CreateOffScreenGWorld(&clutterSrcMap, &clutterSrcRect, kPreferredDepth);
|
||||
SetGWorld(clutterSrcMap, nil);
|
||||
SetGraphicsPort(clutterSrcMap);
|
||||
LoadGraphic(kClutterPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&clutterMaskMap, &clutterSrcRect, 1);
|
||||
SetGWorld(clutterMaskMap, nil);
|
||||
SetGraphicsPort(clutterMaskMap);
|
||||
LoadGraphic(kClutterPictID + 1000);
|
||||
|
||||
QSetRect(&flowerSrc[0], 0, 0, 10, 28);
|
||||
@@ -86,7 +84,7 @@ void InitClutter (void)
|
||||
QSetRect(&flowerSrc[5], 0, 0, 32, 51);
|
||||
QOffsetRect(&flowerSrc[5], 95, 0);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- InitSupport
|
||||
@@ -97,17 +95,16 @@ void InitClutter (void)
|
||||
void InitSupport (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&suppSrcRect, 0, 0, kRoomWide, kFloorSupportTall); // 44
|
||||
theErr = CreateOffScreenGWorld(&suppSrcMap, &suppSrcRect, kPreferredDepth);
|
||||
SetGWorld(suppSrcMap, nil);
|
||||
SetGraphicsPort(suppSrcMap);
|
||||
LoadGraphic(kSupportPictID);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- InitAngel
|
||||
@@ -118,21 +115,20 @@ void InitSupport (void)
|
||||
void InitAngel (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&angelSrcRect, 0, 0, 96, 44);
|
||||
theErr = CreateOffScreenGWorld(&angelSrcMap, &angelSrcRect, kPreferredDepth);
|
||||
SetGWorld(angelSrcMap, nil);
|
||||
SetGraphicsPort(angelSrcMap);
|
||||
LoadGraphic(kAngelPictID);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&angelMaskMap, &angelSrcRect, 1);
|
||||
SetGWorld(angelMaskMap, nil);
|
||||
SetGraphicsPort(angelMaskMap);
|
||||
LoadGraphic(kAngelPictID + 1);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- CreateOffscreens
|
||||
@@ -144,10 +140,9 @@ void InitAngel (void)
|
||||
void CreateOffscreens (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
justRoomsRect = houseRect;
|
||||
ZeroRectCorner(&justRoomsRect);
|
||||
|
||||
@@ -74,19 +74,18 @@ Boolean isToolsOpen;
|
||||
void CreateToolsOffscreen (void)
|
||||
{
|
||||
CGrafPtr wasCPort;
|
||||
GDHandle wasWorld;
|
||||
OSErr theErr;
|
||||
|
||||
if (toolSrcMap == nil)
|
||||
{
|
||||
GetGWorld(&wasCPort, &wasWorld);
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
QSetRect(&toolSrcRect, 0, 0, 360, 216);
|
||||
theErr = CreateOffScreenGWorld(&toolSrcMap, &toolSrcRect, kPreferredDepth);
|
||||
SetGWorld(toolSrcMap, nil);
|
||||
SetGraphicsPort(toolSrcMap);
|
||||
LoadGraphic(kToolsPictID);
|
||||
|
||||
SetGWorld(wasCPort, wasWorld);
|
||||
SetGraphicsPort(wasCPort);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "Utilities.h"
|
||||
|
||||
|
||||
GDHandle thisGDevice;
|
||||
UInt32 theSeed;
|
||||
|
||||
|
||||
@@ -138,17 +137,6 @@ void RedAlert (short errorNumber)
|
||||
ExitToShell();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- FindOurDevice
|
||||
|
||||
// Finds the main device (monitor with the menu bar on it).
|
||||
|
||||
void FindOurDevice (void)
|
||||
{
|
||||
thisGDevice = GetMainDevice();
|
||||
if (thisGDevice == nil)
|
||||
RedAlert(kErrFailedGetDevice);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- CreateOffScreenBitMap
|
||||
// Creates an offscreen bit map (b&w - 1 bit depth).
|
||||
|
||||
@@ -245,10 +233,10 @@ OSErr CreateOffScreenGWorld (GWorldPtr *theGWorld, Rect *bounds, short depth)
|
||||
{
|
||||
OSErr theErr;
|
||||
|
||||
theErr = NewGWorld(theGWorld, depth, bounds, nil, nil, useTempMem);
|
||||
theErr = NewGWorld(theGWorld, depth, bounds, nil, useTempMem);
|
||||
|
||||
if (theErr)
|
||||
theErr = NewGWorld(theGWorld, depth, bounds, nil, nil, 0);
|
||||
theErr = NewGWorld(theGWorld, depth, bounds, nil, 0);
|
||||
|
||||
if (!theErr)
|
||||
LockPixels(GetGWorldPixMap(*theGWorld));
|
||||
|
||||
Reference in New Issue
Block a user