GliderPRO/Sources/ObjectRects.c

1 line
31 KiB
C
Raw Normal View History

//============================================================================ //---------------------------------------------------------------------------- // ObjectRects.c //---------------------------------------------------------------------------- //============================================================================ #include "Externs.h" #include "RectUtils.h" #define kFloorColumnWide 4 #define kCeilingColumnWide 24 #define kFanColumnThick 16 #define kFanColumnDown 20 #define kDeadlyFlameHeight 24 #define kStoolThick 25 #define kShredderActiveHigh 40 short AddActiveRect (Rect *, short, short, Boolean, Boolean); extern hotPtr hotSpots; extern short nHotSpots, numChimes; //============================================================== Functions //-------------------------------------------------------------- GetObjectRect void GetObjectRect (objectPtr who, Rect *itsRect) { PicHandle thePict; short wide, tall; switch (who->what) { case kObjectIsEmpty: QSetRect(itsRect, 0, 0, 0, 0); break; case kFloorVent: case kCeilingVent: case kFloorBlower: case kCeilingBlower: case kSewerGrate: case kLeftFan: case kRightFan: case kTaper: case kCandle: case kStubby: case kTiki: case kBBQ: case kInvisBlower: case kGrecoVent: case kSewerBlower: *itsRect = srcRects[who->what]; ZeroRectCorner(itsRect); QOffsetRect(itsRect, who->data.a.topLeft.h, who->data.a.topLeft.v); break; case kLiftArea: QSetRect(itsRect, 0, 0, who->data.a.distance, who->data.a.tall * 2); QOffsetRect(itsRect, who->data.a.topLeft.h, who->data.a.topLeft.v); break; *itsRect = srcRects[who->what]; ZeroRectCorner(itsRect); QOffsetRect(itsRect, who->data.a.topLeft.h, who->data.a.topLeft.v); break; case kTable: case kShelf: case kCabinet: case kFilingCabinet: case kWasteBasket: case kMilkCrate: case kCounter: case kDresser: case kStool: case kTrunk: case kDeckTable: case kInvisObstacle: case kManhole: case kBooks: case kInvisBounce: *itsRect = who->data.b.bounds; break; case kRedClock: case kBlueClock: case kYellowClock: case kCuckoo: case kPaper: case kBattery: case kBands: case kGreaseRt: case kGreaseLf: case kFoil: case kInvisBonus: case kStar: case kSparkle: case kHelium: *itsRect = srcRects[who->what]; ZeroRectCorner(itsRect); QOffsetRect(itsRect, who->data.c.topLeft.h, who->data.c.topLeft.v); break; case kSlider: *itsRect = srcRects[who->what]; ZeroRectCorner(itsRect); QOffsetRect(itsRect, who->data.c.topLeft.h, who->data.c.topLeft.v); itsRect->right = itsRect->left + who->data.c.length; break; case kUpStairs: case kDownStairs: case kMailboxLf: case kMailboxRt: case kFloorTrans: case kCeilingTrans: case kDoorInLf: case kDoorInRt: case kDoorExRt: case kDoorExLf: case kWindowInLf: case kWindowInRt: case kWindowExRt: case kWindowExLf: *itsRect = srcRects[who->what]; ZeroRectCorner(itsRect); QOffsetRect(itsRect, who->data.d.topLeft.h, who->data.d.topLeft.v); break; case kInvisTrans: *itsRect = srcRects[who->what]; ZeroRectCorner(itsRect); QOffsetRect(itsRect, who->data.d.topLeft.h, who->data.d.topLeft.v); itsRect->bottom = itsRect->top + who->data.d.tall; itsRect->right += (short)who->data.d.wide; break; case kDeluxeTrans: wide = (who->data.d.tall & 0xFF00) >> 8; // Get high byte tall = who->data.d.tall & 0x00FF; // Get low byte QSetRect(itsRect, 0, 0, wide * 4, tall * 4); // Scale by 4 QOffsetRect(itsRect, who->data.d.topLeft.h, who->data.d.topLeft.v); break; case kLightSwitch: case kMachineSwitch: case kThermostat: case kPowerSwitch: case kKnifeSwitch: case kInvisSwitch: case kTrigger: case kLgTrigger: case kSoundTrigger: *itsRect = srcRects[who->what]; ZeroRectCorner(itsRect); QOffsetRect(itsRect, who->data.e.topLeft.h, who->data.e.topLeft.v); break; case kCeilingLight: case kLightBulb: case