GliderPRO/Sources/ObjectDraw.c

1 line
37 KiB
C
Raw Normal View History

//============================================================================ //---------------------------------------------------------------------------- // ObjectDraw.c //---------------------------------------------------------------------------- //============================================================================ #include "Externs.h" #include "Environ.h" #include "Objects.h" #include "RectUtils.h" #include "Room.h" #define k8WhiteColor 0 #define kYellowColor 5 #define kGoldColor 11 #define k8RedColor 35 #define kPaleVioletColor 42 #define k8LtTanColor 52 #define k8BambooColor 53 #define kDarkFleshColor 58 #define k8TanColor 94 #define k8PissYellowColor 95 #define k8OrangeColor 59 #define k8BrownColor 137 #define k8Red4Color 143 #define k8SkyColor 150 #define k8EarthBlueColor 170 #define k8DkRedColor 222 #define k8DkRed2Color 223 #define kIntenseGreenColor 225 #define kIntenseBlueColor 235 #define k8PumpkinColor 101 #define k8LtstGrayColor 245 #define k8LtstGray2Color 246 #define k8LtstGray3Color 43 #define k8LtstGray4Color 247 #define k8LtstGray5Color 248 #define k8LtGrayColor 249 #define k8GrayColor 250 #define k8Gray2Color 251 #define k8DkGrayColor 252 #define k8DkGray2Color 253 #define k8DkGray3Color 172 #define k8DkstGrayColor 254 #define k8BlackColor 255 void DrawClockDigit (short, Rect *); void DrawClockHands (Point, short, short); void DrawLargeClockHands (Point, short, short); //============================================================== Functions //-------------------------------------------------------------- DrawSimpleBlowers void DrawSimpleBlowers (short what, Rect *theRect) { CopyMask((BitMap *)*GetGWorldPixMap(blowerSrcMap), (BitMap *)*GetGWorldPixMap(blowerMaskMap), (BitMap *)*GetGWorldPixMap(backSrcMap), &srcRects[what], &srcRects[what], theRect); } //-------------------------------------------------------------- DrawTiki void DrawTiki (Rect *theRect, short down) { #define kTikiPoleBase 300 long darkGrayC, lightWoodC, darkWoodC; CGrafPtr wasCPort; GDHandle wasWorld; GetGWorld(&wasCPort, &wasWorld); SetGWorld(backSrcMap, nil); if (thisMac.isDepth == 4) { darkGrayC = 14; lightWoodC = 6; darkWoodC = 9; } else { darkGrayC = k8DkstGrayColor; lightWoodC = k8BambooColor; darkWoodC = k8PissYellowColor; } if (theRect->bottom < kTikiPoleBase + down) { ColorLine(theRect->left + 11, theRect->bottom - 1, theRect->left + 11, kTikiPoleBase + down - 1, darkGrayC); ColorLine(theRect->left + 12, theRect->bottom - 1, theRect->left + 12, kTikiPoleBase + down, lightWoodC); ColorLine(theRect->left + 13, theRect->bottom - 1, theRect->left + 13, kTikiPoleBase + down, darkWoodC); ColorLine(theRect->left + 14, theRect->bottom - 1, theRect->left + 14, kTikiPoleBase + down, darkWoodC); ColorLine(theRect->left + 15, theRect->bottom - 1, theRect->left + 15, kTikiPoleBase + down - 1, darkGrayC); } SetGWorld(wasCPort, wasWorld); CopyMask((BitMap *)*GetGWorldPixMap(blowerSrcMap), (BitMap *)*GetGWorldPixMap(blowerMaskMap), (BitMap *)*GetGWorldPixMap(backSrcMap), &srcRects[kTiki], &srcRects[kTiki], theRect); } //-------------------------------------------------------------- DrawInvisibleBlower void DrawInvisibleBlower (Rect *theRect) { Rect tempRect; CGrafPtr wasCPort; GDHandle wasWorld; GetGWorld(&wasCPort, &wasWorld); SetGWorld(backSrcMap, nil); QSetRect(&tempRect, 0, 0, 24, 24); QOffsetRect(&tempRect, theRect->left, theRect->top); ColorFrameRect(&tempRect, 192); SetGWorld(wasCPort, wasWorld); } //-------------------------------------------------------------- DrawLiftArea void DrawLiftArea (Rect *theRect) { CGrafPtr wasCPort; GDHandle wasWorld; GetGWorld(&wasCPort, &wasWorld); SetGWorld(backSrcMap, nil); ColorFrameRect(theRect, 192); SetGWorld(wasCPort, wasWorld); } //-------------------------------------------------------------- DrawTable void DrawTable (Rect *tableTop, short down) { #define kTableBa