First check-in.
authorJohn Calhoun <calhoun@Johns-MacBook-Pro-5.local>
Thu, 28 Jan 2016 16:10:38 +0000 (08:10 -0800)
committerJohn Calhoun <calhoun@Johns-MacBook-Pro-5.local>
Thu, 28 Jan 2016 16:10:38 +0000 (08:10 -0800)
Sources for Glider PRO, a Macintosh game written by John Calhoun and
published by Casady & Greene, Inc. I believe it was using CodeWarrior
IDE to create a fat (68K and PowerPC) binary.

134 files changed:
CarbonLib [new file with mode: 0755]
Glider PRO CW5.mcp [new file with mode: 0755]
Glider PRO.mcp [new file with mode: 0755]
Glider PRO.rsrc [new file with mode: 0755]
Headers/About.h [new file with mode: 0755]
Headers/DialogUtils.h [new file with mode: 0755]
Headers/DynamicMaps.h [new file with mode: 0755]
Headers/Environ.h [new file with mode: 0755]
Headers/Externs.h [new file with mode: 0755]
Headers/GameOver.h [new file with mode: 0755]
Headers/GliderDefines.h [new file with mode: 0755]
Headers/GliderProtos.h [new file with mode: 0755]
Headers/GliderStructs.h [new file with mode: 0755]
Headers/GliderVars.h [new file with mode: 0755]
Headers/House.h [new file with mode: 0755]
Headers/MainWindow.h [new file with mode: 0755]
Headers/Map.h [new file with mode: 0755]
Headers/Marquee.h [new file with mode: 0755]
Headers/ObjectEdit.h [new file with mode: 0755]
Headers/Objects.h [new file with mode: 0755]
Headers/Play.h [new file with mode: 0755]
Headers/Player.h [new file with mode: 0755]
Headers/RectUtils.h [new file with mode: 0755]
Headers/Room.h [new file with mode: 0755]
Headers/RoomGraphics.h [new file with mode: 0755]
Headers/RubberBands.h [new file with mode: 0755]
Headers/Scoreboard.h [new file with mode: 0755]
Headers/Tools.h [new file with mode: 0755]
Headers/Utilities.h [new file with mode: 0755]
Houses/Art Museum [new file with mode: 0755]
Houses/Art Museum.mov [new file with mode: 0755]
Houses/CD Demo House [new file with mode: 0755]
Houses/CD Demo House.mov [new file with mode: 0755]
Houses/California or Bust! [new file with mode: 0755]
Houses/Castle o' the Air [new file with mode: 0755]
Houses/Castle o' the Air.mov [new file with mode: 0755]
Houses/Davis Station [new file with mode: 0755]
Houses/Davis Station.mov [new file with mode: 0755]
Houses/Demo House [new file with mode: 0755]
Houses/Demo House.mov [new file with mode: 0755]
Houses/Empty House [new file with mode: 0755]
Houses/Fun House [new file with mode: 0755]
Houses/Grand Prix [new file with mode: 0755]
Houses/Grand Prix.mov [new file with mode: 0755]
Houses/ImagineHouse PRO II [new file with mode: 0755]
Houses/ImagineHouse PRO II.mov [new file with mode: 0755]
Houses/In The Mirror [new file with mode: 0755]
Houses/Land of Illusion [new file with mode: 0755]
Houses/Land of Illusion.mov [new file with mode: 0755]
Houses/Leviathan [new file with mode: 0755]
Houses/Leviathan.mov [new file with mode: 0755]
Houses/Metropolis [new file with mode: 0755]
Houses/Nemo's Market [new file with mode: 0755]
Houses/Nemo's Market.mov [new file with mode: 0755]
Houses/Rainbow's End [new file with mode: 0755]
Houses/Rainbow's End.mov [new file with mode: 0755]
Houses/Sampler [new file with mode: 0755]
Houses/Slumberland [new file with mode: 0755]
Houses/Slumberland.mov [new file with mode: 0755]
Houses/SpacePods [new file with mode: 0755]
Houses/SpacePods.mov [new file with mode: 0755]
Houses/Teddy World [new file with mode: 0755]
Houses/Teddy World.mov [new file with mode: 0755]
Houses/The Asylum Pro [new file with mode: 0755]
Houses/Titanic [new file with mode: 0755]
Houses/Titanic.mov [new file with mode: 0755]
Prefix.h [new file with mode: 0755]
Sources/About.c [new file with mode: 0755]
Sources/AnimCursor.c [new file with mode: 0755]
Sources/AppleEvents.c [new file with mode: 0755]
Sources/Banner.c [new file with mode: 0755]
Sources/ColorUtils.c [new file with mode: 0755]
Sources/Coordinates.c [new file with mode: 0755]
Sources/DebugUtilities.c [new file with mode: 0755]
Sources/DialogUtils.c [new file with mode: 0755]
Sources/DynamicMaps.c [new file with mode: 0755]
Sources/Dynamics.c [new file with mode: 0755]
Sources/Dynamics2.c [new file with mode: 0755]
Sources/Dynamics3.c [new file with mode: 0755]
Sources/Environ.c [new file with mode: 0755]
Sources/Events.c [new file with mode: 0755]
Sources/FileError.c [new file with mode: 0755]
Sources/GameOver.c [new file with mode: 0755]
Sources/Grease.c [new file with mode: 0755]
Sources/HighScores.c [new file with mode: 0755]
Sources/House.c [new file with mode: 0755]
Sources/HouseIO.c [new file with mode: 0755]
Sources/HouseInfo.c [new file with mode: 0755]
Sources/HouseLegal.c [new file with mode: 0755]
Sources/Input.c [new file with mode: 0755]
Sources/Interactions.c [new file with mode: 0755]
Sources/InterfaceInit.c [new file with mode: 0755]
Sources/Link.c [new file with mode: 0755]
Sources/Main.c [new file with mode: 0755]
Sources/MainWindow.c [new file with mode: 0755]
Sources/Map.c [new file with mode: 0755]
Sources/Marquee.c [new file with mode: 0755]
Sources/Menu.c [new file with mode: 0755]
Sources/Modes.c [new file with mode: 0755]
Sources/Music.c [new file with mode: 0755]
Sources/ObjectAdd.c [new file with mode: 0755]
Sources/ObjectDraw.c [new file with mode: 0755]
Sources/ObjectDraw2.c [new file with mode: 0755]
Sources/ObjectDrawAll.c [new file with mode: 0755]
Sources/ObjectEdit.c [new file with mode: 0755]
Sources/ObjectInfo.c [new file with mode: 0755]
Sources/ObjectRects.c [new file with mode: 0755]
Sources/Objects.c [new file with mode: 0755]
Sources/Play.c [new file with mode: 0755]
Sources/Player.c [new file with mode: 0755]
Sources/Prefs.c [new file with mode: 0755]
Sources/RectUtils.c [new file with mode: 0755]
Sources/Render.c [new file with mode: 0755]
Sources/Room.c [new file with mode: 0755]
Sources/RoomGraphics.c [new file with mode: 0755]
Sources/RoomInfo.c [new file with mode: 0755]
Sources/RubberBands.c [new file with mode: 0755]
Sources/SavedGames.c [new file with mode: 0755]
Sources/Scoreboard.c [new file with mode: 0755]
Sources/Scrap.c [new file with mode: 0755]
Sources/SelectHouse.c [new file with mode: 0755]
Sources/Settings.c [new file with mode: 0755]
Sources/Sound.c [new file with mode: 0755]
Sources/StringUtils.c [new file with mode: 0755]
Sources/StructuresInit.c [new file with mode: 0755]
Sources/StructuresInit2.c [new file with mode: 0755]
Sources/Tools.c [new file with mode: 0755]
Sources/Transit.c [new file with mode: 0755]
Sources/Transitions.c [new file with mode: 0755]
Sources/Triggers.c [new file with mode: 0755]
Sources/Trip.c [new file with mode: 0755]
Sources/Utilities.c [new file with mode: 0755]
Sources/Validate.c [new file with mode: 0755]
Sources/WindowUtils.c [new file with mode: 0755]

diff --git a/CarbonLib b/CarbonLib
new file mode 100755 (executable)
index 0000000..c134d7a
Binary files /dev/null and b/CarbonLib differ
diff --git a/Glider PRO CW5.mcp b/Glider PRO CW5.mcp
new file mode 100755 (executable)
index 0000000..85e1daa
Binary files /dev/null and b/Glider PRO CW5.mcp differ
diff --git a/Glider PRO.mcp b/Glider PRO.mcp
new file mode 100755 (executable)
index 0000000..589be91
Binary files /dev/null and b/Glider PRO.mcp differ
diff --git a/Glider PRO.rsrc b/Glider PRO.rsrc
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/Headers/About.h b/Headers/About.h
new file mode 100755 (executable)
index 0000000..1f8c23d
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                               About.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\rvoid DoAbout (void);\r\r\r
\ No newline at end of file
diff --git a/Headers/DialogUtils.h b/Headers/DialogUtils.h
new file mode 100755 (executable)
index 0000000..1a81109
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                               DialogUtils.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <Dialogs.h>\r\r\rvoid BringUpDialog (DialogPtr *theDialog, short dialogID);\r//void GetPutDialogCorner (Point *);\r//void GetGetDialogCorner (Point *);\r//void CenterDialog (short);\rvoid GetDialogRect (Rect *, short);\r//void TrueCenterDialog (short);\r//void CenterAlert (short);\r//void ZoomOutDialogRect (short);\r//void ZoomOutAlertRect (short);\rvoid FlashDialogButton (DialogPtr, short);\rvoid DrawDefaultButton (DialogPtr);\rvoid GetDialogString (DialogPtr, short, StringPtr);\rvoid SetDialogString (DialogPtr, short, StringPtr);\rshort GetDialogStringLen (DialogPtr, short);\rvoid GetDialogItemValue (DialogPtr, short, short *);\rvoid SetDialogItemValue (DialogPtr, short, short);\rvoid ToggleDialogItemValue (DialogPtr, short);\rvoid SetDialogNumToStr (DialogPtr, short, long);\rvoid GetDialogNumFromStr (DialogPtr, short, long *);\rvoid GetDialogItemRect (DialogPtr, short, Rect *);\rvoid SetDialogItemRect (DialogPtr, short, Rect *);\rvoid OffsetDialogItemRect (DialogPtr, short, short, short);\rvoid SelectFromRadioGroup (DialogPtr, short, short, short);\r//void AddMenuToPopUp (DialogPtr, short, MenuHandle);\rvoid GetPopUpMenuValue (DialogPtr, short, short *);\rvoid SetPopUpMenuValue (DialogPtr, short, short);\rvoid MyEnableControl(DialogPtr, short);\rvoid MyDisableControl(DialogPtr, short);\rvoid DrawDialogUserText (DialogPtr, short, StringPtr, Boolean);\rvoid DrawDialogUserText2 (DialogPtr, short, StringPtr);\rvoid LoadDialogPICT (DialogPtr, short, short);\rvoid FrameDialogItem (DialogPtr, short);\rvoid FrameDialogItemC (DialogPtr, short, long);\rvoid FrameOvalDialogItem (DialogPtr, short);\rvoid BorderDialogItem (DialogPtr, short, short);\rvoid ShadowDialogItem (DialogPtr, short, short);\rvoid EraseDialogItem (DialogPtr, short);\r
\ No newline at end of file
diff --git a/Headers/DynamicMaps.h b/Headers/DynamicMaps.h
new file mode 100755 (executable)
index 0000000..d409392
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                 DynamicMaps.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r
\ No newline at end of file
diff --git a/Headers/Environ.h b/Headers/Environ.h
new file mode 100755 (executable)
index 0000000..1c972bc
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                               Environ.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <Quickdraw.h>\r\r\rtypedef struct\r{\r    Rect            screen, gray;\r  long            dirID;\r short           wasDepth, isDepth;\r     short           thisResFile;\r   short           numScreens;\r    short           vRefNum;\r       Boolean         can1Bit;\r       Boolean         can4Bit;\r       Boolean         can8Bit;\r       Boolean         wasColorOrGray;\r        Boolean         hasWNE;\r        Boolean         hasSystem7;\r    Boolean         hasColor;\r      Boolean         hasGestalt;\r    Boolean         canSwitch;\r     Boolean         canColor;\r      Boolean         hasSM3;\r        Boolean         hasQT;\r Boolean         hasDrag;\r} macEnviron;\r\r\rextern macEnviron      thisMac;\r\r\r
\ No newline at end of file
diff --git a/Headers/Externs.h b/Headers/Externs.h
new file mode 100755 (executable)
index 0000000..39b299f
--- /dev/null
@@ -0,0 +1 @@
+\r//============================================================================\r//----------------------------------------------------------------------------\r//                                                              Externs.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#pragma once\r\r\r#include <Menus.h>\r\r\r#define kPreferredDepth                           8\r\r\r#define     kNilPointer                                     0L\r#define      kPutInFront                                     (WindowPtr)-1L\r#define  kNormalUpdates                          TRUE\r#define kOneKilobyte                               1024\r#define kOkayButton                                        1\r#define kCancelButton                         2\r#define kControlActive                                0\r#define kControlInactive                      255\r#define kAsynch                                             TRUE\r#define kSynch                                             FALSE\r\r#define kHomeKeyASCII                            0x01\r#define kEnterKeyASCII                             0x03\r#define kEndKeyASCII                               0x04\r#define kHelpKeyASCII                              0x05\r#define    kDeleteKeyASCII                         0x08\r#define kTabKeyASCII                               0x09\r#define kPageUpKeyASCII                            0x0B\r#define kPageDownKeyASCII                  0x0C\r#define    kReturnKeyASCII                         0x0D\r#define    kFunctionKeyASCII                       0x10\r#define    kClearKeyASCII                          0x1A\r#define    kEscapeKeyASCII                         0x1B\r#define    kLeftArrowKeyASCII                      0x1C\r#define kRightArrowKeyASCII                        0x1D\r#define    kUpArrowKeyASCII                        0x1E\r#define kDownArrowKeyASCII                 0x1F\r#define kSpaceBarASCII                             0x20\r#define kExclamationASCII                  0x21\r#define kPlusKeyASCII                              0x2B\r#define kMinusKeyASCII                             0x2D\r#define k0KeyASCII                                 0x30\r#define k1KeyASCII                                 0x31\r#define k2KeyASCII                                 0x32\r#define k3KeyASCII                                 0x33\r#define k4KeyASCII                                 0x34\r#define k5KeyASCII                                 0x35\r#define k6KeyASCII                                 0x36\r#define k7KeyASCII                                 0x37\r#define k8KeyASCII                                 0x38\r#define k9KeyASCII                                 0x39\r\r#define kCapAKeyASCII                             0x41\r#define kCapBKeyASCII                              0x42\r#define kCapCKeyASCII                              0x43\r#define kCapDKeyASCII                              0x44\r#define kCapEKeyASCII                              0x45\r#define kCapFKeyASCII                              0x46\r#define kCapGKeyASCII                              0x47\r#define kCapHKeyASCII                              0x48\r#define kCapIKeyASCII                              0x49\r#define kCapJKeyASCII                              0x4A\r#define kCapKKeyASCII                              0x4B\r#define kCapLKeyASCII                              0x4C\r#define kCapMKeyASCII                              0x4D\r#define kCapNKeyASCII                              0x4E\r#define kCapOKeyASCII                              0x4F\r#define kCapPKeyASCII                              0x50\r#define kCapQKeyASCII                              0x51\r#define kCapRKeyASCII                              0x52\r#define kCapSKeyASCII                              0x53\r#define kCapTKeyASCII                              0x54\r#define kCapUKeyASCII                              0x55\r#define kCapVKeyASCII                              0x56\r#define kCapWKeyASCII                              0x57\r#define kCapXKeyASCII                              0x58\r#define kCapYKeyASCII                              0x59\r#define kCapZKeyASCII                              0x5A\r\r#define kAKeyASCII                                        0x61\r#define kBKeyASCII                                 0x62\r#define kCKeyASCII                                 0x63\r#define kDKeyASCII                                 0x64\r#define kEKeyASCII                                 0x65\r#define kFKeyASCII                                 0x66\r#define kGKeyASCII                                 0x67\r#define kHKeyASCII                                 0x68\r#define kIKeyASCII                                 0x69\r#define kJKeyASCII                                 0x6A\r#define kKKeyASCII                                 0x6B\r#define kLKeyASCII                                 0x6C\r#define kMKeyASCII                                 0x6D\r#define kNKeyASCII                                 0x6E\r#define kOKeyASCII                                 0x6F\r#define kPKeyASCII                                 0x70\r#define kQKeyASCII                                 0x71\r#define kRKeyASCII                                 0x72\r#define kSKeyASCII                                 0x73\r#define kTKeyASCII                                 0x74\r#define kUKeyASCII                                 0x75\r#define kVKeyASCII                                 0x76\r#define kWKeyASCII                                 0x77\r#define kXKeyASCII                                 0x78\r#define kYKeyASCII                                 0x79\r#define kZKeyASCII                                 0x7A\r#define kForwardDeleteASCII                        0x7F\r\r#define   kPlusKeypadMap                          66              // key map offset for + on keypad\r#define       kMinusKeypadMap                         73              // key map offset for - on keypad\r#define       kTimesKeypadMap                         68              // key map offset for * on keypad\r#define       k0KeypadMap                                     85              // key map offset for 0 on keypad\r#define       k1KeypadMap                                     84              // key map offset for 1 on keypad\r#define       k2KeypadMap                                     83              // key map offset for 2 on keypad\r#define       k3KeypadMap                                     82              // key map offset for 3 on keypad\r#define k4KeypadMap                                   81              // key map offset for 4 on keypad\r#define k5KeypadMap                                   80              // key map offset for 5 on keypad\r#define k6KeypadMap                                   95              // key map offset for 6 on keypad\r#define k7KeypadMap                                   94              // key map offset for 7 on keypad\r#define k8KeypadMap                                   92              // key map offset for 8 on keypad\r#define k9KeypadMap                                   91              // key map offset for 9 on keypad\r\r#define kUpArrowKeyMap                               121             // key map offset for up arrow\r#define kDownArrowKeyMap                 122             // key map offset for down arrow\r#define kRightArrowKeyMap                      123             // key map offset for right arrow\r#define kLeftArrowKeyMap                      124             // key map offset for left arrow\r\r#define kAKeyMap                                      7\r#define       kBKeyMap                                        12\r#define      kCKeyMap                                        15\r#define      kDKeyMap                                        5\r#define       kEKeyMap                                        9\r#define       kFKeyMap                                        4\r#define       kGKeyMap                                        2\r#define       kHKeyMap                                        3\r#define       kMKeyMap                                        41\r#define      kNKeyMap                                        42\r#define      kOKeyMap                                        24\r#define      kPKeyMap                                        36\r#define      kQKeyMap                                        11\r#define      kRKeyMap                                        8\r#define kSKeyMap                                      6\r#define kTKeyMap                                      22\r#define kVKeyMap                                     14\r#define kWKeyMap                                     10\r#define kXKeyMap                                     0\r#define kZKeyMap                                      1\r#define kPeriodKeyMap                         40\r#define      kCommandKeyMap                          48\r#define      kEscKeyMap                                      50\r#define      kDeleteKeyMap                           52\r#define kSpaceBarMap                         54\r#define      kTabKeyMap                                      55\r#define      kControlKeyMap                          60\r#define      kOptionKeyMap                           61\r#define      kCapsLockKeyMap                         62\r#define      kShiftKeyMap                            63\r\r#define kTabRawKey                                  0x30    // key map offset for Tab key\r#define kClearRawKey                              0x47    // key map offset for Clear key\r#define kF5RawKey                                       0x60    // key map offset for F5\r#define kF6RawKey                                      0x61    // key map offset for F6\r#define kF7RawKey                                      0x62    // key map offset for F7\r#define kF3RawKey                                      0x63    // key map offset for F3\r#define kF8RawKey                                      0x64    // key map offset for F8\r#define kF9RawKey                                      0x65    // key map offset for F9\r#define kF11RawKey                                     0x67    // key map offset for F11\r#define kF13RawKey                                    0x69    // key map offset for F13\r#define kF14RawKey                                    0x6B    // key map offset for F14\r#define kF10RawKey                                    0x6D    // key map offset for F10\r#define kF12RawKey                                    0x6F    // key map offset for F12\r#define kF15RawKey                                    0x71    // key map offset for F15\r#define kF4RawKey                                     0x76    // key map offset for F4\r#define kF2RawKey                                      0x78    // key map offset for F2\r#define kF1RawKey                                      0x7A    // key map offset for F1\r\r#define       kErrUnnaccounted                        1\r#define       kErrNoMemory                            2\r#define kErrDialogDidntLoad                   3\r#define kErrFailedResourceLoad                4\r#define kErrFailedGraphicLoad         5\r#define kErrFailedOurDirect                   6\r#define kErrFailedValidation          7\r#define kErrNeedSystem7                               8\r#define kErrFailedGetDevice                   9\r#define kErrFailedMemoryOperation     10\r#define kErrFailedCatSearch                  11\r#define kErrNeedColorQD                              12\r#define kErrNeed16Or256Colors                13\r\r#define iAbout                                      1\r#define iNewGame                              1\r#define iTwoPlayer                            2\r#define iOpenSavedGame                        3\r#define iLoadHouse                            5\r#define iQuit                                 7\r#define iEditor                                       1\r#define iHighScores                           3\r#define iPrefs                                        4\r#define iHelp                                 5\r#define iNewHouse                             1\r#define iSave                                 2\r#define iHouse                                        4\r#define iRoom                                 5\r#define iObject                                       6\r#define iCut                                  8\r#define iCopy                                 9\r#define iPaste                                        10\r#define iClear                                       11\r#define iDuplicate                           12\r#define iBringForward                        14\r#define iSendBack                            15\r#define iGoToRoom                            17\r#define iMapWindow                           19\r#define iObjectWindow                        20\r#define iCoordinateWindow            21\r\r//--------------------------------------------------------------  Structs\r/*\rtypedef        short           SICN[16];\rtypedef       SICN            *SICNList;\rtypedef      SICNList        *SICNHand;\r*/\r\r#pragma options align=mac68k\r\rtypedef struct\r{\r  Str32           wasDefaultName;\r        Str15           wasLeftName, wasRightName;\r     Str15           wasBattName, wasBandName;\r      Str15           wasHighName;\r   Str31           wasHighBanner;\r//       long            encrypted, fakeLong;\r   long            wasLeftMap, wasRightMap;\r       long            wasBattMap, wasBandMap;\r        short           wasVolume;\r     short           prefVersion;\r   short           wasMaxFiles;\r   short           wasEditH, wasEditV;\r    short           wasMapH, wasMapV;\r      short           wasMapWide, wasMapHigh;\r        short           wasToolsH, wasToolsV;\r  short           wasLinkH, wasLinkV;\r    short           wasCoordH, wasCoordV;\r  short           isMapLeft, isMapTop;\r   short           wasNumNeighbors;\r       short           wasDepthPref;\r  short           wasToolGroup;\r  short           smWarnings;\r    short           wasFloor, wasSuite;\r    Boolean         wasZooms, wasMusicOn;\r  Boolean         wasAutoEdit, wasDoColorFade;\r   Boolean         wasMapOpen, wasToolsOpen;\r      Boolean         wasCoordOpen, wasQuickTrans;\r   Boolean         wasIdleMusic, wasGameMusic;\r    Boolean         wasEscPauseKey;\r        Boolean         wasDoAutoDemo, wasScreen2;\r     Boolean         wasDoBackground, wasHouseChecks;\r       Boolean         wasPrettyMap, wasBitchDialogs;\r} prefsInfo;\r\r#pragma options align=reset\r\r//--------------------------------------------------------------  Prototypes\r\rvoid DoAbout (void);                                                                    // --- About.c\r\rvoid LoadCursors (void);                                                                // --- AnimCursor.c\rvoid DisposCursors (void);\rvoid IncrementCursor (void);\rvoid DecrementCursor (void);\rvoid SpinCursor (short);\rvoid BackSpinCursor (short);\r\rvoid ColorText (StringPtr, long);                                               // --- ColorUtils.c\rvoid ColorRect (Rect *, long);\rvoid ColorOval (Rect *, long);\rvoid ColorRegion (RgnHandle, long);\rvoid ColorLine (short, short, short, short, long);\rvoid HiliteRect (Rect *, short, short);\rvoid ColorFrameRect (Rect *, long);\rvoid ColorFrameWHRect (short, short, short, short, long);\rvoid ColorFrameOval (Rect *, long);\rvoid LtGrayForeColor (void);\rvoid GrayForeColor (void);\rvoid DkGrayForeColor (void);\rvoid RestoreColorsSlam (void);\r\rvoid MonitorWait (void);                                                                // --- DebugUtils.c\rvoid DisplayRect (Rect *);\rvoid FlashRect (Rect *);\rvoid CheckLegitRect(Rect *, Rect *);\rvoid DisplayLong (long);\rvoid DisplayShort (short);\rvoid FlashLong (long);\rvoid FlashShort (short);\rvoid DoBarGraph (short, short, short, short);\rshort BetaOkay (void);\rvoid DebugNum (long);\rvoid DisplayCTSeed (CGrafPtr);\rvoid FillScreenRed (void);\rvoid DumpToResEditFile (Ptr, long);\r\rvoid HandleEvent (void);                                                             // --- Event.c\rvoid HiliteAllWindows (void);\rvoid IgnoreThisClick (void);\r\rshort WhatsOurDepth (void);                                                          // --- Environs.c\rvoid SwitchToDepth (short, Boolean);\rvoid CheckOurEnvirons (void);\r//void ReflectSecondMonitorEnvirons (Boolean, Boolean, Boolean);\rvoid HandleDepthSwitching (void);\rvoid RestoreColorDepth (void);\rvoid CheckMemorySize (void);\rvoid SetAppMemorySize (long);\r\rBoolean CheckFileError (short, StringPtr);                           // --- File Error.c\r\rBoolean SavePrefs (prefsInfo *, short);                                    // --- Prefs.c\rBoolean LoadPrefs (prefsInfo *, short);\r\rvoid PasStringCopy (StringPtr, StringPtr);                              // --- StringUtils.c\rshort WhichStringFirst (StringPtr, StringPtr);\rvoid PasStringCopyNum (StringPtr, StringPtr, short);\rvoid PasStringConcat (StringPtr, StringPtr);\rvoid GetLineOfText (StringPtr, short, StringPtr);\rvoid WrapText (StringPtr, short);\rvoid GetFirstWordOfString (StringPtr, StringPtr);\rvoid CollapseStringToWidth (StringPtr, short);\rvoid GetChooserName (StringPtr);\rStringPtr GetLocalizedString (short, StringPtr);\r\rPoint MyGetGlobalMouse (void);                                                    // --- Utilities.c\rvoid ToolBoxInit (void);\rvoid FindOurDevice (void);\rshort RandomInt (short);\rlong RandomLong (long);\rvoid InitRandomLongQUS (void);\runsigned long RandomLongQUS (void);\r//void CenterAlert (short);\rvoid RedAlert (short);\r//void CreateOffScreenBitMap (Rect *, GrafPtr *);\r//void CreateOffScreenPixMap (Rect *, CGrafPtr *);\r//void KillOffScreenPixMap (CGrafPtr);\r//void KillOffScreenBitMap (GrafPtr);\rvoid LoadGraphic (short);\rvoid LoadScaledGraphic (short, Rect *);\r//void PlotSICN (Rect *, SICNHand, long);\rvoid LargeIconPlot (Rect *, short);\rvoid DrawCIcon (short, short, short);\rchar KeyMapOffsetFromRawKey (char);\rlong LongSquareRoot (long);\r//void HideMenuBarOld (void);\r//void ShowMenuBarOld (void);\rBoolean WaitForInputEvent (short);\rvoid WaitCommandQReleased (void);\rchar GetKeyMapFromMessage (long);\rvoid GetKeyName (long, StringPtr);\rBoolean OptionKeyDown (void);\rlong ExtractCTSeed (CGrafPtr);\r//void ForceCTSeed (CGrafPtr, long);\rvoid DelayTicks (long);\rvoid UnivGetSoundVolume (short *, Boolean);\rvoid  UnivSetSoundVolume (short, Boolean);\r\rBoolean ValidInstallation (Boolean);                                      // --- Validate.c\r\rvoid GetWindowLeftTop (WindowPtr, short *, short *); // --- WindowUtils.c\rvoid GetWindowRect (WindowPtr, Rect *);\rvoid GetLocalWindowRect (WindowPtr, Rect *);\r//void FlagWindowFloating (WindowPtr);\r//Boolean      IsWindowFloating (WindowPtr);\rvoid OpenMessageWindow (StringPtr);\rvoid SetMessageWindowMessage (StringPtr);\rvoid CloseMessageWindow (void);\rvoid CloseThisWindow (WindowPtr *);\r\r#ifdef powerc\r//       extern pascal void SetSoundVol(short level);            // for old Sound Manager\r//     extern pascal void GetSoundVol(short *level)\r// THREEWORDINLINE(0x4218, 0x10B8, 0x0260);\r#endif\r\r#include "GliderDefines.h"\r#include "GliderStructs.h"\r#include "GliderVars.h"\r#include "GliderProtos.h"
\ No newline at end of file
diff --git a/Headers/GameOver.h b/Headers/GameOver.h
new file mode 100755 (executable)
index 0000000..d90c6f9
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                       GameOver.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <QDOffscreen.h>\r\r\rextern GWorldPtr  angelSrcMap;\rextern GWorldPtr   angelMaskMap;\r
\ No newline at end of file
diff --git a/Headers/GliderDefines.h b/Headers/GliderDefines.h
new file mode 100755 (executable)
index 0000000..015e91d
--- /dev/null
@@ -0,0 +1 @@
+\r//============================================================================\r//----------------------------------------------------------------------------\r//                                                              GliderDefines.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r//==============================================================  Defines\r\r//#define CREATEDEMODATA\r//#define COMPILEDEMO\r//#define CAREFULDEBUG\r#define COMPILENOCP\r#define COMPILEQT\r#define BUILD_ARCADE_VERSION             1\r\r#define kYellowUnaccounted                   1\r#define kYellowFailedResOpen          2\r#define kYellowFailedResAdd                   3\r#define kYellowFailedResCreate                4\r#define kYellowNoHouses                               5\r#define kYellowNewerVersion                   6\r#define kYellowNoBackground                   7\r#define kYellowIllegalRoomNum         8\r#define kYellowNoBoundsRes                    9\r#define kYellowScrapError                     10\r#define kYellowNoMemory                              11\r#define kYellowFailedWrite                   12\r#define kYellowNoMusic                               13\r#define kYellowFailedSound                   14\r#define kYellowAppleEventErr         15\r#define kYellowOpenedOldHouse                16\r#define kYellowLostAllHouses         17\r#define kYellowFailedSaveGame                18\r#define kYellowSavedTimeWrong                19\r#define kYellowSavedVersWrong                20\r#define kYellowSavedRoomsWrong               21\r#define kYellowQTMovieNotLoaded              22\r#define kYellowNoRooms                               23\r#define kYellowCantOrderLinks                24\r\r#define kSwitchIfNeeded                             0\r#define kSwitchTo256Colors                    1\r#define kSwitchTo16Grays                      2\r\r#define kProdGameScoreMode                   -4\r#define kKickGameScoreMode                   -3\r#define kPlayGameScoreMode                   -2\r#define kPlayWholeScoreMode                  -1\r#define kPlayChorus                                  4\r#define kPlayRefrainSparse1                   5\r#define kPlayRefrainSparse2                   6\r\r#define kHitWallSound                                0                       //   ¥¥¥¥¥¥\r#define kFadeInSound                                1                       //  ¥¥\r#define kFadeOutSound                            2                       //   ¥¥¥¥¥¥\r#define kBeepsSound                                 3                       //        ¥¥\r#define kBuzzerSound                               4                       //   ¥¥¥¥¥¥\r#define kDingSound                                  5                       //\r#define kEnergizeSound                               6                       //   ¥¥¥¥¥¥\r#define kFollowSound                                7                       //  ¥¥    ¥¥\r#define kMicrowavedSound                   8                       //  ¥¥    ¥¥\r#define kSwitchSound                               9                       //  ¥¥    ¥¥\r#define kBirdSound                                 10                      //   ¥¥¥¥¥¥\r#define kCuckooSound                                11                      //\r#define kTikSound                                    12                      //  ¥¥    ¥¥\r#define kTokSound                                  13                      //  ¥¥    ¥¥\r#define kBlowerOn                                  14                      //  ¥¥    ¥¥\r#define kBlowerOff                                 15                      //  ¥¥    ¥¥\r#define kCaughtFireSound                   16                      //   ¥¥¥¥¥¥\r#define kScoreTikSound                              17                      //\r#define kThrustSound                         18                      //  ¥¥¥   ¥¥\r#define kFizzleSound                               19                      //  ¥¥¥¥  ¥¥\r#define kFireBandSound                             20                      //  ¥¥ ¥¥ ¥¥\r#define kBandReboundSound                  21                      //  ¥¥  ¥¥¥¥\r#define kGreaseSpillSound                  22                      //  ¥¥   ¥¥¥\r#define kChordSound                                        23                      //\r#define kVCRSound                                    24                      //  ¥¥¥¥¥¥¥\r#define kFoilHitSound                               25                      //  ¥¥    ¥¥\r#define kShredSound                                        26                      //  ¥¥    ¥¥\r#define kToastLaunchSound                  27                      //  ¥¥    ¥¥\r#define kToastLandSound                            28                      //  ¥¥¥¥¥¥¥\r#define kMacOnSound                                 29                      //\r#define kMacBeepSound                                30                      //\r#define kMacOffSound                         31                      //\r#define kTVOnSound                                   32                      //\r#define kTVOffSound                                  33                      //   ¥¥¥¥¥¥\r#define kCoffeeSound                                34                      //  ¥¥\r#define kMysticSound                             35                      //   ¥¥¥¥¥¥\r#define kZapSound                                   36                      //        ¥¥\r#define kPopSound                                  37                      //   ¥¥¥¥¥¥\r#define kEnemyInSound                               38                      //\r#define kEnemyOutSound                               39                      //   ¥¥¥¥¥¥\r#define kPaperCrunchSound                   40                      //  ¥¥    ¥¥\r#define kBounceSound                               41                      //  ¥¥    ¥¥\r#define kDripSound                                 42                      //  ¥¥    ¥¥\r#define kDropSound                                 43                      //   ¥¥¥¥¥¥\r#define kFishOutSound                               44                      //\r#define kFishInSound                         45                      //  ¥¥    ¥¥\r#define kDontExitSound                             46                      //  ¥¥    ¥¥\r#define kSizzleSound                               47                      //  ¥¥    ¥¥\r#define kPaper1Sound                               48                      //  ¥¥    ¥¥\r#define kPaper2Sound                               49                      //   ¥¥¥¥¥¥\r#define kPaper3Sound                                50                      //\r#define kPaper4Sound                         51                      //  ¥¥¥   ¥¥\r#define kTypingSound                               52                      //  ¥¥¥¥  ¥¥\r#define kCarriageSound                             53                      //  ¥¥ ¥¥ ¥¥\r#define kChord2Sound                               54                      //  ¥¥  ¥¥¥¥\r#define kPhoneRingSound                            55                      //  ¥¥   ¥¥¥\r#define kChime1Sound                               56                      //\r#define kChime2Sound                         57                      //  ¥¥¥¥¥¥¥\r#define kWebTwangSound                              58                      //  ¥¥    ¥¥\r#define kTransOutSound                             59                      //  ¥¥    ¥¥\r#define kTransInSound                              60                      //  ¥¥    ¥¥\r#define kBonusSound                                        61                      //  ¥¥¥¥¥¥¥\r#define kHissSound                                  62                      //\r#define kTriggerSound                                63\r\r#define kHitWallPriority                    100                     //   ¥¥¥¥¥¥\r#define kScoreTikPriority                   101                     //  ¥¥\r#define kBandReboundPriority             102                     //   ¥¥¥¥¥¥\r#define kDontExitPriority                   103                     //        ¥¥\r#define kTikPriority                               200                     //   ¥¥¥¥¥¥\r#define kTokPriority                                201                     //\r#define kMysticPriority                              202                     //   ¥¥¥¥¥¥\r#define kChime1Priority                             203                     //  ¥¥    ¥¥\r#define kChime2Priority                            204                     //  ¥¥    ¥¥\r#define kThrustPriority                            300                     //  ¥¥    ¥¥\r#define kFireBandPriority                  301                     //   ¥¥¥¥¥¥\r#define kChordPriority                              302                     //\r#define kVCRPriority                         303                     //  ¥¥    ¥¥\r#define kToastLaunchPriority               304                     //  ¥¥    ¥¥\r#define kToastLandPriority                 305                     //  ¥¥    ¥¥\r#define kCoffeePriority                            306                     //  ¥¥    ¥¥\r#define kBouncePriority                            307                     //   ¥¥¥¥¥¥\r#define kDripPriority                               308                     //\r#define kDropPriority                                309                     //  ¥¥¥   ¥¥\r#define kWebTwangPriority                  310                     //  ¥¥¥¥  ¥¥\r#define kHissPriority                              311                     //  ¥¥ ¥¥ ¥¥\r#define kFoilHitPriority                   400                     //  ¥¥  ¥¥¥¥\r#define kMacOnPriority                             401                     //  ¥¥   ¥¥¥\r#define kMacOffPriority                            402                     //\r#define kMacBeepPriority                     403                     //  ¥¥¥¥¥¥¥\r#define kTVOnPriority                               404                     //  ¥¥    ¥¥\r#define kTVOffPriority                             405                     //  ¥¥    ¥¥\r#define kZapPriority                               406                     //  ¥¥    ¥¥\r#define kPopPriority                               407                     //  ¥¥¥¥¥¥¥\r#define kEnemyInPriority                    408                     //\r#define kEnemyOutPriority                    409                     //\r#define kPaperCrunchPriority         410                     //\r#define kFishOutPriority                     411                     //\r#define kFishInPriority                              412                     //\r#define kSizzlePriority                              413\r#define kPhoneRingPriority                  500\r#define kSwitchPriority                             700\r#define kBlowerOnPriority                   701\r#define kBlowerOffPriority                  702\r#define kFizzlePriority                             703\r#define kBeepsPriority                              800\r#define kBuzzerPriority                             801\r#define kDingPriority                               802\r#define kEnergizePriority                   803\r#define kBirdPriority                               804\r#define kCuckooPriority                             805\r#define kGreaseSpillPriority                806\r#define kPapersPriority                             807\r#define kTypingPriority                             808\r#define kCarriagePriority                   809\r#define kChord2Priority                             810\r#define kMicrowavedPriority                 811\r#define kBonusPriority                              812\r#define kFadeInPriority                             900\r#define kFadeOutPriority                    901\r#define kCaughtFirePriority                 902\r#define kShredPriority                              903\r#define kFollowPriority                             904\r#define kTransInPriority                    905\r#define kTransOutPriority                   906\r#define kTriggerPriority                    999\r\r#define kArrowCursor                               0\r#define kBeamCursor                                   1\r#define kHandCursor                                   2\r\r#define kAppleMenuID                         128\r#define kGameMenuID                                 129\r#define kOptionsMenuID                              130\r#define kHouseMenuID                                131\r\r#define kSplashMode                                        0\r#define kEditMode                                     1\r#define kPlayMode                                     2\r\r#define kIdleSplashMode                              0\r#define kIdleDemoMode                         1\r#define kIdleSplashTicks                      7200L           // 2 minutes\r#define kIdleLastMode                              1\r\r#define kRoomAbove                                   1\r#define kRoomBelow                                    2\r#define kRoomToRight                          3\r#define kRoomToLeft                                   4\r\r#define kBumpUp                                              1\r#define kBumpDown                                     2\r#define kBumpRight                                    3\r#define kBumpLeft                                     4\r\r#define kAbove                                               1\r#define kToRight                                      2\r#define kBelow                                                3\r#define kToLeft                                               4\r#define kBottomCorner                         5\r#define kTopCorner                                    6\r\r#define kCentralRoom                         0\r#define kNorthRoom                                    1\r#define kNorthEastRoom                                2\r#define kEastRoom                                     3\r#define kSouthEastRoom                                4\r#define kSouthRoom                                    5\r#define kSouthWestRoom                                6\r#define kWestRoom                                     7\r#define kNorthWestRoom                                8\r\r#define kSimpleRoom                                  2000\r#define kPaneledRoom                               2001\r#define kBasement                                  2002\r#define kChildsRoom                                        2003\r#define kAsianRoom                                 2004\r#define kUnfinishedRoom                            2005\r#define kSwingersRoom                              2006\r#define kBathroom                                  2007\r#define kLibrary                                   2008\r#define kGarden                                            2009\r#define kSkywalk                                   2010\r#define kDirt                                              2011\r#define kMeadow                                            2012\r#define kField                                             2013\r#define kRoof                                              2014\r#define kSky                                               2015\r#define kStratosphere                              2016\r#define kStars                                             2017\r\r#define kMapRoomHeight                            20\r#define kMapRoomWidth                                32\r\r#define kMaxScores                                  10\r#define kMaxRoomObs                                  24\r#define kMaxSparkles                         3\r#define kNumSparkleModes                      5\r#define kMaxFlyingPts                         3\r#define kMaxFlyingPointsLoop          24\r#define kMaxCandles                                  20\r#define kMaxTikis                                    8\r#define kMaxCoals                                     8\r#define kMaxPendulums                         8\r#define kMaxHotSpots                          56\r#define kMaxSavedMaps                                24\r#define kMaxRubberBands                              2\r#define kMaxGrease                                    16\r#define kMaxStars                                    4\r#define kMaxShredded                          4\r#define kMaxDynamicObs                                18\r#define kMaxMasterObjects                    216             // kMaxRoomObs * 9\r#define kMaxViewWidth                                1536\r#define kMaxViewHeight                             1026\r\r#define kSelectTool                                       0\r\r#define kBlowerMode                                  1\r#define kFurnitureMode                                2\r#define kBonusMode                                    3\r#define kTransportMode                                4\r#define kSwitchMode                                   5\r#define kLightMode                                    6\r#define kApplianceMode                                7\r#define kEnemyMode                                    8\r#define kClutterMode                          9\r\r#define kIgnoreIt                                    0                       //   ¥¥¥¥¥¥\r#define kLiftIt                                             1                       //  ¥¥    ¥¥\r#define kDropIt                                            2                       //  ¥¥¥¥¥¥¥¥\r#define kPushItLeft                                        3                       //  ¥¥    ¥¥\r#define kPushItRight                               4                       //  ¥¥    ¥¥\r#define kDissolveIt                                        5                       //\r#define kRewardIt                                    6                       //   ¥¥¥¥¥¥\r#define kMoveItUp                                   7                       //  ¥¥    ¥¥\r#define kMoveItDown                                        8                       //  ¥¥\r#define kSwitchIt                                        9                       //  ¥¥    ¥¥\r#define kShredIt                                   10                      //   ¥¥¥¥¥¥\r#define kStrumIt                                    11                      //\r#define kTriggerIt                                   12                      //  ¥¥¥¥¥¥¥¥\r#define kBurnIt                                            13                      //     ¥¥\r#define kSlideIt                                      14                      //     ¥¥\r#define kTransportIt                          15                      //     ¥¥\r#define kIgnoreLeftWall                               16                      //     ¥¥\r#define kIgnoreRightWall                      17                      //\r#define kMailItLeft                                  18                      //   ¥¥¥¥¥¥\r#define kMailItRight                                19                      //     ¥¥\r#define kDuctItDown                                   20                      //     ¥¥\r#define kDuctItUp                                     21                      //     ¥¥\r#define kMicrowaveIt                          22                      //   ¥¥¥¥¥¥\r#define kIgnoreGround                               23                      //\r#define kBounceIt                                    24                      //\r#define kChimeIt                                     25                      //     ¥¥\r#define kWebIt                                                26                      //     ¥¥\r#define kSoundIt                                      27\r\r#define kFloorVent                                  0x01            // Blowers\r#define kCeilingVent                         0x02\r#define kFloorBlower                               0x03\r#define kCeilingBlower                             0x04\r#define kSewerGrate                                        0x05\r#define kLeftFan                                   0x06\r#define kRightFan                                  0x07\r#define kTaper                                             0x08\r#define kCandle                                            0x09\r#define kStubby                                            0x0A\r#define kTiki                                              0x0B\r#define kBBQ                                               0x0C\r#define kInvisBlower                               0x0D\r#define kGrecoVent                                 0x0E\r#define kSewerBlower                               0x0F\r#define kLiftArea                                  0x10\r\r#define kTable                                            0x11            // Furniture\r#define kShelf                                             0x12\r#define kCabinet                                   0x13\r#define kFilingCabinet                             0x14\r#define kWasteBasket                               0x15\r#define kMilkCrate                                 0x16\r#define kCounter                                   0x17\r#define kDresser                                   0x18\r#define kDeckTable                                 0x19\r#define kStool                                             0x1A\r#define kTrunk                                             0x1B\r#define kInvisObstacle                             0x1C\r#define kManhole                                   0x1D\r#define kBooks                                             0x1E\r#define kInvisBounce                               0x1F\r\r#define kRedClock                                 0x21            // Prizes\r#define kBlueClock                                    0x22\r#define kYellowClock                               0x23\r#define kCuckoo                                            0x24\r#define kPaper                                             0x25\r#define kBattery                                   0x26\r#define kBands                                             0x27\r#define kGreaseRt                                  0x28\r#define kGreaseLf                                  0x29\r#define kFoil                                              0x2A\r#define kInvisBonus                                        0x2B\r#define kStar                                              0x2C\r#define kSparkle                                   0x2D\r#define kHelium                                            0x2E\r#define kSlider                                            0x2F\r\r#define kUpStairs                                 0x31            // Transport\r#define kDownStairs                                        0x32\r#define kMailboxLf                                 0x33\r#define kMailboxRt                                 0x34\r#define kFloorTrans                                        0x35\r#define kCeilingTrans                              0x36\r#define kDoorInLf                                  0x37\r#define kDoorInRt                                  0x38\r#define kDoorExRt                                  0x39\r#define kDoorExLf                                  0x3A\r#define kWindowInLf                                        0x3B\r#define kWindowInRt                                        0x3C\r#define kWindowExRt                                        0x3D\r#define kWindowExLf                                        0x3E\r#define kInvisTrans                                        0x3F\r#define kDeluxeTrans                               0x40\r\r#define kLightSwitch                              0x41            // Switches\r#define kMachineSwitch                              0x42\r#define kThermostat                                        0x43\r#define kPowerSwitch                               0x44\r#define kKnifeSwitch                               0x45\r#define kInvisSwitch                               0x46\r#define kTrigger                                   0x47\r#define kLgTrigger                                 0x48\r#define kSoundTrigger                              0x49\r\r#define kCeilingLight                             0x51            // Lights\r#define kLightBulb                                    0x52\r#define kTableLamp                                 0x53\r#define kHipLamp                                   0x54\r#define kDecoLamp                                  0x55\r#define kFlourescent                               0x56\r#define kTrackLight                                        0x57\r#define kInvisLight                                        0x58\r\r#define kShredder                                 0x61            // Appliances\r#define kToaster                                  0x62\r#define kMacPlus                                   0x63\r#define kGuitar                                            0x64\r#define kTV                                                        0x65\r#define kCoffee                                            0x66\r#define kOutlet                                            0x67\r#define kVCR                                               0x68\r#define kStereo                                            0x69\r#define kMicrowave                                 0x6A\r#define kCinderBlock                               0x6B\r#define kFlowerBox                                 0x6C\r#define kCDs                                               0x6D\r#define kCustomPict                                        0x6E\r\r#define kBalloon                                  0x71            // Enemies\r#define kCopterLf                                    0x72\r#define kCopterRt                                  0x73\r#define kDartLf                                            0x74\r#define kDartRt                                            0x75\r#define kBall                                              0x76\r#define kDrip                                              0x77\r#define kFish                                              0x78\r#define kCobweb                                            0x79\r\r#define kOzma                                             0x81            // Clutter\r#define kMirror                                              0x82\r#define kMousehole                                 0x83\r#define kFireplace                                 0x84\r#define kFlower                                            0x85\r#define kWallWindow                                        0x86\r#define kBear                                              0x87\r#define kCalendar                                  0x88\r#define kVase1                                             0x89\r#define kVase2                                             0x8A\r#define kBulletin                                  0x8B\r#define kCloud                                             0x8C\r#define kFaucet                                            0x8D\r#define kRug                                               0x8E\r#define kChimes                                            0x8F\r\r#define kNumSrcRects                              0x90\r\r#define kTableThick                                       8\r#define kShelfThick                                   6\r#define kToggle                                               0\r#define kForceOn                                      1\r#define kForceOff                                     2\r#define kOneShot                                      3\r#define kNumTrackLights                               3\r#define kNumOutletPicts                               4\r#define kNumCandleFlames                      5\r#define kNumTikiFlames                                5\r#define kNumBBQCoals                          4\r#define kNumPendulums                         3\r#define kNumBreadPicts                                6\r#define kNumBalloonFrames                     8\r#define kNumCopterFrames                      10\r#define kNumDartFrames                               4\r#define kNumBallFrames                                2\r#define kNumDripFrames                                6\r#define kNumFishFrames                                8\r#define kNumFlowers                                   6\r\r#define      kNumMarqueePats                         7\r#define kObjectNameStrings                    1007\r\r#define kSwitchLinkOnly                           3\r#define kTriggerLinkOnly                      4\r#define kTransportLinkOnly                    5\r\r#define kFloorVentTop                                305\r#define kCeilingVentTop                             8\r#define kFloorBlowerTop                               304\r#define kCeilingBlowerTop                   5\r#define kSewerGrateTop                                303\r#define kCeilingTransTop                    6\r#define kFloorTransTop                                302\r#define kStairsTop                                  28\r#define kCounterBottom                               304\r#define kDresserBottom                              293\r#define kCeilingLightTop                    4\r#define kHipLampTop                                   23\r#define kDecoLampTop                         91\r#define kFlourescentTop                              12\r#define kTrackLightTop                               5\r\r#define kDoorInTop                                   0\r#define kDoorInLfLeft                         0\r#define kDoorInRtLeft                         368\r#define kDoorExTop                                  0\r#define kDoorExLfLeft                         0\r#define kDoorExRtLeft                         496\r#define kWindowInTop                                64\r#define kWindowInLfLeft                              0\r#define kWindowInRtLeft                               492\r#define kWindowExTop                                64\r#define kWindowExLfLeft                              0\r#define kWindowExRtLeft                               496\r\r#define kNumTiles                                  8\r#define kTileWide                                     64\r#define kTileHigh                                    322\r#define kRoomWide                                   512                     // kNumTiles * kTileWide\r#define kFloorSupportTall                      44\r#define kVertLocalOffset                     322                     // kTileHigh - 39 (was 283, then 295)\r\r#define kCeilingLimit                            8\r#define kFloorLimit                                   312\r#define kRoofLimit                                  122\r#define kLeftWallLimit                              12\r#define kNoLeftWallLimit                     -24                     // 0 - (kGliderWide / 2)\r#define kRightWallLimit                                500\r#define kNoRightWallLimit                   536                     // kRoomWide + (kGliderWide / 2)\r#define kNoCeilingLimit                                -10\r#define kNoFloorLimit                               332\r\r#define kScoreboardHigh                            0\r#define kScoreboardLow                                1\r#define kScoreboardTall                               20\r\r#define kHouseVersion                               0x0200\r#define kNewHouseVersion                 0x0300\r#define kBaseBackgroundID                        2000\r#define kFirstOutdoorBack                  2009\r#define kNumBackgrounds                            18\r#define kUserBackground                              3000\r#define kUserStructureRange                        3300\r#define kSplash8BitPICT                            1000\r#define kRoomIsEmpty                               -1\r#define kObjectIsEmpty                               -1\r#define kNoObjectSelected                    -1\r#define kInitialGliderSelected               -2\r#define kLeftGliderSelected                  -3\r#define kRightGliderSelected         -4\r#define kWindoidWDEF                         2048\r#define kWindoidGrowWDEF                   2064\r#define kTicksPerFrame                             2\r#define kStarPictID                                   1995\r#define kNumUndergroundFloors              8\r#define kRoomVisitScore                               100\r#define kRedClockPoints                             100\r#define kBlueClockPoints                    300\r#define kYellowClockPoints                  500\r#define kCuckooClockPoints                  1000\r#define kStarPoints                                        5000\r#define kRedOrangeColor8                   23              // actually, 18\r#define kMaxNumRoomsH                           128\r#define kMaxNumRoomsV                               64\r#define kStartSparkle                                4\r#define kLengthOfZap                          30\r\r#define kGliderWide                                 48\r#define kGliderHigh                                  20\r#define kHalfGliderWide                              24\r#define kGliderBurningHigh                   26\r#define kShadowHigh                                  9\r#define kShadowTop                                    306\r#define kFaceRight                                  TRUE\r#define kFaceLeft                                  FALSE\r#define kPlayer1                                  TRUE\r#define kPlayer2                                   FALSE\r#define kNumGliderSrcRects                        31\r#define kNumShadowSrcRects                   2\r#define kFirstAboutFaceFrame          18\r#define kLastAboutFaceFrame                  20\r#define kWasBurning                                  2\r#define kLeftFadeOffset                               7\r#define kLastFadeSequence                     16\r#define kGliderFoil2PictID                   3963\r#define kGlider2PictID                             3974\r#define kGliderFoilPictID                  3976\r#define kGliderPictID                              3999\r#define kGliderStartsDown                  32\r\r#define kGliderNormal                               0                       //  ¥¥    ¥¥\r#define kGliderFadingIn                            1                       //  ¥¥¥  ¥¥¥\r#define kGliderFadingOut                   2                       //  ¥¥ ¥¥ ¥¥\r#define kGliderGoingUp                             3                       //  ¥¥    ¥¥\r#define kGliderComingUp                            4                       //  ¥¥    ¥¥\r#define kGliderGoingDown                   5                       // \r#define kGliderComingDown                   6                       //   ¥¥¥¥¥¥\r#define kGliderFaceLeft                             7                       //  ¥¥    ¥¥\r#define kGliderFaceRight                   8                       //  ¥¥    ¥¥\r#define kGliderBurning                             9                       //  ¥¥    ¥¥\r#define kGliderTransporting                        10                      //   ¥¥¥¥¥¥\r#define kGliderDuctingDown                  11                      //\r#define kGliderDuctingUp                     12                      //  ¥¥¥¥¥¥¥\r#define kGliderDuctingIn                    13                      //  ¥¥    ¥¥\r#define kGliderMailInLeft                  14                      //  ¥¥    ¥¥\r#define kGliderMailOutLeft                 15                      //  ¥¥    ¥¥\r#define kGliderMailInRight                 16                      //  ¥¥¥¥¥¥¥\r#define kGliderMailOutRight                 17                      //\r#define kGliderGoingFoil                     18                      //  ¥¥¥¥¥¥¥¥\r#define kGliderLosingFoil                  19                      //  ¥¥\r#define kGliderShredding                 20                      //  ¥¥¥¥\r#define kGliderInLimbo                         21                      //  ¥¥\r#define kGliderIdle                                      22                      //  ¥¥¥¥¥¥¥¥\r#define kGliderTransportingIn              23\r\r#define kPlayerIsDeadForever                -69\r#define kPlayerMailedOut                    -12\r#define kPlayerDuckedOut                    -11\r#define kPlayerTransportedOut               -10\r#define kPlayerEscapingDownStairs   -9\r#define kPlayerEscapingUpStairs              -8\r#define kPlayerEscapedDownStairs     -7\r#define kPlayerEscapedUpStairs               -6\r#define kPlayerEscapedDown                   -5\r#define kPlayerEscapedUp                     -4\r#define kPlayerEscapedLeft                   -3\r#define kPlayerEscapedRight                  -2\r#define kNoOneEscaped                                -1\r\r#define kLinkedToOther                              0\r#define kLinkedToLeftMailbox          1\r#define kLinkedToRightMailbox         2\r#define kLinkedToCeilingDuct          3\r#define kLinkedToFloorDuct                    4\r\r#define kResumeGameMode                              0\r#define kNewGameMode                          1\r\r#define kNormalTitleMode                     0\r#define kEscapedTitleMode                     1\r#define kSavingTitleMode                      2\r\r#define kScoreboardPictID                    1997\r\r#define kDemoLength                                       6702\r
\ No newline at end of file
diff --git a/Headers/GliderProtos.h b/Headers/GliderProtos.h
new file mode 100755 (executable)
index 0000000..af611a5
--- /dev/null
@@ -0,0 +1 @@
+\r//============================================================================\r//----------------------------------------------------------------------------\r//                                                              GliderProtos.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r//--------------------------------------------------------------  Prototypes\r\rvoid SetUpAppleEvents (void);                                                      // --- AppleEvents.c\r\rvoid BringUpBanner (void);                                                                // --- Banner.c\rSInt16 CountStarsInHouse (void);\rvoid DisplayStarsRemaining (void);\r\rvoid SetCoordinateHVD (SInt16, SInt16, SInt16);                    // --- Coordinate.c\rvoid DeltaCoordinateD (SInt16);\rvoid UpdateCoordWindow (void);\rvoid OpenCoordWindow (void);\rvoid CloseCoordWindow (void);\rvoid ToggleCoordinateWindow (void);\r\rvoid NilSavedMaps (void);                                                            // --- DynamicMaps.c\rSInt16 BackUpToSavedMap (Rect *, SInt16,  SInt16);\rSInt16 ReBackUpSavedMap (Rect *, SInt16, SInt16);\rvoid RestoreFromSavedMap (SInt16, SInt16, Boolean);\rvoid AddSparkle (Rect *);\rvoid AddFlyingPoint (Rect *, SInt16, SInt16, SInt16);\rvoid ReBackUpFlames (SInt16, SInt16);\rvoid AddCandleFlame (SInt16, SInt16, SInt16, SInt16);\rvoid ReBackUpTikiFlames (SInt16, SInt16);\rvoid AddTikiFlame (SInt16, SInt16, SInt16, SInt16);\rvoid ReBackUpBBQCoals (SInt16, SInt16);\rvoid AddBBQCoals (SInt16, SInt16, SInt16, SInt16);\rvoid ReBackUpPendulum (SInt16, SInt16);\rvoid AddPendulum (SInt16, SInt16, SInt16, SInt16);\rvoid ReBackUpStar (SInt16, SInt16);\rvoid AddStar (SInt16, SInt16, SInt16, SInt16);\rvoid StopPendulum (SInt16, SInt16);\rvoid StopStar (SInt16, SInt16);\rvoid AddAShreddedGlider (Rect *);\rvoid RemoveShreds (void);\rvoid ZeroFlamesAndTheLike (void);\r\rvoid CheckDynamicCollision (SInt16, gliderPtr, Boolean);    // --- Dynamics.c\rBoolean DidBandHitDynamic (SInt16);\rvoid RenderToast (SInt16);\rvoid RenderBalloon (SInt16);\rvoid RenderCopter (SInt16);\rvoid RenderDart (SInt16);\rvoid RenderBall (SInt16);\rvoid RenderDrip (SInt16);\rvoid RenderFish (SInt16);\rvoid HandleSparkleObject (SInt16);\rvoid HandleToast (SInt16);\rvoid HandleMacPlus (SInt16);\rvoid HandleTV (SInt16);\rvoid HandleCoffee (SInt16);\rvoid HandleOutlet (SInt16);\rvoid HandleVCR (SInt16);\rvoid HandleStereo (SInt16);\rvoid HandleMicrowave (SInt16);\r\rvoid HandleBalloon (SInt16);                                                          // --- Dynamics2.c\rvoid HandleCopter (SInt16);\rvoid HandleDart (SInt16);\rvoid HandleBall (SInt16);\rvoid HandleDrip (SInt16);\rvoid HandleFish (SInt16);\r\rvoid HandleDynamics (void);                                                             // --- Dynamics3.c\rvoid RenderDynamics (void);\rvoid ZeroDinahs (void);\rSInt16 AddDynamicObject (SInt16, Rect *, objectType *, SInt16, SInt16, Boolean);\r\rvoid DoGameOver (void);                                                                        // --- GameOver.c\rvoid FlagGameOver (void);\rvoid DoDiedGameOver (void);\r\rvoid HandleGrease (void);                                                              // --- Grease.c\rSInt16 ReBackUpGrease (SInt16, SInt16);\rSInt16 AddGrease (SInt16, SInt16, SInt16, SInt16, SInt16, Boolean);\rvoid SpillGrease (SInt16, SInt16);\rvoid RedrawAllGrease (void);\r\rvoid DoHighScores (void);                                                          // --- HighScores.c\rvoid SortHighScores (void);\rvoid ZeroHighScores (void);\rvoid ZeroAllButHighestScore (void);\rBoolean TestHighScore (void);\rBoolean WriteScoresToDisk (void);\rBoolean ReadScoresFromDisk (void);\r\rBoolean CreateNewHouse (void);                                                      // --- House.c\rBoolean InitializeEmptyHouse (void);\rSInt16 RealRoomNumberCount (void);\rSInt16 GetFirstRoomNumber (void);\rvoid WhereDoesGliderBegin (Rect *, SInt16);\rBoolean HouseHasOriginalPicts (void);\rSInt16 CountHouseLinks (void);\rvoid GenerateLinksList (void);\rvoid SortRoomsObjects (SInt16);\rvoid SortHouseObjects (void);\rSInt16 CountRoomsVisited (void);\rvoid GenerateRetroLinks (void);\rvoid DoGoToDialog (void);\rvoid ConvertHouseVer1To2 (void);\rvoid ShiftWholeHouse (SInt16);\r\rvoid DoHouseInfo (void);                                                             // --- HouseInfo.c\r\rBoolean OpenHouse (void);                                                           // --- HouseIO.c\rBoolean OpenSpecificHouse (FSSpec *);\rBoolean SaveHouseAs (void);\rBoolean ReadHouse (void);\rBoolean WriteHouse (Boolean);\rBoolean CloseHouse (void);\rvoid OpenHouseResFork (void);\rvoid CloseHouseResFork (void);\rBoolean QuerySaveChanges (void);\rvoid YellowAlert (SInt16, SInt16);\r\rBoolean KeepObjectLegal (void);                                                 // --- HouseLegal.c\rvoid CheckHouseForProblems (void);\r\rBoolean SectGlider (gliderPtr, Rect *, Boolean);                // --- Interactions.c\rvoid HandleSwitches (hotPtr);\rvoid HandleInteraction (void);\rvoid FlagStillOvers (gliderPtr);\r\rvoid InitializeMenus (void);                                                       // --- InterfaceInit.c\rvoid GetExtraCursors (void);\rvoid VariableInit (void);\r\rvoid GetDemoInput (gliderPtr);                                                   // --- Input.c\rvoid GetInput (gliderPtr);\r\rSInt16 MergeFloorSuite (SInt16, SInt16);                                     // --- Link.c\rvoid ExtractFloorSuite (SInt16, SInt16 *, SInt16 *);\rvoid UpdateLinkControl (void);\rvoid UpdateLinkWindow (void);\rvoid OpenLinkWindow (void);\rvoid CloseLinkWindow (void);\rvoid HandleLinkClick (Point);\r\rvoid RedrawSplashScreen (void);                                                 // --- MainWindow.c\rvoid UpdateMainWindow (void);\rvoid UpdateMenuBarWindow (void);\rvoid OpenMainWindow (void);\rvoid CloseMainWindow (void);\rvoid ZoomBetweenWindows (void);\rvoid UpdateEditWindowTitle (void);\rvoid HandleMainClick (Point, Boolean);\r//void WashColorIn (void);\r\rvoid CenterMapOnRoom (SInt16, SInt16);                                        // --- Map.c\rBoolean ThisRoomVisibleOnMap (void);\rvoid FindNewActiveRoomRect (void);\rvoid FlagMapRoomsForUpdate (void);\rvoid UpdateMapWindow (void);\rvoid ResizeMapWindow (SInt16, SInt16);\rvoid OpenMapWindow (void);\rvoid CloseMapWindow (void);\rvoid ToggleMapWindow (void);\rvoid HandleMapClick (EventRecord *);\rvoid MoveRoom (Point);\r\rvoid DoMarquee (void);                                                                     // --- Marquee.c\rvoid StartMarquee (Rect *);\rvoid StartMarqueeHandled (Rect *, SInt16, SInt16);\rvoid StopMarquee (void);\rvoid PauseMarquee (void);\rvoid ResumeMarquee (void);\rvoid DragOutMarqueeRect (Point, Rect *);\rvoid DragMarqueeRect (Point, Rect *, Boolean, Boolean);\rvoid DragMarqueeHandle (Point, SInt16 *);\rvoid DragMarqueeCorner (Point, SInt16 *, SInt16 *, Boolean);\rBoolean MarqueeHasHandles (SInt16 *, SInt16 *);\rBoolean PtInMarqueeHandle (Point);\rvoid SetMarqueeGliderRect (SInt16, SInt16);\rvoid InitMarquee (void);\r\rvoid UpdateClipboardMenus (void);                                                // --- Menu.c\rvoid DoAppleMenu (SInt16);\rvoid DoGameMenu (SInt16);\rvoid DoOptionsMenu (SInt16);\rvoid DoHouseMenu (SInt16);\rvoid DoMenuChoice (long);\rvoid UpdateMenus (Boolean);\rvoid UpdateMapCheckmark (Boolean);\rvoid UpdateToolsCheckmark (Boolean);\rvoid UpdateCoordinateCheckmark (Boolean);\r#ifdef COMPILEDEMO\rvoid DoNotInDemo (void);\r#endif\rvoid OpenCloseEditWindows (void);\r\rvoid StartGliderFadingIn (gliderPtr);                                  // --- Modes.c\rvoid StartGliderTransportingIn (gliderPtr);\rvoid StartGliderFadingOut (gliderPtr);\rvoid StartGliderGoingUpStairs (gliderPtr);\rvoid StartGliderGoingDownStairs (gliderPtr);\rvoid StartGliderMailingIn (gliderPtr, Rect *, hotPtr);\rvoid StartGliderMailingOut (gliderPtr);\rvoid StartGliderDuctingDown (gliderPtr, Rect *, hotPtr);\rvoid StartGliderDuctingUp (gliderPtr, Rect *, hotPtr);\rvoid StartGliderDuctingIn (gliderPtr);\rvoid StartGliderTransporting (gliderPtr, hotPtr);\rvoid FlagGliderNormal (gliderPtr);\rvoid FlagGliderShredding (gliderPtr, Rect *);\rvoid FlagGliderBurning (gliderPtr);\rvoid FlagGliderFaceLeft (gliderPtr);\rvoid FlagGliderFaceRight (gliderPtr);\rvoid FlagGliderInLimbo (gliderPtr, Boolean);\rvoid UndoGliderLimbo (gliderPtr);\rvoid ToggleGliderFacing (gliderPtr);\rvoid InsureGliderFacingRight (gliderPtr);\rvoid InsureGliderFacingLeft (gliderPtr);\rvoid ReadyGliderForTripUpStairs (gliderPtr);\rvoid ReadyGliderForTripDownStairs (gliderPtr);\rvoid StartGliderFoilGoing (gliderPtr);\rvoid StartGliderFoilLosing (gliderPtr);\rvoid TagGliderIdle (gliderPtr);\r\rOSErr StartMusic (void);                                                           // --- Music.c\rvoid StopTheMusic (void);\rvoid ToggleMusicWhilePlaying (void);\rvoid SetMusicalMode (SInt16);\rvoid InitMusic (void);\rvoid KillMusic (void);\rlong MusicBytesNeeded (void);\rvoid TellHerNoMusic (void);\r\rBoolean AddNewObject (Point, SInt16, Boolean);                     // --- ObjectAdd.c\rSInt16 FindObjectSlotInRoom (SInt16);\rBoolean DoesRoomNumHaveObject (SInt16, SInt16);\rvoid ShoutNoMoreObjects (void);\r\rvoid DrawSimpleBlowers (SInt16, Rect *);                                      // --- ObjectDraw.c\rvoid DrawTiki (Rect *, SInt16);\rvoid DrawInvisibleBlower (Rect *);\rvoid DrawLiftArea (Rect *);\rvoid DrawTable (Rect *, SInt16);\rvoid DrawShelf (Rect *);\rvoid DrawCabinet (Rect *);\rvoid DrawSimpleFurniture (SInt16, Rect *);\rvoid DrawCounter (Rect *);\rvoid DrawDresser (Rect *);\rvoid DrawDeckTable (Rect *, SInt16);\rvoid DrawStool (Rect *, SInt16);\rvoid DrawInvisObstacle (Rect *);\rvoid DrawInvisBounce (Rect *);\rvoid DrawRedClock (Rect *);\rvoid DrawBlueClock (Rect *);\rvoid DrawYellowClock (Rect *);\rvoid DrawCuckoo (Rect *);\rvoid DrawSimplePrizes (SInt16, Rect *);\rvoid DrawGreaseRt (Rect *, SInt16, Boolean);\rvoid DrawGreaseLf (Rect *, SInt16, Boolean);\rvoid DrawFoil (Rect *);\rvoid DrawInvisBonus (Rect *);\rvoid DrawSlider (Rect *);\r\rvoid DrawMailboxLeft (Rect *, SInt16);                                      // --- ObjectDraw2.c\rvoid DrawMailboxRight (Rect *, SInt16);\rvoid DrawSimpleTransport (SInt16, Rect *);\rvoid DrawInvisTransport (Rect *);\rvoid DrawLightSwitch (Rect *, Boolean);\rvoid DrawMachineSwitch (Rect *, Boolean);\rvoid DrawThermostat (Rect *, Boolean);\rvoid DrawPowerSwitch (Rect *, Boolean);\rvoid DrawKnifeSwitch (Rect *, Boolean);\rvoid DrawInvisibleSwitch (Rect *);\rvoid DrawTrigger (Rect *);\rvoid DrawSoundTrigger (Rect *);\rvoid DrawSimpleLight (SInt16, Rect *);\rvoid DrawFlourescent (Rect *);\rvoid DrawSimpleAppliance (SInt16, Rect *);\rvoid DrawMacPlus (Rect *, Boolean, Boolean);\rvoid DrawTrackLight (Rect *);\rvoid DrawInvisLight (Rect *);\rvoid DrawTV (Rect *, Boolean, Boolean);\rvoid DrawCoffee (Rect *, Boolean, Boolean);\rvoid DrawOutlet (Rect *);\rvoid DrawVCR (Rect *, Boolean, Boolean);\rvoid DrawStereo (Rect *, Boolean, Boolean);\rvoid DrawMicrowave (Rect *, Boolean, Boolean);\rvoid DrawBalloon (Rect *);\rvoid DrawCopter (Rect *);\rvoid DrawDart (Rect *, SInt16);\rvoid DrawBall (SInt16, Rect *);\rvoid DrawFish (SInt16, Rect *);\rvoid DrawDrip (Rect *);\rvoid DrawMirror (Rect *);\rvoid DrawSimpleClutter (SInt16, Rect *);\rvoid DrawFlower (Rect *, SInt16);\rvoid DrawWallWindow (Rect *);\rvoid DrawCalendar (Rect *);\rvoid DrawBulletin (Rect *);\rvoid DrawPictObject (SInt16, Rect *);\rvoid DrawPictWithMaskObject (SInt16, Rect *);\rvoid DrawPictSansWhiteObject (SInt16, Rect *);\rvoid DrawCustPictSansWhite (SInt16, Rect *);\r\rvoid DrawARoomsObjects (SInt16, Boolean);                         // --- ObjectDrawAll.c\r\rvoid DoSelectionClick (Point, Boolean);                                 // --- ObjectEdit.c\rvoid DoNewObjectClick (Point);\rvoid DeleteObject (void);\rvoid DuplicateObject (void);\rvoid MoveObject (SInt16, Boolean);\rvoid DeselectObject (void);\rBoolean ObjectHasHandle (SInt16 *, SInt16 *);\rvoid HandleBlowerGlider (void);\rvoid SelectNextObject (void);\rvoid SelectPrevObject (void);\rvoid GetThisRoomsObjRects (void);\rvoid DrawThisRoomsObjects (void);\rvoid HiliteAllObjects (void);\rvoid GoToObjectInRoom (SInt16, SInt16, SInt16);\rvoid GoToObjectInRoomNum (SInt16, SInt16);\r\rvoid DoObjectInfo (void);                                                              // --- ObjectInfo.c\r\rvoid GetObjectRect (objectPtr, Rect *);                                    // --- ObjectRects.c\rSInt16 CreateActiveRects (SInt16);\rSInt16 VerticalRoomOffset (SInt16);\rvoid OffsetRectRoomRelative (Rect *, SInt16);\rSInt16 GetUpStairsRightEdge (void);\rSInt16 GetDownStairsLeftEdge (void);\r\rSInt16 GetRoomLinked (objectType *);                                                // --- Objects.c\rBoolean ObjectIsLinkTransport (objectType *);\rBoolean ObjectIsLinkSwitch (objectType *);\rvoid ListAllLocalObjects (void);\rBoolean SetObjectState (SInt16, SInt16, SInt16, SInt16);\rBoolean GetObjectState (SInt16, SInt16);\rvoid BringSendFrontBack (Boolean);\rBoolean IsThisValid (SInt16, SInt16);\rvoid AddTempManholeRect (Rect *);\r\rvoid NewGame (SInt16);                                                                 // --- Play.c\rvoid DoDemoGame (void);\rvoid HideGlider (gliderPtr);\rvoid StrikeChime (void);\rvoid RestoreEntireGameScreen (void);\r\rvoid HandleGlider (gliderPtr);                                                        // --- Player.c\rvoid FinishGliderUpStairs (gliderPtr);\rvoid FinishGliderDownStairs (gliderPtr);\rvoid FinishGliderDuctingIn (gliderPtr);\rvoid DeckGliderInFoil (gliderPtr);\rvoid RemoveFoilFromGlider (gliderPtr);\rvoid OffsetGlider (gliderPtr, SInt16);\rvoid OffAMortal (gliderPtr);\r\rvoid AddRectToWorkRects (Rect *);                                                // --- Render.c\rvoid AddRectToBackRects (Rect *);\rvoid AddRectToWorkRectsWhole (Rect *);\rvoid RenderGlider (gliderPtr, Boolean);\rvoid CopyRectsQD (void);\rvoid DirectWork2Main8 (Rect *);\rvoid DirectBack2Work8 (Rect *);\rvoid DirectGeneric2Work8 (long, long, Rect *, Rect *);\rvoid DirectWork2Main4 (Rect *);\rvoid DirectBack2Work4 (Rect *);\rvoid DirectGeneric2Work4 (long, long, Rect *, Rect *);\rvoid CopyRectsAssm (void);\rvoid DirectFillBack8 (Rect *, Byte);\rvoid DirectFillWork8 (Rect *, Byte);\rvoid DirectFillBack4 (Rect *, Byte);\rvoid DirectFillWork4 (Rect *, Byte);\rvoid RenderFrame (void);\rvoid InitGarbageRects (void);\rvoid CopyRectBackToWork (Rect *);\rvoid CopyRectWorkToBack (Rect *);\rvoid CopyRectWorkToMain (Rect *);\rvoid CopyRectMainToWork (Rect *);\rvoid CopyRectMainToBack (Rect *);\rvoid AddToMirrorRegion (Rect *);\rvoid ZeroMirrorRegion (void);\r\rvoid SetInitialTiles (SInt16, Boolean);                                 // --- Room.c\rBoolean CreateNewRoom (SInt16, SInt16);\rvoid DoRoomInfo (void);\rvoid ReadyBackground (SInt16, SInt16 *);\rvoid ReflectCurrentRoom (Boolean);\rvoid CopyRoomToThisRoom (SInt16);\rvoid CopyThisRoomToRoom (void);\rvoid ForceThisRoom (SInt16);\rBoolean RoomExists (SInt16, SInt16, SInt16 *);\rBoolean RoomNumExists (SInt16);\rvoid DeleteRoom (Boolean);\rSInt16 DoesNeighborRoomExist (SInt16);\rvoid SelectNeighborRoom (SInt16);\rSInt16 GetNeighborRoomNumber (SInt16);\rBoolean GetRoomFloorSuite (SInt16, SInt16 *, SInt16 *);\rSInt16 GetRoomNumber (SInt16, SInt16);\rBoolean       IsRoomAStructure (SInt16);\rvoid DetermineRoomOpenings (void);\rSInt16 GetOriginalBounding (SInt16);\rSInt16 GetNumberOfLights (SInt16);\rBoolean IsShadowVisible (void);\rBoolean DoesRoomHaveFloor (void);\rBoolean DoesRoomHaveCeiling (void);\r\rvoid ReadyLevel (void);                                                                    // --- RoomGraphics.c\rvoid DrawLocale (void);\rvoid RedrawRoomLighting (void);\r\rBoolean PictIDExists (SInt16);                                                   // --- RoomInfo.c\r\rvoid HandleBands (void);                                                             // --- RubberBands.c\rBoolean AddBand (gliderPtr, SInt16, SInt16, Boolean);\rvoid KillAllBands (void);\r\rvoid SaveGame2 (void);                                                                    // --- SavedGames.c\rBoolean OpenSavedGame (void);\rvoid SaveGame (Boolean);\r\rvoid RefreshScoreboard (SInt16);                                                    // --- Scoreboard.c\rvoid HandleDynamicScoreboard (void);\rvoid QuickGlidersRefresh (void);\rvoid QuickScoreRefresh (void);\rvoid QuickBatteryRefresh (Boolean);\rvoid QuickBandsRefresh (Boolean);\rvoid QuickFoilRefresh (Boolean);\rvoid HandleScore (void);\rvoid AdjustScoreboardHeight (void);\rvoid BlackenScoreboard (void);\r\r//void PutRoomScrap (void);                                                                // --- Scrap.c\r//void PutObjectScrap (void);\rvoid GetRoomScrap (void);\rvoid GetObjectScrap (void);\r//void SeeIfValidScrapAvailable (Boolean);\rBoolean HasDragManager (void);\r//Boolean DragRoom (EventRecord *, Rect *, SInt16);\r\rvoid DoLoadHouse (void);                                                              // --- SelectHouse.c\rvoid BuildHouseList (void);\rvoid AddExtraHouse (FSSpec *);\r\rvoid DoSettingsMain (void);                                                            // --- Settings.c\r\rvoid PlayPrioritySound (SInt16, SInt16);                                     // --- Sound.c\rvoid FlushAnyTriggerPlaying (void);\rvoid PlaySound0 (SInt16, SInt16);\rvoid PlaySound1 (SInt16, SInt16);\rvoid PlaySound2 (SInt16, SInt16);\rOSErr LoadTriggerSound (SInt16);\rvoid DumpTriggerSound (void);\rvoid InitSound (void);\rvoid KillSound (void);\rlong SoundBytesNeeded (void);\rvoid TellHerNoSounds (void);\rvoid BitchAboutSM3 (void);\r\rvoid InitScoreboardMap (void);                                                     // --- StructuresInit.c\rvoid InitGliderMap (void);\rvoid InitBlowers (void);\rvoid InitFurniture (void);\rvoid InitPrizes (void);\rvoid InitTransports (void);\rvoid InitSwitches (void);\rvoid InitLights (void);\rvoid InitAppliances (void);\rvoid InitEnemies (void);\r\rvoid CreateOffscreens (void);                                                        // --- StructuresInit2.c\rvoid CreatePointers (void);\rvoid InitSrcRects (void);\r\rvoid UpdateToolsWindow (void);                                                  // --- Tools.c\rvoid EraseSelectedTool (void);\rvoid SelectTool (SInt16);\rvoid OpenToolsWindow (void);\rvoid CloseToolsWindow (void);\rvoid ToggleToolsWindow (void);\rvoid HandleToolsClick (Point);\rvoid NextToolMode (void);\rvoid PrevToolMode (void);\rvoid SetSpecificToolMode (SInt16);\r\rSInt16 WhatAreWeLinkedTo (SInt16, Byte);                                       // --- Transit.c\rvoid ReadyGliderFromTransit (gliderPtr, SInt16);\rvoid MoveRoomToRoom (gliderPtr, SInt16);\rvoid TransportRoomToRoom (gliderPtr);\rvoid MoveDuctToDuct (gliderPtr);\rvoid MoveMailToMail (gliderPtr);\rvoid ForceKillGlider (void);\rvoid FollowTheLeader (void);\r\rvoid PourScreenOn (Rect *);                                                               // --- Transitions.c\rvoid WipeScreenOn (SInt16, Rect *);\rvoid DumpScreenOn (Rect *);\r//void DissBits (Rect *);\r//void DissBitsChunky (Rect *);\r//void FillColorNoise (Rect *);\r//void FillSnow (Rect *);\r\rvoid ToggleToaster (SInt16);                                                          // --- Trip.c\rvoid ToggleMacPlus (SInt16);\rvoid ToggleTV (SInt16);\rvoid ToggleCoffee (SInt16);\rvoid ToggleOutlet (SInt16);\rvoid ToggleVCR (SInt16);\rvoid ToggleStereos (SInt16);\rvoid ToggleMicrowave (SInt16);\rvoid ToggleBalloon (SInt16);\rvoid ToggleCopter (SInt16);\rvoid ToggleDart (SInt16);\rvoid ToggleBall (SInt16);\rvoid ToggleDrip (SInt16);\rvoid ToggleFish (SInt16);\rvoid TriggerSwitch (SInt16);\rvoid TriggerToast (SInt16);\rvoid TriggerOutlet (SInt16);\rvoid TriggerDrip (SInt16);\rvoid TriggerFish (SInt16);\rvoid TriggerBalloon (SInt16);\rvoid TriggerCopter (SInt16);\rvoid TriggerDart (SInt16);\rvoid UpdateOutletsLighting (SInt16, SInt16);\r\rvoid ArmTrigger (hotPtr);                                                              // --- Triggers.c\rvoid HandleTriggers (void);\rvoid ZeroTriggers (void);\r\r
\ No newline at end of file
diff --git a/Headers/GliderStructs.h b/Headers/GliderStructs.h
new file mode 100755 (executable)
index 0000000..1744a30
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                               GliderStructs.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <QDOffscreen.h>\r\r\rtypedef struct\r{\r    Point           topLeft;                                // 4\r   short           distance;                               // 2\r   Boolean         initial;                                // 1\r   Boolean         state;                                  // 1                          F. lf. dn. rt. up\r        Byte            vector;                                 // 1            | x | x | x | x | 8 | 4 | 2 | 1 |\r      Byte            tall;                                   // 1\r} blowerType;                                                      // total = 10\r\rtypedef struct\r{\r        Rect            bounds;                                 // 8\r   short           pict;                                   // 2\r} furnitureType;                                           // total = 10\r\rtypedef struct\r{\r        Point           topLeft;                                // 4\r   short           length;                                 // 2 grease spill\r      short           points;                                 // 2 invis bonus\r       Boolean         state;                                  // 1\r   Boolean         initial;                                // 1\r} bonusType;                                                       // total = 10\r\rtypedef struct\r{\r        Point           topLeft;                                // 4\r   short           tall;                                   // 2 invis transport\r   short           where;                                  // 2\r   Byte            who;                                    // 1\r   Byte            wide;                                   // 1\r} transportType;                                           // total = 10\r\rtypedef struct\r{\r        Point           topLeft;                                // 4\r   short           delay;                                  // 2\r   short           where;                                  // 2\r   Byte            who;                                    // 1\r   Byte            type;                                   // 1\r} switchType;                                                      // total = 10\r\rtypedef struct\r{\r        Point           topLeft;                                // 4\r   short           length;                                 // 2\r   Byte            byte0;                                  // 1\r   Byte            byte1;                                  // 1\r   Boolean         initial;                                // 1\r   Boolean         state;                                  // 1\r} lightType;                                                       // total = 10\r\rtypedef struct\r{\r        Point           topLeft;                                // 4\r   short           height;                                 // 2 toaster, pict ID\r  Byte            byte0;                                  // 1\r   Byte            delay;                                  // 1\r   Boolean         initial;                                // 1\r   Boolean         state;                                  // 1\r} applianceType;                                           // total = 10\r\rtypedef struct\r{\r        Point           topLeft;                                        // 4\r   short           length;                                         // 2\r   Byte            delay;                                          // 1\r   Byte            byte0;                                          // 1\r   Boolean         initial;                                        // 1\r   Boolean         state;                                          // 1\r} enemyType;                                                               // total = 10\r\rtypedef struct\r{\r        Rect            bounds;                                         // 8\r   short           pict;                                           // 2\r} clutterType;                                                             // total = 10\r\rtypedef struct\r{\r        short           what;                                           // 2\r   union\r  {\r              blowerType              a;\r             furnitureType   b;\r             bonusType               c;\r             transportType   d;\r             switchType              e;\r             lightType               f;\r             applianceType   g;\r             enemyType               h;\r             clutterType             i;\r     } data;                                                                 // 10\r} objectType, *objectPtr;                                 // total = 12\r\rtypedef struct\r{\r        Str31                   banner;                                 // 32           = 32\r   Str15                   names[kMaxScores];              // 16 * 10      = 160\r  long                    scores[kMaxScores];             // 4 * 10       = 40\r   unsigned long   timeStamps[kMaxScores]; // 4 * 10       = 40\r   short                   levels[kMaxScores];             // 2 * 10       = 20\r} scoresType;                                                              // total        = 292\r\rtypedef struct\r{\r        short           version;                                        // 2\r   short           wasStarsLeft;                           // 2\r   long            timeStamp;                                      // 4\r   Point           where;                                          // 4\r   long            score;                                          // 4\r   long            unusedLong;                                     // 4\r   long            unusedLong2;                            // 4\r   short           energy;                                         // 2\r   short           bands;                                          // 2\r   short           roomNumber;                                     // 2\r   short           gliderState;                            // 2\r   short           numGliders;                                     // 2\r   short           foil;                                           // 2\r   short           unusedShort;                            // 2\r   Boolean         facing;                                         // 1\r   Boolean         showFoil;                                       // 1\r} gameType;                                                                        // total = 40\r\rtypedef struct\r{\r        short           unusedShort;                            // 2\r   Byte            unusedByte;                                     // 1\r   Boolean         visited;                                        // 1\r   objectType      objects[kMaxRoomObs];           // 24 * 12\r} savedRoom, *saveRoomPtr;                                   // total = 292\r\rtypedef struct\r{\r       FSSpec          house;                                          // 70\r  short           version;                                        // 2\r   short           wasStarsLeft;                           // 2\r   long            timeStamp;                                      // 4\r   Point           where;                                          // 4\r   long            score;                                          // 4\r   long            unusedLong;                                     // 4\r   long            unusedLong2;                            // 4\r   short           energy;                                         // 2\r   short           bands;                                          // 2\r   short           roomNumber;                                     // 2\r   short           gliderState;                            // 2\r   short           numGliders;                                     // 2\r   short           foil;                                           // 2\r   short           nRooms;                                         // 2\r   Boolean         facing;                                         // 1\r   Boolean         showFoil;                                       // 1\r   savedRoom       savedData[];                            // 4\r} game2Type, *gamePtr;                                             // total = 114\r\rtypedef struct\r{\r       Str27           name;                                           // 28\r  short           bounds;                                         // 2\r   Byte            leftStart;                                      // 1\r   Byte            rightStart;                                     // 1\r   Byte            unusedByte;                                     // 1\r   Boolean         visited;                                        // 1\r   short           background;                                     // 2\r   short           tiles[kNumTiles];                       // 2 * 8\r       short           floor, suite;                           // 2 + 2\r       short           openings;                                       // 2\r   short           numObjects;                                     // 2\r   objectType      objects[kMaxRoomObs];           // 24 * 12\r} roomType, *roomPtr;                                                // total = 348\r\rtypedef struct\r{\r       short           version;                                        // 2\r   short           unusedShort;                            // 2\r   long            timeStamp;                                      // 4\r   long            flags;                                          // 4 (bit 0 = wardBit)\r Point           initial;                                        // 4\r   Str255          banner;                                         // 256\r Str255          trailer;                                        // 256\r scoresType      highScores;                                     // 292\r gameType        savedGame;                                      // 40\r  Boolean         hasGame;                                        // 1\r   Boolean         unusedBoolean;                          // 1\r   short           firstRoom;                                      // 2\r   short           nRooms;                                         // 2\r   roomType        rooms[];                                        // 348 * nRooms\r} houseType, *housePtr, **houseHand;            // total = 866 +\r\rtypedef struct\r{\r     Rect            src, mask, dest, whole;\r        Rect            destShadow, wholeShadow;\r       Rect            clip, enteredRect;\r     long            leftKey, rightKey;\r     long            battKey, bandKey;\r      short           hVel, vVel;\r    short           wasHVel, wasVVel;\r      short           vDesiredVel, hDesiredVel;\r      short           mode, frame, wasMode;\r  Boolean         facing, tipped;\r        Boolean         sliding, ignoreLeft, ignoreRight;\r      Boolean         fireHeld, which;\r       Boolean         heldLeft, heldRight;\r   Boolean         dontDraw, ignoreGround;\r} gliderType, *gliderPtr;\r\rtypedef struct\r{\r    Rect            bounds;\r        short           action;\r        short           who;\r   Boolean         isOn, stillOver;\r       Boolean         doScrutinize;\r} hotObject, *hotPtr;\r\rtypedef struct\r{\r  Rect            dest;\r  GWorldPtr       map;\r   short           where;\r short           who;\r} savedType, *savedPtr;\r\rtypedef struct\r{\r Rect            bounds;\r        short           mode;\r} sparkleType, *sparklePtr;\r\rtypedef struct\r{\r    Rect            dest, whole;\r   short           start;\r short           stop;\r  short           mode;\r  short           loops;\r short           hVel, vVel;\r} flyingPtType, *flyingPtPtr;\r\rtypedef struct\r{\r    Rect            dest, src;\r     short           mode;\r  short           who;\r} flameType, *flamePtr;\r\rtypedef struct\r{\r Rect            dest, src;\r     short           mode, where;\r   short           who, link;\r     Boolean         toOrFro, active;\r} pendulumType, *pendulumPtr;\r\rtypedef struct\r{\r       Boolean         left;\r  Boolean         top;\r   Boolean         right;\r Boolean         bottom;\r} boundsType, *boundsPtr, **boundsHand;\r\rtypedef struct\r{\r      Rect            dest;\r  short           mode, count;\r   short           hVel, vVel;\r} bandType, *bandPtr;\r\rtypedef struct\r{\r    short           srcRoom, srcObj;\r       short           destRoom, destObj;\r} linksType, *linksPtr;\r\rtypedef struct\r{\r   Rect            dest;\r  short           mapNum, mode;\r  short           who, where;\r    short           start, stop;\r   short           frame, hotNum;\r Boolean         isRight;\r} greaseType, *greasePtr;\r\rtypedef struct\r{\r   Rect            dest, src;\r     short           mode, who;\r     short           link, where;\r} starType, *starPtr;\r\rtypedef struct\r{\r   Rect            bounds;\r        short           frame;\r} shredType, *shredPtr;\r\rtypedef struct\r{\r       Rect            dest;\r  Rect            whole;\r short           hVel, vVel;\r    short           type, count;\r   short           frame, timer;\r  short           position, room;\r        Byte            byte0, byte1;\r  Boolean         moving, active;\r} dynaType, *dynaPtr;\r\rtypedef struct\r{\r        short           roomNum;        // room # object in (real number)\r      short           objectNum;      // obj. # in house (real number)\r       short           roomLink;       // room # object linked to (if any)\r    short           objectLink;     // obj. # object linked to (if any)\r    short           localLink;      // index in master list if exists\r      short           hotNum;         // index into active rects (if any)\r    short           dynaNum;        // index into dinahs (if any)\r  objectType      theObject;      // actual object data\r} objDataType, *objDataPtr;\r\rtypedef struct\r{\r    long            frame;\r char            key;\r   char            padding;\r} demoType, *demoPtr;\r\rtypedef struct\r{\r       short           room;\r  short           object;\r} retroLink, *retroLinkPtr;\r\r\r
\ No newline at end of file
diff --git a/Headers/GliderVars.h b/Headers/GliderVars.h
new file mode 100755 (executable)
index 0000000..4d4e19a
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                               GliderVars.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <Movies.h>\r\r\rextern       Rect            blowerSrcRect;\rextern   Rect            flame[], tikiFlame[];\rextern    Rect            coals[];\rextern Rect            furnitureSrcRect;\rextern        Rect            tableSrc, shelfSrc, hingeSrc, handleSrc, knobSrc;\rextern        Rect            leftFootSrc, rightFootSrc, deckSrc;\rextern      Rect            bonusSrcRect;\rextern    Rect            pointsSrcRect;\rextern   Rect            starSrc[], sparkleSrc[];\rextern Rect            digits[], pendulumSrc[], greaseSrcRt[], greaseSrcLf[];\rextern   Rect            transSrcRect;\rextern    Rect            switchSrcRect;\rextern   Rect            lightSwitchSrc[], machineSwitchSrc[], thermostatSrc[];\rextern   Rect            powerSrc[], knifeSwitchSrc[];\rextern    Rect            lightSrcRect;\rextern    Rect            flourescentSrc1, flourescentSrc2;\rextern        Rect            trackLightSrc[];\rextern Rect            applianceSrcRect, toastSrcRect, shredSrcRect;   // Appliances\rextern    Rect            plusScreen1, plusScreen2, tvScreen1, tvScreen2;\rextern  Rect            coffeeLight1, coffeeLight2, vcrTime1, vcrTime2;\rextern  Rect            stereoLight1, stereoLight2, microOn, microOff;\rextern   Rect            outletSrc[];\rextern     Rect            balloonSrcRect, copterSrcRect, dartSrcRect;             // Enemies\rextern       Rect            ballSrcRect, dripSrcRect, enemySrcRect;\rextern  Rect            fishSrcRect;\rextern     Rect            balloonSrc[], copterSrc[], dartSrc[];\rextern    Rect            ballSrc[], dripSrc[], fishSrc[];\rextern Rect            clutterSrcRect;\rextern  Rect            flowerSrc[];\rextern     Rect            *srcRects;\r\rextern      Movie           theMovie;\rextern        Rect            movieRect;\rextern       Boolean         hasMovie, tvInRoom;\r\rextern     gliderType      theGlider, theGlider2;\rextern   objDataPtr      masterObjects;\rextern   Rect            workSrcRect;\rextern     Rect            backSrcRect;\rextern     Rect            mainWindowRect, houseRect;\rextern       houseHand       thisHouse;\rextern       roomPtr         thisRoom;\rextern        WindowPtr       mainWindow, coordWindow;\rextern long            theScore;\rextern        short           playOriginH, playOriginV;\rextern        short           thisRoomNumber, theMode, batteryTotal, bandsTotal;\rextern       short           foilTotal, mortals, numMasterObjects, previousRoom;\rextern      Boolean         fileDirty, gameDirty, showFoil, doZooms, isPlayMusicGame;\r\r
\ No newline at end of file
diff --git a/Headers/House.h b/Headers/House.h
new file mode 100755 (executable)
index 0000000..fd64fed
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                       House.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <MacTypes.h>\r\r\rextern Str32            thisHouseName;\rextern Boolean           houseUnlocked;\r
\ No newline at end of file
diff --git a/Headers/MainWindow.h b/Headers/MainWindow.h
new file mode 100755 (executable)
index 0000000..f932866
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                               MainWindow.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <QDOffscreen.h>\r\r\rextern GWorldPtr                workSrcMap;\r
\ No newline at end of file
diff --git a/Headers/Map.h b/Headers/Map.h
new file mode 100755 (executable)
index 0000000..8e4e8bd
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                        Map.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <QDOffscreen.h>\r\r\rextern GWorldPtr              nailSrcMap;\rextern WindowPtr            mapWindow;\r
\ No newline at end of file
diff --git a/Headers/Marquee.h b/Headers/Marquee.h
new file mode 100755 (executable)
index 0000000..fb21eb2
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                       Marquee.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#pragma once\r\r\r#include <Quickdraw.h>\r\r\rtypedef struct\r{\r     Pattern         pats[kNumMarqueePats];\r Rect            bounds, handle;\r        short           index, direction, dist;\r        Boolean         active, paused, handled;\r} marquee;\r\r\rextern marquee            theMarquee;\r\r
\ No newline at end of file
diff --git a/Headers/ObjectEdit.h b/Headers/ObjectEdit.h
new file mode 100755 (executable)
index 0000000..dfebe55
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                  ObjectEdit.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#pragma once\r\r\r#include <Quickdraw.h>\r\r\rextern Rect                     roomObjectRects[];\rextern short         objActive;\r
\ No newline at end of file
diff --git a/Headers/Objects.h b/Headers/Objects.h
new file mode 100755 (executable)
index 0000000..083b420
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                       Objects.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\rextern GWorldPtr              blowerSrcMap;\rextern GWorldPtr          blowerMaskMap;\rextern GWorldPtr         furnitureSrcMap;\rextern GWorldPtr               furnitureMaskMap;\rextern GWorldPtr              bonusSrcMap;\rextern GWorldPtr           bonusMaskMap;\rextern GWorldPtr          pointsSrcMap;\rextern GWorldPtr          pointsMaskMap;\rextern GWorldPtr         transSrcMap;\rextern GWorldPtr           transMaskMap;\rextern GWorldPtr          switchSrcMap;\rextern GWorldPtr          lightSrcMap;\rextern GWorldPtr           lightMaskMap;\rextern GWorldPtr          applianceSrcMap;\rextern GWorldPtr               applianceMaskMap;\rextern GWorldPtr              toastSrcMap;\rextern GWorldPtr           toastMaskMap;\rextern GWorldPtr          shredSrcMap;\rextern GWorldPtr           shredMaskMap;\rextern GWorldPtr          balloonSrcMap;\rextern GWorldPtr         balloonMaskMap;\rextern GWorldPtr                copterSrcMap;\rextern GWorldPtr          copterMaskMap;\rextern GWorldPtr         dartSrcMap;\rextern GWorldPtr            dartMaskMap;\rextern GWorldPtr           ballSrcMap;\rextern GWorldPtr            ballMaskMap;\rextern GWorldPtr           dripSrcMap;\rextern GWorldPtr            dripMaskMap;\rextern GWorldPtr           enemySrcMap;\rextern GWorldPtr           enemyMaskMap;\rextern GWorldPtr          fishSrcMap;\rextern GWorldPtr            fishMaskMap;\rextern GWorldPtr           clutterSrcMap;\rextern GWorldPtr         clutterMaskMap;\r
\ No newline at end of file
diff --git a/Headers/Play.h b/Headers/Play.h
new file mode 100755 (executable)
index 0000000..b863d2f
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                        Play.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <QDOffscreen.h>\r\r\rextern GWorldPtr             glidSrcMap;\rextern GWorldPtr            glid2SrcMap;\rextern GWorldPtr           glidMaskMap;\r
\ No newline at end of file
diff --git a/Headers/Player.h b/Headers/Player.h
new file mode 100755 (executable)
index 0000000..a78a38e
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                       Player.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <QDOffscreen.h>\r\r\rextern GWorldPtr            shadowSrcMap;\rextern GWorldPtr          shadowMaskMap;\r
\ No newline at end of file
diff --git a/Headers/RectUtils.h b/Headers/RectUtils.h
new file mode 100755 (executable)
index 0000000..7ff4de5
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                  RectUtils.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#pragma once\r\r\r#include <Quickdraw.h>\r\r\rvoid FrameWHRect (short, short, short, short);\rvoid NormalizeRect (Rect *);\rvoid ZeroRectCorner (Rect *);\rvoid CenterRectOnPoint (Rect *, Point);\rshort HalfRectWide (Rect *);\rshort HalfRectTall (Rect *);\rshort RectWide (Rect *);\rshort RectTall (Rect *);\rvoid GlobalToLocalRect (Rect *);\rvoid LocalToGlobalRect (Rect *);\rvoid CenterRectInRect (Rect *, Rect *);\rvoid HOffsetRect (Rect *, short);\rvoid VOffsetRect (Rect *, short);\rBoolean IsRectLeftOfRect (Rect *, Rect *);\rvoid QOffsetRect (Rect *, short, short);\rvoid QSetRect (Rect *, short, short, short, short);\rBoolean ForceRectInRect (Rect *, Rect *);\rvoid QUnionSimilarRect (Rect *, Rect *, Rect *);\rvoid FrameRectSansCorners (Rect *);\rvoid SetEraseRect (short, short, short, short);\r
\ No newline at end of file
diff --git a/Headers/Room.h b/Headers/Room.h
new file mode 100755 (executable)
index 0000000..434913e
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                       Room.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <QDOffscreen.h>\r\r\rextern GWorldPtr      backSrcMap;\r\r
\ No newline at end of file
diff --git a/Headers/RoomGraphics.h b/Headers/RoomGraphics.h
new file mode 100755 (executable)
index 0000000..5538be1
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                RoomGraphics.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <QDOffscreen.h>\r\r\rextern GWorldPtr     suppSrcMap;\r
\ No newline at end of file
diff --git a/Headers/RubberBands.h b/Headers/RubberBands.h
new file mode 100755 (executable)
index 0000000..566ab20
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                 RubberBands.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <QDOffscreen.h>\r\r\rextern GWorldPtr             bandsSrcMap;\rextern GWorldPtr           bandsMaskMap;\r
\ No newline at end of file
diff --git a/Headers/Scoreboard.h b/Headers/Scoreboard.h
new file mode 100755 (executable)
index 0000000..9d989ea
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                  Scoreboard.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <QDOffscreen.h>\r\r\rextern GWorldPtr             boardSrcMap;\rextern GWorldPtr           badgeSrcMap;\rextern GWorldPtr           boardTSrcMap;\rextern GWorldPtr          boardGSrcMap;\rextern GWorldPtr          boardPSrcMap;\r
\ No newline at end of file
diff --git a/Headers/Tools.h b/Headers/Tools.h
new file mode 100755 (executable)
index 0000000..ff80070
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                  Tools.h\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <QDOffscreen.h>\r\r\rextern GWorldPtr          toolSrcMap;\rextern WindowPtr            toolsWindow;\r
\ No newline at end of file
diff --git a/Headers/Utilities.h b/Headers/Utilities.h
new file mode 100755 (executable)
index 0000000..3f57af2
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                 Utilities.c\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <QDOffscreen.h>\r\r\rOSErr CreateOffScreenGWorld (GWorldPtr *theGWorld, Rect *bounds, short depth);\r
\ No newline at end of file
diff --git a/Houses/Art Museum b/Houses/Art Museum
new file mode 100755 (executable)
index 0000000..d7e03cc
Binary files /dev/null and b/Houses/Art Museum differ
diff --git a/Houses/Art Museum.mov b/Houses/Art Museum.mov
new file mode 100755 (executable)
index 0000000..a4bd4a8
Binary files /dev/null and b/Houses/Art Museum.mov differ
diff --git a/Houses/CD Demo House b/Houses/CD Demo House
new file mode 100755 (executable)
index 0000000..742ad6a
Binary files /dev/null and b/Houses/CD Demo House differ
diff --git a/Houses/CD Demo House.mov b/Houses/CD Demo House.mov
new file mode 100755 (executable)
index 0000000..8839406
Binary files /dev/null and b/Houses/CD Demo House.mov differ
diff --git a/Houses/California or Bust! b/Houses/California or Bust!
new file mode 100755 (executable)
index 0000000..80a87c1
Binary files /dev/null and b/Houses/California or Bust! differ
diff --git a/Houses/Castle o' the Air b/Houses/Castle o' the Air
new file mode 100755 (executable)
index 0000000..b528e95
Binary files /dev/null and b/Houses/Castle o' the Air differ
diff --git a/Houses/Castle o' the Air.mov b/Houses/Castle o' the Air.mov
new file mode 100755 (executable)
index 0000000..3bc49c5
Binary files /dev/null and b/Houses/Castle o' the Air.mov differ
diff --git a/Houses/Davis Station b/Houses/Davis Station
new file mode 100755 (executable)
index 0000000..996ba75
Binary files /dev/null and b/Houses/Davis Station differ
diff --git a/Houses/Davis Station.mov b/Houses/Davis Station.mov
new file mode 100755 (executable)
index 0000000..0fd4115
Binary files /dev/null and b/Houses/Davis Station.mov differ
diff --git a/Houses/Demo House b/Houses/Demo House
new file mode 100755 (executable)
index 0000000..53f1f91
Binary files /dev/null and b/Houses/Demo House differ
diff --git a/Houses/Demo House.mov b/Houses/Demo House.mov
new file mode 100755 (executable)
index 0000000..e2fbd0e
Binary files /dev/null and b/Houses/Demo House.mov differ
diff --git a/Houses/Empty House b/Houses/Empty House
new file mode 100755 (executable)
index 0000000..3109989
Binary files /dev/null and b/Houses/Empty House differ
diff --git a/Houses/Fun House b/Houses/Fun House
new file mode 100755 (executable)
index 0000000..7cdaa65
Binary files /dev/null and b/Houses/Fun House differ
diff --git a/Houses/Grand Prix b/Houses/Grand Prix
new file mode 100755 (executable)
index 0000000..7ef1328
Binary files /dev/null and b/Houses/Grand Prix differ
diff --git a/Houses/Grand Prix.mov b/Houses/Grand Prix.mov
new file mode 100755 (executable)
index 0000000..5fd19b1
Binary files /dev/null and b/Houses/Grand Prix.mov differ
diff --git a/Houses/ImagineHouse PRO II b/Houses/ImagineHouse PRO II
new file mode 100755 (executable)
index 0000000..992c266
Binary files /dev/null and b/Houses/ImagineHouse PRO II differ
diff --git a/Houses/ImagineHouse PRO II.mov b/Houses/ImagineHouse PRO II.mov
new file mode 100755 (executable)
index 0000000..9ba10f6
Binary files /dev/null and b/Houses/ImagineHouse PRO II.mov differ
diff --git a/Houses/In The Mirror b/Houses/In The Mirror
new file mode 100755 (executable)
index 0000000..9ce0f87
Binary files /dev/null and b/Houses/In The Mirror differ
diff --git a/Houses/Land of Illusion b/Houses/Land of Illusion
new file mode 100755 (executable)
index 0000000..751b199
Binary files /dev/null and b/Houses/Land of Illusion differ
diff --git a/Houses/Land of Illusion.mov b/Houses/Land of Illusion.mov
new file mode 100755 (executable)
index 0000000..7c35d47
Binary files /dev/null and b/Houses/Land of Illusion.mov differ
diff --git a/Houses/Leviathan b/Houses/Leviathan
new file mode 100755 (executable)
index 0000000..efadfe1
Binary files /dev/null and b/Houses/Leviathan differ
diff --git a/Houses/Leviathan.mov b/Houses/Leviathan.mov
new file mode 100755 (executable)
index 0000000..3696a07
Binary files /dev/null and b/Houses/Leviathan.mov differ
diff --git a/Houses/Metropolis b/Houses/Metropolis
new file mode 100755 (executable)
index 0000000..c07b589
Binary files /dev/null and b/Houses/Metropolis differ
diff --git a/Houses/Nemo's Market b/Houses/Nemo's Market
new file mode 100755 (executable)
index 0000000..0be74e7
Binary files /dev/null and b/Houses/Nemo's Market differ
diff --git a/Houses/Nemo's Market.mov b/Houses/Nemo's Market.mov
new file mode 100755 (executable)
index 0000000..3885765
Binary files /dev/null and b/Houses/Nemo's Market.mov differ
diff --git a/Houses/Rainbow's End b/Houses/Rainbow's End
new file mode 100755 (executable)
index 0000000..c58fafc
Binary files /dev/null and b/Houses/Rainbow's End differ
diff --git a/Houses/Rainbow's End.mov b/Houses/Rainbow's End.mov
new file mode 100755 (executable)
index 0000000..68db5b2
Binary files /dev/null and b/Houses/Rainbow's End.mov differ
diff --git a/Houses/Sampler b/Houses/Sampler
new file mode 100755 (executable)
index 0000000..a4400b9
Binary files /dev/null and b/Houses/Sampler differ
diff --git a/Houses/Slumberland b/Houses/Slumberland
new file mode 100755 (executable)
index 0000000..98c824c
Binary files /dev/null and b/Houses/Slumberland differ
diff --git a/Houses/Slumberland.mov b/Houses/Slumberland.mov
new file mode 100755 (executable)
index 0000000..65f98f3
Binary files /dev/null and b/Houses/Slumberland.mov differ
diff --git a/Houses/SpacePods b/Houses/SpacePods
new file mode 100755 (executable)
index 0000000..2b8d591
Binary files /dev/null and b/Houses/SpacePods differ
diff --git a/Houses/SpacePods.mov b/Houses/SpacePods.mov
new file mode 100755 (executable)
index 0000000..e069d1b
Binary files /dev/null and b/Houses/SpacePods.mov differ
diff --git a/Houses/Teddy World b/Houses/Teddy World
new file mode 100755 (executable)
index 0000000..1b480c0
Binary files /dev/null and b/Houses/Teddy World differ
diff --git a/Houses/Teddy World.mov b/Houses/Teddy World.mov
new file mode 100755 (executable)
index 0000000..238dd8a
Binary files /dev/null and b/Houses/Teddy World.mov differ
diff --git a/Houses/The Asylum Pro b/Houses/The Asylum Pro
new file mode 100755 (executable)
index 0000000..708f811
Binary files /dev/null and b/Houses/The Asylum Pro differ
diff --git a/Houses/Titanic b/Houses/Titanic
new file mode 100755 (executable)
index 0000000..efcebe1
Binary files /dev/null and b/Houses/Titanic differ
diff --git a/Houses/Titanic.mov b/Houses/Titanic.mov
new file mode 100755 (executable)
index 0000000..db4d283
Binary files /dev/null and b/Houses/Titanic.mov differ
diff --git a/Prefix.h b/Prefix.h
new file mode 100755 (executable)
index 0000000..1db6eb0
--- /dev/null
+++ b/Prefix.h
@@ -0,0 +1 @@
+#define TARGET_CARBON                                          1\r#define ACCESSOR_CALLS_ARE_FUNCTIONS          1\r#define OPAQUE_TOOLBOX_STRUCTS                                1\r#define OPAQUE_UPP_TYPES                                      1\r#define forCarbon                                                     1\r#define BUILDING_RUN_LINKED_IN                                0\r#define DEBUG                                                         1
\ No newline at end of file
diff --git a/Sources/About.c b/Sources/About.c
new file mode 100755 (executable)
index 0000000..37ea79e
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                       About.c\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <NumberFormatting.h>\r#include <Resources.h>\r#include <Sound.h>\r#include "About.h"\r#include "DialogUtils.h"\r#include "Environ.h"\r#include "Externs.h"\r\r\rstatic void HiLiteOkayButton (void);\rstatic void UnHiLiteOkayButton (void);\rstatic void UpdateMainPict (DialogPtr);\rstatic pascal Boolean AboutFilter (DialogPtr, EventRecord *theEvent, short *hit);\r\r\rstatic RgnHandle                okayButtRgn;\rstatic Rect                                okayButtonBounds, mainPICTBounds;\rstatic Boolean                        okayButtIsHiLit, clickedDownInOkay;\r\r\r//==============================================================  Functions\r//--------------------------------------------------------------  DoAbout\r// Brings up the About dialog box.\r\rvoid DoAbout (void)\r{\r  #define                 kAboutDialogID                  150             // res ID of About dialog\r      #define                 kTextItemVers                   2               // item number of version text\r #define                 kPictItemMain                   4               // item number of main PICT\r    \r       DialogPtr               aboutDialog;\r   Str255                  longVersion;\r   StringPtr               messagePtr;\r    VersRecHndl             version;\r       Handle                  itemHandle;\r    short                   itemType, hit, wasResFile;\r     ModalFilterUPP  aboutFilterUPP;\r        \r       aboutFilterUPP = NewModalFilterUPP(AboutFilter);\r       \r       wasResFile = CurResFile();\r     UseResFile(thisMac.thisResFile);\r       \r       aboutDialog = GetNewDialog(kAboutDialogID, nil, (WindowRef)-1L);\r//     if (aboutDialog == nil)\r//              RedAlert(kErrDialogDidntLoad);\r \r       version = (VersRecHndl)GetResource('vers', 1);\r if (version != nil)\r    {\r              messagePtr = (StringPtr)(((UInt32)&(**version).shortVersion[1]) \r                               + ((**version).shortVersion[0]));\r              BlockMove((Ptr)messagePtr, &longVersion, ((UInt8)*messagePtr) + 1);\r            SetDialogString(aboutDialog, kTextItemVers, longVersion);\r      }\r      \r       GetDialogItem(aboutDialog, kOkayButton, &itemType, &itemHandle, &okayButtonBounds);\r    okayButtRgn = NewRgn();                                 // Create diagonal button region\r       OpenRgn();\r     MoveTo(okayButtonBounds.left + 1, okayButtonBounds.top + 45);\r  Line(44, -44);                                                  // These lines define the region\r       Line(16, 16);\r  Line(-44, 44);\r Line(-16, -16);\r        CloseRgn(okayButtRgn);\r okayButtIsHiLit = false;                                // Initially, button is not hilit\r      clickedDownInOkay = false;                              // Initially, didn't click in okay button\r      GetDialogItem(aboutDialog, kPictItemMain, &itemType, &itemHandle, &mainPICTBounds);\r    \r       do                                                                              // Loop until user wants to exit\r       {\r              ModalDialog(aboutFilterUPP, &hit);\r     }\r      while ((hit != kOkayButton) && (okayButtRgn != nil));\r  \r       if (okayButtRgn != nil)\r                DisposeRgn(okayButtRgn);                        // Clean up!\r   DisposeDialog(aboutDialog);\r    DisposeModalFilterUPP(aboutFilterUPP);\r \r       UseResFile(wasResFile);\r}\r\r//==============================================================  Static Functions\r//--------------------------------------------------------------  HiLiteOkayButton\r// Draws my pseudo-button to appear as though it is clicked on.\r\rstatic void HiLiteOkayButton (void)\r{\r        #define         kOkayButtPICTHiLit              151             // res ID of unhilit button PICT\r       PicHandle       thePict;\r       \r       if (!okayButtIsHiLit)\r  {\r              thePict = GetPicture(kOkayButtPICTHiLit);\r              if (thePict != nil)\r            {\r                      DrawPicture(thePict, &okayButtonBounds);\r                       ReleaseResource((Handle)thePict);\r                      \r                       okayButtIsHiLit = true;\r                }\r      }\r}\r\r//--------------------------------------------------------------  UnHiLiteOkayButton\r\r// Draws my pseudo-button normal (not clicked on).\r\rstatic void UnHiLiteOkayButton (void)\r{\r #define         kOkayButtPICTNotHiLit   150             // res ID of hilit button PICT\r PicHandle       thePict;\r       \r       if (okayButtIsHiLit)\r   {\r              thePict = GetPicture(kOkayButtPICTNotHiLit);\r           if (thePict != nil)\r            {\r                      DrawPicture(thePict, &okayButtonBounds);\r                       ReleaseResource((Handle)thePict);\r                      \r                       okayButtIsHiLit = false;\r               }\r      }\r}\r\r//--------------------------------------------------------------  UpdateMainPict\r// Redraws the main graphic in the dialog (in response to an update event).\r\rstatic void UpdateMainPict (DialogPtr theDial)\r{\r    Str255          theStr, theStr2;\r       long            totalSize, contigSize;\r \r       DrawDialog(theDial);\r   \r       PasStringCopy("\pMemory:   ", theStr);          // display free memory\r PurgeSpace(&totalSize, &contigSize);\r   totalSize /= 1024;\r     NumToString(totalSize, theStr2);\r       PasStringConcat(theStr, theStr2);\r      PasStringConcat(theStr, "\pK");\r        DrawDialogUserText2(theDial, 7, theStr);\r       \r       PasStringCopy("\pScreen:   ", theStr);          // display screen size/depth\r   NumToString((long)(thisMac.screen.right - thisMac.screen.left), theStr2);\r      PasStringConcat(theStr, theStr2);\r      PasStringConcat(theStr, "\px");\r        NumToString((long)(thisMac.screen.bottom - thisMac.screen.top), theStr2);\r      PasStringConcat(theStr, theStr2);\r      PasStringConcat(theStr, "\px");\r        NumToString((long)thisMac.isDepth, theStr2);\r   PasStringConcat(theStr, theStr2);\r      DrawDialogUserText2(theDial, 8, theStr);\r}\r\r//--------------------------------------------------------------  AboutFilter\r// Dialog filter for the About dialog.\r\rstatic pascal Boolean AboutFilter (DialogPtr theDial, EventRecord *theEvent, short *hit)\r{\r   Point           mousePt;\r       UInt32          dummyLong;\r     Boolean         handledIt;\r     \r       if (Button() && clickedDownInOkay)\r     {\r              GetMouse(&mousePt);\r            if(PtInRgn(mousePt, okayButtRgn))\r                      HiLiteOkayButton();\r            else\r                   UnHiLiteOkayButton();\r  }\r      \r       switch (theEvent->what)\r        {\r              case keyDown:\r          switch ((theEvent->message) & charCodeMask)\r            {\r                      case kReturnKeyASCII:\r                  case kEnterKeyASCII:\r                   HiLiteOkayButton();\r                    Delay(8, &dummyLong);\r                  UnHiLiteOkayButton();\r                  *hit = kOkayButton;\r                    handledIt = true;\r                      break;\r                 \r                       default:\r                       handledIt = false;\r             }\r              break;\r         \r               case mouseDown:\r                mousePt = theEvent->where;\r             GlobalToLocal(&mousePt);\r               if(PtInRgn(mousePt, okayButtRgn))\r              {\r                      clickedDownInOkay = true;\r                      handledIt = false;\r             }\r              else\r                   handledIt = false;\r             break;\r         \r               case mouseUp:\r          mousePt = theEvent->where;\r             GlobalToLocal(&mousePt);\r               if(PtInRgn(mousePt, okayButtRgn) && clickedDownInOkay)\r         {\r                      UnHiLiteOkayButton();\r                  *hit = kOkayButton;\r                    handledIt = true;\r              }\r              else\r           {\r                      clickedDownInOkay = false;\r                     handledIt = false;\r             }\r              break;\r         \r               case updateEvt:\r                if ((WindowPtr)theEvent->message == mainWindow)\r                {\r                      SetPort((GrafPtr)mainWindow);\r                  BeginUpdate((WindowPtr)theEvent->message);\r                     UpdateMainWindow();\r                    EndUpdate((WindowPtr)theEvent->message);\r                       SetPortDialogPort(theDial);\r                    handledIt = true;\r              }\r              else if ((WindowPtr)theEvent->message == (WindowPtr)theDial)\r           {\r                      SetPortDialogPort(theDial);\r                    BeginUpdate((WindowPtr)theEvent->message);\r                     UpdateMainPict(theDial);\r                       EndUpdate((WindowPtr)theEvent->message);\r                       handledIt = false;\r             }\r              break;\r         \r               default:\r               handledIt = false;\r             break;\r }\r      \r       return (handledIt);\r}\r\r
\ No newline at end of file
diff --git a/Sources/AnimCursor.c b/Sources/AnimCursor.c
new file mode 100755 (executable)
index 0000000..102d1b8
--- /dev/null
@@ -0,0 +1 @@
+\r//============================================================================\r//----------------------------------------------------------------------------\r//                                                                AnimCursor.c\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <Resources.h>\r#include "Externs.h"\r#include "Environ.h"\r\r\r#define       rAcurID                                 128\r#define rHandCursorID                       1000\r\r\rtypedef struct\r{\r        short                   n;\r     short                   index;\r union\r  {\r              Handle          cursorHdl;\r             short           resID;\r } frame[1];\r} acurRec, *acurPtr, **acurHandle;\r\r\rBoolean GetMonoCursors (acurHandle);\rBoolean GetColorCursors (acurHandle);\rvoid InitAnimatedCursor (acurHandle);\r\r\racurHandle          animCursorH = nil;\rBoolean                      useColorCursor = false;\r\r\r//==============================================================  Functions\r//--------------------------------------------------------------  GetMonoCursors\r\r// Loads b&w cursors (for animated beach ball).\r\rBoolean GetMonoCursors (acurHandle ballCursH)\r{\r       short                   i, j;\r  CursHandle              cursHdl;\r       \r       if (ballCursH)                                                  // Were we passed a legit acur handle?\r {\r              j = (*ballCursH)->n;                            // Get number of 'frames' in the acur\r          for (i = 0; i < j; i++)                         // Start walking the frames\r            {\r                      cursHdl = GetCursor((*ballCursH)->frame[i].resID);\r                     if (cursHdl == nil)             // Did the cursor load? It didn't?...\r                  {                                                               // Well then, toss what we got.\r                                for (j = 0; j < i; j++)\r                                        DisposeHandle((*ballCursH)->frame[j].cursorHdl);\r                               return(false);                          // And report this to mother.\r                  }                                                               // However!...\r                 else                                                    // If cursor loaded ok...\r                      {                                                               // Detach it from the resource map...\r                          DetachResource((Handle)cursHdl);        // And assign to our struct\r                            (*ballCursH)->frame[i].cursorHdl = (Handle)cursHdl;\r                    }\r              }\r      }\r      return(true);\r}\r\r//--------------------------------------------------------------  GetColorCursors\r\r// Loads color cursors (for animated beach ball).\r\rBoolean GetColorCursors (acurHandle ballCursH)\r{\r        short                   i, j;\r  CCrsrHandle             cursHdl;\r       Boolean                 result = true;\r \r       if (ballCursH)\r {\r              j = (*ballCursH)->n;                            // Get the number of cursors\r           HideCursor();                                           // Hide the cursor\r             for (i = 0; i < j; i++)                         // Walk through the acur resource\r              {\r                      cursHdl = GetCCursor((*ballCursH)->frame[i].resID);     // Get the cursor\r                      if (cursHdl == nil)             // Make sure a real cursor was returned\r                        {                                                               // If not, trash all cursors loaded\r                            for (j = 0; j < i; j++)                         \r                                       DisposeCCursor((CCrsrHandle)(*ballCursH)->frame[j].cursorHdl);\r                         result = false;                         // Tell calling proc we failed\r                         break;                                          // And break out of the loop\r                   }\r                      else                                                    // But, if the cursor loaded ok\r                        {                                                               // add it to our list or cursor handles\r                                (*ballCursH)->frame[i].cursorHdl = (Handle)cursHdl;\r                            SetCCursor((CCrsrHandle)(*ballCursH)->frame[i].cursorHdl);\r                     }\r              }\r              InitCursor();                                           // Show the cursor again (as arrow)\r    }\r      return(result);                                                 // Return to calling proc w/ results\r}\r\r//--------------------------------------------------------------  InitAnimatedCursor\r\r// Loads and sets up animated beach ball cursor structures.\r\rvoid InitAnimatedCursor (acurHandle ballCursH)\r{\r    Boolean                 useColor;\r      \r       useColor = thisMac.hasColor;\r   if (ballCursH == nil) \r         ballCursH = (void *)GetResource('acur', 128);\r  if (ballCursH && ballCursH != animCursorH)\r     {\r              HNoPurge((Handle)ballCursH);\r           MoveHHi((Handle)ballCursH);\r            HLock((Handle)ballCursH);\r              if (useColor)\r                  useColor = GetColorCursors(ballCursH);\r         if (!useColor && !GetMonoCursors(ballCursH))\r                   RedAlert(kErrFailedResourceLoad);\r              DisposCursors();\r               animCursorH = ballCursH;\r               useColorCursor = useColor;\r             (*ballCursH)->index = 0;\r       }\r      else\r           RedAlert(kErrFailedResourceLoad);\r}\r\r//--------------------------------------------------------------  LoadCursors\r\r// Just calls the above function.  Other code could be added here thoughÉ\r// to add additional cursors.\r\rvoid LoadCursors (void)\r{\r InitAnimatedCursor((acurHandle)GetResource('acur', rAcurID));\r}\r\r//--------------------------------------------------------------  DisposCursors\r\r// Disposes of all memory allocated by anaimated beach ball cursors.\r\rvoid DisposCursors (void)\r{\r    register short          i, j;\r  \r       if (animCursorH != nil)\r        {\r              j = (*animCursorH)->n;\r         if (useColorCursor)\r            {\r                      for (i = 0; i < j; i++)\r                        {\r                              if ((*animCursorH)->frame[i].cursorHdl != nil)\r                                 DisposeCCursor((CCrsrHandle)(*animCursorH)->frame[i].cursorHdl);\r                       }\r              }\r              else\r           {\r                      for (i = 0; i < j; i++)\r                        {\r                              if ((*animCursorH)->frame[i].cursorHdl != nil)\r                                 DisposeHandle((Handle)(*animCursorH)->frame[i].cursorHdl);\r                     }\r              }\r              ReleaseResource((Handle)animCursorH);\r          animCursorH = nil;\r     }\r}\r\r//--------------------------------------------------------------  IncrementCursor\r\r// Advances the beach ball cursor one frame.\r\rvoid IncrementCursor (void)\r{\r    if (animCursorH == 0)\r          InitAnimatedCursor(nil);\r       if (animCursorH)\r       {\r              (*animCursorH)->index++;\r               (*animCursorH)->index %= (*animCursorH)->n;\r            if (useColorCursor)\r            {\r                      SetCCursor((CCrsrHandle)(*animCursorH)->\r                                       frame[(*animCursorH)->index].cursorHdl);\r               }\r              else\r           {\r                      SetCursor((CursPtr)*(*animCursorH)->\r                                   frame[(*animCursorH)->index].cursorHdl);\r               }\r      }\r      else\r           SetCursor((CursPtr)*GetCursor(watchCursor));\r}\r\r//--------------------------------------------------------------  DecrementCursor\r\r// Reverses the beach ball cursor one frame.\r\rvoid DecrementCursor (void)\r{\r if (animCursorH == 0)\r          InitAnimatedCursor(nil);\r       if (animCursorH)\r       {\r              (*animCursorH)->index--;\r               if (((*animCursorH)->index) < 0)\r                       (*animCursorH)->index = ((*animCursorH)->n) - 1;\r               if (useColorCursor)\r            {\r                      SetCCursor((CCrsrHandle)(*animCursorH)->\r                                       frame[(*animCursorH)->index].cursorHdl);\r               }\r              else\r           {\r                      SetCursor((CursPtr)*(*animCursorH)->\r                                   frame[(*animCursorH)->index].cursorHdl);\r               }\r      }\r      else\r           SetCursor((CursPtr)*GetCursor(watchCursor));\r}\r\r//--------------------------------------------------------------  SpinCursor\r\r// Advances the beach ball cursor the number of frames specified.\r\rvoid SpinCursor (short incrementIndex)\r{\r      UInt32          dummyLong;\r     short           i;\r     \r       for (i = 0; i < incrementIndex; i++)\r   {\r              IncrementCursor();\r             Delay(1, &dummyLong);\r  }\r}\r\r//--------------------------------------------------------------  BackSpinCursor\r\r// Reverses the beach ball cursor the number of frames specified.\r\rvoid BackSpinCursor (short decrementIndex)\r{\r UInt32          dummyLong;\r     short           i;\r     \r       for (i = 0; i < decrementIndex; i++)\r   {\r              DecrementCursor();\r             Delay(1, &dummyLong);\r  }\r}\r\r
\ No newline at end of file
diff --git a/Sources/AppleEvents.c b/Sources/AppleEvents.c
new file mode 100755 (executable)
index 0000000..44d3ec9
--- /dev/null
@@ -0,0 +1 @@
+\r//============================================================================\r//----------------------------------------------------------------------------\r//                                                                AppleEvents.c\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include "Externs.h"\r#include <AppleEvents.h>\r#include "House.h"\r\r\r#define kNoPrintingAlert                     1031\r\r\rpascal OSErr DoOpenAppAE (const AppleEvent *, AppleEvent *, UInt32);\rpascal OSErr DoOpenDocAE (const AppleEvent *, AppleEvent *, UInt32);\rpascal OSErr DoPrintDocAE (const AppleEvent *, AppleEvent *, UInt32);\rpascal OSErr DoQuitAE (const AppleEvent *, AppleEvent *, UInt32);\rpascal OSErr MyGotRequiredParams (const AppleEvent *);\r\r\rAEEventHandlerUPP     openAppAEUPP, openDocAEUPP, printDocAEUPP, quitAEUPP;\r\r\rextern  FSSpecPtr       theHousesSpecs;\rextern  long            incrementModeTime;\rextern       short           thisHouseIndex, splashOriginH, splashOriginV;\rextern    Boolean         quitting;\r\r\r//==============================================================  Functions\r//--------------------------------------------------------------  DoOpenAppAE\r// Handles an "Open Application" Apple Event.\r\rpascal OSErr DoOpenAppAE (const AppleEvent *theAE, AppleEvent *reply, UInt32 ref)\r{\r#pragma unused (reply, ref)\r   OSErr           theErr;\r        \r       theErr = MyGotRequiredParams(theAE);\r   return (theErr);\r}\r\r//--------------------------------------------------------------  DoOpenDocAE\r// Handles an "Open Document" Apple Event.\r\rpascal OSErr DoOpenDocAE (const AppleEvent *theAE, AppleEvent *reply, UInt32 ref)\r{\r#pragma unused (reply, ref)\r  FSSpec                  oneFSS;\r        FInfo                   finderInfo;\r    AEDescList              docList;\r       long                    itemsInList;\r   Size                    actualSize;\r    AEKeyword               keywd;\r DescType                returnedType;\r  OSErr                   theErr, whoCares;\r      short                   i;\r     \r       theErr = AEGetParamDesc(theAE, keyDirectObject, typeAEList, &docList);\r if (theErr != noErr)\r   {\r              YellowAlert(kYellowAppleEventErr, theErr);\r             return (theErr);\r       }\r      \r       theErr = MyGotRequiredParams(theAE);\r   if (theErr != noErr)\r   {\r              whoCares = AEDisposeDesc(&docList);\r            return (theErr);\r       }\r      \r       theErr = AECountItems(&docList, &itemsInList);\r if (theErr != noErr)\r   {\r              whoCares = AEDisposeDesc(&docList);\r            return (theErr);\r       }\r      \r#ifndef COMPILEDEMO    \r       for (i = 1; i <= itemsInList; i++)\r     {\r              theErr = AEGetNthPtr(&docList, i, typeFSS, &keywd, &returnedType,\r                              &oneFSS, sizeof(oneFSS), &actualSize);\r         if (theErr == noErr)\r           {\r                      theErr = FSpGetFInfo(&oneFSS, &finderInfo);\r                    if ((theErr == noErr) && (finderInfo.fdType == 'gliH'))\r                                AddExtraHouse(&oneFSS);\r                }\r      }\r      if (itemsInList > 0)\r   {\r              theErr = AEGetNthPtr(&docList, 1, typeFSS, &keywd, &returnedType,\r                              &oneFSS, sizeof(oneFSS), &actualSize);\r         if (theErr == noErr)\r           {\r                      theErr = FSpGetFInfo(&oneFSS, &finderInfo);\r                    if ((theErr == noErr) && (finderInfo.fdType == 'gliH'))\r                        {\r                              whoCares = CloseHouse();\r                               PasStringCopy(oneFSS.name, thisHouseName);\r                             BuildHouseList();\r                              if (OpenHouse())\r                                       whoCares = ReadHouse();\r                                PasStringCopy(theHousesSpecs[thisHouseIndex].name, thisHouseName);\r                             OpenCloseEditWindows();\r                                incrementModeTime = TickCount() + kIdleSplashTicks;\r                            if ((theMode == kSplashMode) || (theMode == kPlayMode))\r                                {\r                                      Rect            updateRect;\r                                    \r                                       SetRect(&updateRect, splashOriginH + 474, splashOriginV + 304, splashOriginH + 474 + 166, splashOriginV + 304 + 12);\r                                   InvalWindowRect(mainWindow, &updateRect);\r                              }\r                      }\r              }\r              InitCursor();\r  }\r#endif\r       whoCares = AEDisposeDesc(&docList);\r    \r       return theErr;\r}\r\r//--------------------------------------------------------------  DoPrintDocAE\r// Handles a "Print Document" Apple Event.\r\rpascal OSErr DoPrintDocAE (const AppleEvent *theAE, AppleEvent *reply, UInt32 ref)\r{\r#pragma unused (theAE, reply, ref)\r\r  short           hitWhat;\r       \r//     CenterAlert(kNoPrintingAlert);\r hitWhat = Alert(kNoPrintingAlert, nil);\r        \r       return errAEEventNotHandled;\r}\r\r//--------------------------------------------------------------  DoQuitAE\r// Handles a "Quit Application" Apple Event.\r\rpascal OSErr DoQuitAE (const AppleEvent *theAE, AppleEvent *reply, UInt32 ref)\r{\r#pragma unused (reply, ref)\r  OSErr                   isHuman;\r       \r       isHuman = MyGotRequiredParams(theAE);\r  if (isHuman == noErr)\r          quitting = true;\r       \r       return isHuman;\r}\r\r//--------------------------------------------------------------  MyGotRequiredParams\r// Have no clue!  :)\r\rpascal OSErr MyGotRequiredParams (const AppleEvent *theAE)\r{\r    DescType                returnedType;\r  Size                    actualSize;\r    \r       return (AEGetAttributePtr(theAE, keyMissedKeywordAttr, typeWildCard,\r                   &returnedType, 0L, 0, &actualSize) == errAEDescNotFound) ? noErr :\r                     errAEParamMissed;\r}\r\r//--------------------------------------------------------------  SetUpAppleEvents\r// Initializes all handlers, etc. for dealing with Apple Events.\r\rvoid SetUpAppleEvents (void)\r{\r       OSErr           theErr;\r        \r       openAppAEUPP = NewAEEventHandlerProc(DoOpenAppAE);\r     openDocAEUPP = NewAEEventHandlerProc(DoOpenDocAE);\r     printDocAEUPP = NewAEEventHandlerProc(DoPrintDocAE);\r   quitAEUPP = NewAEEventHandlerProc(DoQuitAE);\r   \r       theErr = AEInstallEventHandler(kCoreEventClass,         // install oapp \r                       kAEOpenApplication, openAppAEUPP, 0, false);\r   if (theErr != noErr)\r           YellowAlert(kYellowAppleEventErr, theErr);\r     \r       theErr = AEInstallEventHandler(kCoreEventClass,         // install odoc \r                       kAEOpenDocuments, openDocAEUPP, 0, false);\r     if (theErr != noErr)\r           YellowAlert(kYellowAppleEventErr, theErr);\r     \r       theErr = AEInstallEventHandler(kCoreEventClass,         // install pdoc \r                       kAEPrintDocuments, printDocAEUPP, 0, false);\r   if (theErr != noErr)\r           YellowAlert(kYellowAppleEventErr, theErr);\r     \r       theErr = AEInstallEventHandler(kCoreEventClass,         // install quit \r                       kAEQuitApplication, quitAEUPP, 0, false);\r      if (theErr != noErr)\r           YellowAlert(kYellowAppleEventErr, theErr);\r     \r       theErr = AESetInteractionAllowed(kAEInteractWithAll);\r  if (theErr != noErr)\r           YellowAlert(kYellowAppleEventErr, theErr);\r}\r\r
\ No newline at end of file
diff --git a/Sources/Banner.c b/Sources/Banner.c
new file mode 100755 (executable)
index 0000000..730dd35
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                       Banner.c\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <NumberFormatting.h>\r#include "Externs.h"\r#include "Environ.h"\r#include "MainWindow.h"\r#include "RectUtils.h"\r#include "Room.h"\r#include "Utilities.h"\r\r\r#define kBannerPageTopPICT           1993\r#define kBannerPageBottomPICT      1992\r#define kBannerPageBottomMask      1991\r#define kStarsRemainingPICT                1017\r#define kStarRemainingPICT         1018\r\r\rvoid DrawBanner (Point *);\rvoid DrawBannerMessage (Point);\r\r\rshort               numStarsRemaining;\rBoolean              bannerStarCountOn;\r\rextern      Rect            justRoomsRect;\rextern   Boolean         quickerTransitions, demoGoing, isUseSecondScreen;\r\r\r//==============================================================  Functions\r//--------------------------------------------------------------  DrawBanner\r// Displays opening banner (when a new game is begun).  The banner looksÉ\r// like a sheet of notebook paper.  The text printed on it is specifiedÉ\r// by the author of the house.\r\rvoid DrawBanner (Point *topLeft)\r{\r     CGrafPtr        wasCPort;\r      GDHandle        wasWorld;\r      Rect            wholePage, partPage, mapBounds;\r        GWorldPtr       tempMap;\r       GWorldPtr       tempMask;\r      OSErr           theErr;\r        \r       GetGWorld(&wasCPort, &wasWorld);\r       \r       QSetRect(&wholePage, 0, 0, 330, 220);\r  mapBounds = thisMac.screen;\r    ZeroRectCorner(&mapBounds);\r    CenterRectInRect(&wholePage, &mapBounds);\r      topLeft->h = wholePage.left;\r   topLeft->v = wholePage.top;\r    partPage = wholePage;\r  partPage.bottom = partPage.top + 190;   \r       SetGWorld(workSrcMap, nil);\r    LoadScaledGraphic(kBannerPageTopPICT, &partPage);\r      \r       partPage = wholePage;\r  partPage.top = partPage.bottom - 30;\r   mapBounds = partPage;\r  ZeroRectCorner(&mapBounds);\r    theErr = CreateOffScreenGWorld(&tempMap, &mapBounds, kPreferredDepth);\r SetGWorld(tempMap, nil);\r       LoadGraphic(kBannerPageBottomPICT);\r    \r       theErr = CreateOffScreenGWorld(&tempMask, &mapBounds, 1);       \r       SetGWorld(tempMask, nil);\r      LoadGraphic(kBannerPageBottomMask);\r    \r       CopyMask((BitMap *)*GetGWorldPixMap(tempMap), \r                 (BitMap *)*GetGWorldPixMap(tempMask), \r                 (BitMap *)*GetGWorldPixMap(workSrcMap), \r                       &mapBounds, &mapBounds, &partPage);\r    SetPort((GrafPtr)workSrcMap);\r  \r       SetGWorld(wasCPort, wasWorld);\r DisposeGWorld(tempMap);\r        DisposeGWorld(tempMask);\r}\r\r//--------------------------------------------------------------  CountStarsInHouse\r// Goes through the current house and counts the total number of stars within.\r\rshort CountStarsInHouse (void)\r{\r       short           i, h, numRooms, numStars;\r      char            wasState;\r      \r       numStars = 0;\r  \r       wasState = HGetState((Handle)thisHouse);\r       HLock((Handle)thisHouse);\r      numRooms = (*thisHouse)->nRooms;\r       for (i = 0; i < numRooms; i++)\r {\r              if ((*thisHouse)->rooms[i].suite != kRoomIsEmpty)\r                      for (h = 0; h < kMaxRoomObs; h++)\r                      {\r                              if ((*thisHouse)->rooms[i].objects[h].what == kStar)\r                                   numStars++;\r                    }\r      }\r      HSetState((Handle)thisHouse, wasState);\r        \r       return (numStars);\r}\r\r//--------------------------------------------------------------  DrawBannerMessage\r\r// This function prints the author's message acorss the notebook paper banner.\r\rvoid DrawBannerMessage (Point topLeft)\r{\r    Str255          bannerStr, subStr;\r     short           count;\r char            wasState;\r      \r       wasState = HGetState((Handle)thisHouse);\r       HLock((Handle)thisHouse);\r      PasStringCopy((*thisHouse)->banner, bannerStr);\r        HSetState((Handle)thisHouse, wasState);\r        \r       TextFont(applFont);\r    TextFace(bold);\r        TextSize(12);\r  ForeColor(blackColor);\r count = 0;\r     do\r     {\r              GetLineOfText(bannerStr, count, subStr);\r               MoveTo(topLeft.h + 16, topLeft.v + 32 + (count * 20));\r         DrawString(subStr);\r            count++;\r       }\r      while (subStr[0] > 0);\r \r       if (bannerStarCountOn)\r {\r              if (numStarsRemaining != 1)\r                    GetLocalizedString(1, bannerStr);\r              else\r                   GetLocalizedString(2, bannerStr);\r              \r               NumToString((long)numStarsRemaining, subStr);\r          PasStringConcat(bannerStr, subStr);\r            \r               if (numStarsRemaining != 1)\r                    GetLocalizedString(3, subStr);\r         else\r                   GetLocalizedString(4, subStr);\r         PasStringConcat(bannerStr, subStr);\r            \r               ForeColor(redColor);\r           MoveTo(topLeft.h + 16, topLeft.v + 164);\r               DrawString(bannerStr);\r         MoveTo(topLeft.h + 16, topLeft.v + 180);\r               GetLocalizedString(5, subStr);\r         DrawString(subStr);\r    }\r      ForeColor(blackColor);\r}\r\r//--------------------------------------------------------------  BringUpBanner\r// Handles bringing up displaying and disposing of the banner.\r\rvoid BringUpBanner (void)\r{\r  Rect            wholePage;\r     Point           topLeft;\r       \r       DrawBanner(&topLeft);\r  DrawBannerMessage(topLeft);\r//  if (quickerTransitions)\r//              DissBitsChunky(&justRoomsRect);         // was workSrcRect\r//   else\r//         DissBits(&justRoomsRect);\r      QSetRect(&wholePage, 0, 0, 330, 220);\r  QOffsetRect(&wholePage, topLeft.h, topLeft.v);\r \r       CopyBits((BitMap *)*GetGWorldPixMap(backSrcMap), \r                      (BitMap *)*GetGWorldPixMap(workSrcMap), \r                       &wholePage, &wholePage, srcCopy, nil);\r \r       if (demoGoing)\r         WaitForInputEvent(4);\r  else\r           WaitForInputEvent(15);\r \r//     if (quickerTransitions)\r//              DissBitsChunky(&justRoomsRect);\r//      else\r//         DissBits(&justRoomsRect);\r}\r\r//--------------------------------------------------------------  DisplayStarsRemaining\r// This brings up a small message indicating the number of stars remainingÉ\r// in a house.  It comes up when the player gets a star (the game is pausedÉ\r// and the user informed as to how many remain).\r\rvoid DisplayStarsRemaining (void)\r{\r    Rect            src, bounds;\r   Str255          theStr;\r        \r       SetPortWindowPort(mainWindow);\r QSetRect(&bounds, 0, 0, 256, 64);\r      CenterRectInRect(&bounds, &thisMac.screen);\r    QOffsetRect(&bounds, -thisMac.screen.left, -thisMac.screen.top);\r       src = bounds;\r  InsetRect(&src, 64, 32);\r       \r       TextFont(applFont);\r    TextFace(bold);\r        TextSize(12);\r  NumToString((long)numStarsRemaining, theStr);\r  \r       QOffsetRect(&bounds, 0, -20);\r  if (numStarsRemaining < 2)\r             LoadScaledGraphic(kStarRemainingPICT, &bounds);\r        else\r   {\r              LoadScaledGraphic(kStarsRemainingPICT, &bounds);\r               MoveTo(bounds.left + 102 - (StringWidth(theStr) / 2), bounds.top + 23);\r                ColorText(theStr, 4L);\r }\r      \r       DelayTicks(60);\r        if (WaitForInputEvent(30))\r             RestoreEntireGameScreen();\r     CopyRectWorkToMain(&bounds);\r}\r\r
\ No newline at end of file
diff --git a/Sources/ColorUtils.c b/Sources/ColorUtils.c
new file mode 100755 (executable)
index 0000000..3b81c06
--- /dev/null
@@ -0,0 +1 @@
+\r//============================================================================\r//----------------------------------------------------------------------------\r//                                                                ColorUtils.c\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include "Externs.h"\r#include <Palettes.h>\r\r\r//==============================================================  Functions\r//--------------------------------------------------------------  ColorText\r\r// Given a string and a color index (index into the current palette),É\r// this function draws text in that color.  It assumes the current port,É\r// the current font, the current pen location, etc.\r\rvoid ColorText (StringPtr theStr, long color)\r{\r     RGBColor        theRGBColor, wasColor;\r \r       GetForeColor(&wasColor);\r       Index2Color(color, &theRGBColor);\r      RGBForeColor(&theRGBColor);\r    DrawString(theStr);\r    RGBForeColor(&wasColor);\r}\r\r//--------------------------------------------------------------  ColorRect\r\r// Given a rectangle and color index, this function draws a solidÉ\r// rectangle in that color.  Current port, pen mode, etc. assumed.\r\rvoid ColorRect (Rect *theRect, long color)\r{\r   RGBColor        theRGBColor, wasColor;\r \r       GetForeColor(&wasColor);\r       Index2Color(color, &theRGBColor);\r      RGBForeColor(&theRGBColor);\r    PaintRect(theRect);\r    RGBForeColor(&wasColor);\r}\r\r//--------------------------------------------------------------  ColorOval\r\r// Given a rectangle and color index, this function draws a solidÉ\r// oval in that color.  Current port, pen mode, etc. assumed.\r\rvoid ColorOval (Rect *theRect, long color)\r{\r        RGBColor        theRGBColor, wasColor;\r \r       GetForeColor(&wasColor);\r       Index2Color(color, &theRGBColor);\r      RGBForeColor(&theRGBColor);\r    PaintOval(theRect);\r    RGBForeColor(&wasColor);\r}\r\r//--------------------------------------------------------------  ColorRegion\r\r// Given a region and color index, this function draws a solidÉ\r// region in that color.  Current port, pen mode, etc. assumed.\r\rvoid ColorRegion (RgnHandle theRgn, long color)\r{\r  RGBColor        theRGBColor, wasColor;\r \r       GetForeColor(&wasColor);\r       Index2Color(color, &theRGBColor);\r      RGBForeColor(&theRGBColor);\r    PaintRgn(theRgn);\r      RGBForeColor(&wasColor);\r}\r\r//--------------------------------------------------------------  ColorLine\r\r// Given a the end points for a line and color index, this functionÉ\r// draws a line in that color.  Current port, pen mode, etc. assumed.\r\rvoid ColorLine (short h0, short v0, short h1, short v1, long color)\r{\r     RGBColor        theRGBColor, wasColor;\r \r       GetForeColor(&wasColor);\r       Index2Color(color, &theRGBColor);\r      RGBForeColor(&theRGBColor);\r    MoveTo(h0, v0);\r        LineTo(h1, v1);\r        RGBForeColor(&wasColor);\r}\r\r//--------------------------------------------------------------  HiliteRect\r\r// Given a rect and two hilite colors, this function frames the top andÉ\r// left edges of the rect with color 1 and frames the bottom and rightÉ\r// sides with color 2.  A rect can be made to appear "hi-lit" or "3D"É\r// in this way.\r\rvoid HiliteRect (Rect *theRect, short color1, short color2)\r{\r       ColorLine(theRect->left, theRect->top, theRect->right - 2, \r                    theRect->top, color1);\r ColorLine(theRect->left, theRect->top, theRect->left, \r                 theRect->bottom - 2, color1);\r  ColorLine(theRect->right - 1, theRect->top, theRect->right - 1, \r                       theRect->bottom - 2, color2);\r  ColorLine(theRect->left + 1, theRect->bottom - 1, theRect->right - 1, \r                 theRect->bottom - 1, color2);\r}\r\r//--------------------------------------------------------------  ColorFrameRect\r\r// Given a rectangle and color index, this function frames aÉ\r// rectangle in that color.  Current port, pen mode, etc. assumed.\r\rvoid ColorFrameRect (Rect *theRect, long color)\r{\r RGBColor        theRGBColor, wasColor;\r \r       GetForeColor(&wasColor);\r       Index2Color(color, &theRGBColor);\r      RGBForeColor(&theRGBColor);\r    FrameRect(theRect);\r    RGBForeColor(&wasColor);\r}\r\r//--------------------------------------------------------------  ColorFrameWHRect\r\r// Given a the top-left corner of a rectangle, its width and height,É\r// and a color index, this function frames a rectangle in that color.\r// Current port, pen mode, etc. assumed.\r\rvoid ColorFrameWHRect (short left, short top, short wide, short high, long color)\r{\r      Rect            theRect;\r       \r       theRect.left = left;\r   theRect.top = top;\r     theRect.right = left + wide;\r   theRect.bottom = top + high;\r   ColorFrameRect(&theRect, color);\r}\r\r//--------------------------------------------------------------  ColorFrameOval\r\r// Given a rectangle and color index, this function frames anÉ\r// oval in that color.  Current port, pen mode, etc. assumed.\r\rvoid ColorFrameOval (Rect *theRect, long color)\r{\r  RGBColor        theRGBColor, wasColor;\r \r       GetForeColor(&wasColor);\r       Index2Color(color, &theRGBColor);\r      RGBForeColor(&theRGBColor);\r    FrameOval(theRect);\r    RGBForeColor(&wasColor);\r}\r\r//--------------------------------------------------------------  LtGrayForeColor\r\r// This function finds the closest match to a "light gray" in theÉ\r// current palette and sets the pen color to that.\r\rvoid LtGrayForeColor (void)\r{\r    RGBColor        color;\r \r       color.red = (unsigned short) 0xBFFF;\r   color.green = (unsigned short) 0xBFFF;\r color.blue = (unsigned short) 0xBFFF;\r  \r       RGBForeColor(&color);\r}\r\r//--------------------------------------------------------------  GrayForeColor\r\r// This function finds the closest match to a "medium gray" in theÉ\r// current palette and sets the pen color to that.\r\rvoid GrayForeColor (void)\r{\r  RGBColor        color;\r \r       color.red = (unsigned short) 0x7FFF;\r   color.green = (unsigned short) 0x7FFF;\r color.blue = (unsigned short) 0x7FFF;\r  \r       RGBForeColor(&color);\r}\r\r//--------------------------------------------------------------  DkGrayForeColor\r\r// This function finds the closest match to a "dark gray" in theÉ\r// current palette and sets the pen color to that.\r\rvoid DkGrayForeColor (void)\r{\r        RGBColor        color;\r \r       color.red = (unsigned short) 0x3FFF;\r   color.green = (unsigned short) 0x3FFF;\r color.blue = (unsigned short) 0x3FFF;\r  \r       RGBForeColor(&color);\r}\r\r//--------------------------------------------------------------  RestoreColorsSlam\r\r// This function forces the Macintosh to rebuild the palette.  It isÉ\r// called to restore a sense or normality after some serious mungingÉ\r// with the palette.\r\rvoid RestoreColorsSlam (void)\r{\r        RestoreDeviceClut(nil);\r        PaintBehind(nil, GetGrayRgn());\r        DrawMenuBar();\r}\r\r
\ No newline at end of file
diff --git a/Sources/Coordinates.c b/Sources/Coordinates.c
new file mode 100755 (executable)
index 0000000..6831426
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                 Coordinates.c\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <NumberFormatting.h>\r#include "Externs.h"\r#include "Environ.h"\r#include "Marquee.h"\r#include "ObjectEdit.h"\r#include "RectUtils.h"\r\r\rRect                      coordWindowRect;\rWindowPtr              coordWindow;\rshort                      isCoordH, isCoordV;\rshort                       coordH, coordV, coordD;\rBoolean                 isCoordOpen;\r\r\r//==============================================================  Functions\r//--------------------------------------------------------------  SetCoordinateHVD\r\r// Given a horizontal, vertical and distance value, this functionÉ\r// displays these values in the Coordinates window.\r\rvoid SetCoordinateHVD (short h, short v, short d)\r{\r#ifndef COMPILEDEMO\r if (h != -2)\r           coordH = h;\r    if (v != -2)\r           coordV = v;\r    if (d != -2)\r           coordD = d;\r    UpdateCoordWindow();\r#endif\r}\r\r//--------------------------------------------------------------  DeltaCoordinateD\r\r// When the user is dragging a handle (such as the height of a blower)É\r// this function can be called and passed the amount by which the userÉ\r// has changed the height (delta).  This function then displays it inÉ\r// the Coordinate window.\r\rvoid DeltaCoordinateD (short d)\r{\r#ifndef COMPILEDEMO\r     coordD = d;\r    UpdateCoordWindow();\r#endif\r}\r\r//--------------------------------------------------------------  UpdateCoordWindow\r\r// Completely redraws and updates the Coordinate window.\r\rvoid UpdateCoordWindow (void)\r{\r#ifndef COMPILEDEMO\r      Str255          tempStr, numStr;\r       GrafPtr         wasPort;\r       \r       if (coordWindow == nil)\r                return;\r        \r       GetPort(&wasPort);\r     SetPort((GrafPtr)coordWindow);\r EraseRect(&coordWindowRect);\r   \r       PasStringCopy("\ph: ", tempStr);\r       if (coordH != -1)\r      {\r              NumToString((long)coordH, numStr);\r             PasStringConcat(tempStr, numStr);\r      }\r      else\r           PasStringConcat(tempStr, "\p-");\r       MoveTo(5, 12);\r DrawString(tempStr);\r   \r       PasStringCopy("\pv: ", tempStr);\r       if (coordV != -1)\r      {\r              NumToString((long)coordV, numStr);\r             PasStringConcat(tempStr, numStr);\r      }\r      else\r           PasStringConcat(tempStr, "\p-");\r       MoveTo(4, 22);\r DrawString(tempStr);\r   \r       ForeColor(blueColor);\r  PasStringCopy("\pd: ", tempStr);\r       if (coordD != -1)\r      {\r              NumToString((long)coordD, numStr);\r             PasStringConcat(tempStr, numStr);\r      }\r      else\r           PasStringConcat(tempStr, "\p-");\r       MoveTo(5, 32);\r DrawString(tempStr);\r   ForeColor(blackColor);\r \r       SetPort((GrafPtr)wasPort);\r#endif\r}\r\r//--------------------------------------------------------------  OpenCoordWindow\r// Brings up the Coordinate window.\r\rvoid OpenCoordWindow (void)\r{\r#ifndef COMPILEDEMO\r  Rect            src, dest;\r     Point           globalMouse;\r   short           direction, dist;\r       \r       if (coordWindow == nil)\r        {\r              QSetRect(&coordWindowRect, 0, 0, 50, 38);\r              if (thisMac.hasColor)\r                  coordWindow = NewCWindow(nil, &coordWindowRect, \r                                       "\pTools", false, kWindoidWDEF, kPutInFront, true, 0L);\r                else\r                   coordWindow = NewWindow(nil, &coordWindowRect, \r                                        "\pTools", false, kWindoidWDEF, kPutInFront, true, 0L);\r                \r               if (coordWindow == nil)\r                        RedAlert(kErrNoMemory);\r                \r//             if (OptionKeyDown())\r//         {\r//                    isCoordH = qd.screenBits.bounds.right - 55;\r//                  isCoordV = 204;\r//              }\r              MoveWindow(coordWindow, isCoordH, isCoordV, true);\r             globalMouse = MyGetGlobalMouse();\r              QSetRect(&src, 0, 0, 1, 1);\r            QOffsetRect(&src, globalMouse.h, globalMouse.v);\r               GetWindowRect(coordWindow, &dest);\r             BringToFront(coordWindow);\r             ShowHide(coordWindow, true);\r//         FlagWindowFloating(coordWindow);        TEMP - use flaoting windows\r            HiliteAllWindows();\r            \r               coordH = -1;\r           coordV = -1;\r           coordD = -1;\r           TextFace(applFont);\r            TextSize(9);\r           \r               if (objActive != kNoObjectSelected)\r            {\r                      if (ObjectHasHandle(&direction, &dist))\r                                coordD = dist;\r                 SetCoordinateHVD(theMarquee.bounds.left, theMarquee.bounds.top, coordD);\r               }\r      }\r      \r       UpdateCoordinateCheckmark(true);\r#endif\r}\r\r//--------------------------------------------------------------  CloseCoordWindow\r// Closes and disposes of the Coordinate window.\r\rvoid CloseCoordWindow (void)\r{\r CloseThisWindow(&coordWindow);\r UpdateCoordinateCheckmark(false);\r}\r\r//--------------------------------------------------------------  ToggleCoordinateWindow\r// Toggles the Coordinate windows state between open and closed.\r\rvoid ToggleCoordinateWindow (void)\r{\r#ifndef COMPILEDEMO\r       if (coordWindow == nil)\r        {\r              OpenCoordWindow();\r             isCoordOpen = true;\r    }\r      else\r   {\r              CloseCoordWindow();\r            isCoordOpen = false;\r   }\r#endif\r}\r\r
\ No newline at end of file
diff --git a/Sources/DebugUtilities.c b/Sources/DebugUtilities.c
new file mode 100755 (executable)
index 0000000..099ae3a
--- /dev/null
@@ -0,0 +1 @@
+/*============================================================*/\r/*============================================================*/\r/*==                                                                                                         ==*/\r/*==                               Debugging Utility Routines                              ==*/\r/*==                                                                                                               ==*/\r/*============================================================*/\r/*============================================================*/\r\r\r#include <NumberFormatting.h>\r#include "Externs.h"\r\r\rshort                     barGraphHori = 0;\r\r\r//==============================================================  Functions\r//--------------------------------------------------------------  MonitorWait\r\rvoid MonitorWait (void)\r{\r       GrafPtr                 wasPort, tempPort;\r     Rect                    tempRect;\r      \r       GetPort(&wasPort);\r     \r       tempPort = (GrafPtr)NewPtrClear(sizeof(GrafPort));\r     OpenPort(tempPort);\r    \r       SetRect(&tempRect, 8, 28, 16, 36);\r     InvertRect(&tempRect);\r \r       ClosePort(tempPort);\r   \r       SetPort((GrafPtr)wasPort);\r}\r\r//--------------------------------------------------------------  DisplayRect\r\rvoid DisplayRect (Rect *theRect)\r{\r        GrafPtr                 wasPort, tempPort;\r     \r       GetPort(&wasPort);\r     \r       tempPort = (GrafPtr)NewPtrClear(sizeof(GrafPort));\r     OpenPort(tempPort);\r    \r       InvertRect(theRect);\r   \r       ClosePort(tempPort);\r   SetPort((GrafPtr)wasPort);\r}\r\r\r//--------------------------------------------------------------  FlashRect\r\rvoid FlashRect (Rect *theRect)\r\r{\r  GrafPtr                 wasPort, tempPort;\r     \r       GetPort(&wasPort);\r     \r       tempPort = (GrafPtr)NewPtrClear(sizeof(GrafPort));\r     OpenPort(tempPort);\r    \r       InvertRect(theRect);\r   InvertRect(theRect);\r   InvertRect(theRect);\r   InvertRect(theRect);\r   \r       ClosePort(tempPort);\r   SetPort((GrafPtr)wasPort);\r}\r\r//--------------------------------------------------------------  CheckLegitRect\r\rvoid CheckLegitRect(Rect *srcRect, Rect *inRect)\r{\r     Rect                    dummyRect;\r     \r       if ((srcRect->left > srcRect->right) || (srcRect->top > srcRect->bottom))\r              DebugStr("\pSource Rectangle not dimensional");\r        \r       if (!SectRect(srcRect, inRect, &dummyRect))\r            DebugStr("\pSource Rectangle not Secting Target Rectangle");\r}\r\r\r/*==============================================================  DisplayLong  */\r\rvoid DisplayLong (long theValue)\r\r{\r        GrafPtr                 wasPort, tempPort;\r     Str255                  tempStr;\r       Rect                    tempRect;\r      \r       GetPort(&wasPort);\r     \r       tempPort = (GrafPtr)NewPtrClear(sizeof(GrafPort));\r     OpenPort(tempPort);\r    \r       NumToString(theValue, tempStr);\r        MoveTo(20,40);\r SetRect(&tempRect, 18, 20, 122, 42);\r   EraseRect(&tempRect);\r  DrawString(tempStr);\r   \r       while (Button())\r       {\r      }\r      while (!Button())\r      {\r      }\r      \r       ClosePort(tempPort);\r   SetPort((GrafPtr)wasPort);\r}\r\r\r/*==============================================================  DisplayShort  */\r\rvoid DisplayShort(short theValue)\r\r{\r        GrafPtr                 wasPort, tempPort;\r     Str255                  tempStr;\r       Rect                    tempRect;\r      \r       GetPort(&wasPort);\r     \r       tempPort = (GrafPtr)NewPtrClear(sizeof(GrafPort));\r     OpenPort(tempPort);\r    \r       NumToString((long)theValue, tempStr);\r  MoveTo(20,40);\r SetRect(&tempRect, 18, 20, 122, 42);\r   EraseRect(&tempRect);\r  DrawString(tempStr);\r   \r       while (Button())\r       {\r      }\r      while (!Button())\r      {\r      }\r      \r       ClosePort(tempPort);\r   SetPort((GrafPtr)wasPort);\r}\r\r\r/*==============================================================  FlashLong  */\r\rvoid FlashLong(long theValue)\r{\r        GrafPtr                 wasPort, tempPort;\r     Str255                  tempStr;\r       Rect                    tempRect;\r      \r       GetPort(&wasPort);\r     \r       tempPort = (GrafPtr)NewPtrClear(sizeof(GrafPort));\r     OpenPort(tempPort);\r    \r       NumToString(theValue, tempStr);\r        MoveTo(20,40);\r SetRect(&tempRect, 18, 20, 122, 42);\r   EraseRect(&tempRect);\r  DrawString(tempStr);\r   \r       ClosePort(tempPort);\r   SetPort((GrafPtr)wasPort);\r}\r\r\r/*==============================================================  FlashShort  */\r\rvoid FlashShort (short theValue)\r{\r    GrafPtr                 wasPort, tempPort;\r     Str255                  tempStr;\r       Rect                    tempRect;\r      \r       GetPort(&wasPort);\r     \r       tempPort = (GrafPtr)NewPtrClear(sizeof(GrafPort));\r     OpenPort(tempPort);\r    \r       NumToString((long)theValue, tempStr);\r  MoveTo(20,40);\r SetRect(&tempRect, 18, 20, 122, 42);\r   EraseRect(&tempRect);\r  DrawString(tempStr);\r   \r       ClosePort(tempPort);\r   SetPort((GrafPtr)wasPort);\r}\r\r\r/*==============================================================  DoBarGraph  */\r\rvoid DoBarGraph (short theValue, short downScreen, short maxDown, short scaleIt)\r\r{\r   GrafPtr                 wasPort, tempPort;\r     \r       GetPort(&wasPort);\r     \r       tempPort = (GrafPtr)NewPtrClear(sizeof(GrafPort));\r     OpenPort(tempPort);\r    \r       theValue *= scaleIt;\r   \r       PenPat(&qd.white);\r     MoveTo(barGraphHori, 0);\r       Line(0, maxDown);\r      MoveTo(barGraphHori, downScreen);\r      PenPat(&qd.black);\r     if (theValue == 0)\r     {\r              theValue = 1;\r          ForeColor(greenColor);\r }\r      else if (theValue < 0)\r {\r              if (theValue < -downScreen)\r            {\r                      theValue = -downScreen;\r                        ForeColor(magentaColor);\r               }\r              else\r                   ForeColor(redColor);\r   }\r      else\r   {\r              if (theValue > downScreen)\r             {\r                      ForeColor(cyanColor);\r                  theValue = downScreen;\r         }\r              else\r                   ForeColor(blueColor);\r  }\r      Line(0, -theValue);\r    ForeColor(blackColor);\r \r       barGraphHori++;\r        if (barGraphHori >= 512)\r               barGraphHori = 0;\r      \r       ClosePort(tempPort);\r   SetPort((GrafPtr)wasPort);\r}\r\r\r/*==============================================================  BetaOkay  */\r\rshort BetaOkay (void)\r\r{\r        DateTimeRec             dateRecord;\r    UInt32  theseSeconds;\r  Boolean                 stillCool;\r     \r       GetDateTime(&theseSeconds);\r    SecondsToDate(theseSeconds, &dateRecord);\r      \r       if (dateRecord.month < 8)\r              stillCool = true;\r      else\r           stillCool = false;\r     \r       return((short)stillCool);\r}\r\r//--------------------------------------------------------------  DebugNum\r\rvoid DebugNum (long theNum)\r{\r Str255          theStr;\r        NumToString(theNum, theStr);\r   DebugStr(theStr);\r}\r\r//--------------------------------------------------------------  DisplayCTSeed\r\rvoid DisplayCTSeed (CGrafPtr who)\r{\r      long            theSeed;\r       \r       theSeed = (**((**(who->portPixMap)).pmTable)).ctSeed;\r  DisplayLong(theSeed);\r}\r\r//--------------------------------------------------------------  FillScreenRed\r\rvoid FillScreenRed (void)\r{\r  GrafPtr                 wasPort, tempPort;\r     \r       GetPort(&wasPort);\r     tempPort = (GrafPtr)NewPtrClear(sizeof(GrafPort));\r     OpenPort(tempPort);\r    PenNormal();\r   ForeColor(redColor);\r   PaintRect(&qd.screenBits.bounds);\r      ClosePort(tempPort);\r   SetPort((GrafPtr)wasPort);\r}\r\r//--------------------------------------------------------------  DumpToResEditFile\r\rvoid DumpToResEditFile (Ptr data, long dataSize)\r{\r  DateTimeRec             timeRec;\r       Str32                   filesName, dateStr;\r    Handle                  newResource;\r   UInt32                  dateTime;\r      long                    tempLong;\r      OSErr                   theErr;\r        short                   iFileRef;\r      \r       PasStringCopy("\pTerrain ", filesName);\r        \r       GetDateTime(&dateTime);\r        SecondsToDate(dateTime, &timeRec);\r     tempLong = (long)timeRec.hour;\r NumToString(tempLong, dateStr);\r        PasStringConcat(filesName, dateStr);\r   PasStringConcat(filesName, "\p-");\r     tempLong = (long)timeRec.minute;\r       NumToString(tempLong, dateStr);\r        PasStringConcat(filesName, dateStr);\r   \r       theErr = Create(filesName, 0, 'RSED', 'rsrc');\r if (theErr != noErr)\r           DebugStr("\p Create");\r \r       CreateResFile(filesName);\r      if (ResError() != noErr)\r               DebugStr("\p CreateResFile");\r  \r       iFileRef = OpenResFile(filesName);\r     if ((ResError() != noErr) || (iFileRef == -1))\r         DebugStr("\p OpenResFile");\r    \r       if (PtrToHand(data, &newResource, dataSize) != noErr)\r          DebugStr("\pPtrToHand");\r       AddResource(newResource, 'demo', 128, "\p");\r   ChangedResource(newResource);\r}\r\r
\ No newline at end of file
diff --git a/Sources/DialogUtils.c b/Sources/DialogUtils.c
new file mode 100755 (executable)
index 0000000..eae9cf3
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                               DialogUtils.c\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include <ControlDefinitions.h>\r#include <LowMem.h>\r#include <NumberFormatting.h>\r#include "DialogUtils.h"\r#include "Externs.h"\r\r\r#define kActive                                         0\r#define kInactive                                     255\r\r\r//==============================================================  Functions\r//--------------------------------------------------------------  BringUpDialog\r// Given a dialog pointer and a resource ID, this function brings it upÉ\r// centered, visible, and with the default button outlined.\r\rvoid BringUpDialog (DialogPtr *theDialog, short dialogID)\r{\r//  CenterDialog(dialogID);\r        *theDialog = GetNewDialog(dialogID, nil, kPutInFront);\r if (*theDialog == nil)\r         RedAlert(kErrDialogDidntLoad);\r SetPort((GrafPtr)*theDialog);\r  ShowWindow(GetDialogWindow(*theDialog));\r       DrawDefaultButton(*theDialog);\r}\r\r//--------------------------------------------------------------  GetPutDialogCorner\r// Determines the upper left corner coordinates needed to properly centerÉ\r// the standard Mac PutFile dialog (when you save files).\r/*\rvoid GetPutDialogCorner (Point *theCorner)\r{\r    DialogTHndl     dlogHandle;\r    Rect            theScreen, dlogBounds;\r Byte            wasState;\r      \r       theCorner->h = 64;\r     theCorner->v = 64;\r     theScreen = qd.screenBits.bounds;\r      theScreen.top += LMGetMBarHeight();\r    OffsetRect(&theScreen, -theScreen.left, -theScreen.top);\r       \r       dlogHandle = (DialogTHndl)GetResource('DLOG', sfPutDialogID);\r  if (dlogHandle != nil)\r {\r              wasState = HGetState((Handle)dlogHandle);\r              HLock((Handle)dlogHandle);\r             \r               dlogBounds = (**dlogHandle).boundsRect;\r                OffsetRect(&dlogBounds, -dlogBounds.left, -dlogBounds.top);\r            \r               theCorner->h = (theScreen.right - dlogBounds.right) / 2;\r               theCorner->v = (theScreen.bottom - dlogBounds.bottom) / 3;\r             \r               HSetState((Handle)dlogHandle, wasState);\r       }\r      theCorner->v += LMGetMBarHeight();\r}\r*/\r\r//--------------------------------------------------------------  GetPutDialogCorner\r// Determines the upper left corner coordinates needed to properly centerÉ\r// the standard Mac GetFile dialog (when you open files).\r/*\rvoid GetGetDialogCorner (Point *theCorner)\r{\r     DialogTHndl     dlogHandle;\r    Rect            theScreen, dlogBounds;\r Byte            wasState;\r      \r       theCorner->h = 64;\r     theCorner->v = 64;\r     theScreen = qd.screenBits.bounds;\r      theScreen.top += LMGetMBarHeight();\r    OffsetRect(&theScreen, -theScreen.left, -theScreen.top);\r       \r       dlogHandle = (DialogTHndl)GetResource('DLOG', sfGetDialogID);\r  if (dlogHandle != nil)\r {\r              wasState = HGetState((Handle)dlogHandle);\r              HLock((Handle)dlogHandle);\r             \r               dlogBounds = (**dlogHandle).boundsRect;\r                OffsetRect(&dlogBounds, -dlogBounds.left, -dlogBounds.top);\r            \r               theCorner->h = (theScreen.right - dlogBounds.right) / 2;\r               theCorner->v = (theScreen.bottom - dlogBounds.bottom) / 3;\r             \r               HSetState((Handle)dlogHandle, wasState);\r       }\r      theCorner->v += LMGetMBarHeight();\r}\r*/\r//--------------------------------------------------------------  CenterDialog\r// Given a resource ID for a dialog, this function properly centers it.\r/*\rvoid CenterDialog (SInt16 dialogID)\r{\r        DialogTHndl     dlogHandle;\r    Rect            theScreen, dlogBounds;\r SInt16          hPos, vPos;\r    Byte            wasState;\r      \r       theScreen = qd.screenBits.bounds;\r      theScreen.top += LMGetMBarHeight();\r    \r       dlogHandle = (DialogTHndl)GetResource('DLOG', dialogID);\r       if (dlogHandle != nil)\r {\r              wasState = HGetState((Handle)dlogHandle);\r              HLock((Handle)dlogHandle);\r             \r               dlogBounds = (**dlogHandle).boundsRect;\r                OffsetRect(&dlogBounds, -dlogBounds.left, -dlogBounds.top);\r            \r               hPos = ((theScreen.right - theScreen.left) - dlogBounds.right) / 2;\r            vPos = ((theScreen.bottom - theScreen.top) - dlogBounds.bottom) / 3;\r           \r               OffsetRect(&dlogBounds, hPos, vPos + LMGetMBarHeight());\r               \r               (**dlogHandle).boundsRect = dlogBounds;\r                HSetState((Handle)dlogHandle, wasState);\r       }\r}\r*/\r//--------------------------------------------------------------  GetDialogRect\r// Determines the bounding rectangle for a given dialog.\r\rvoid GetDialogRect (Rect *bounds, short dialogID)\r{\r   DialogTHndl     dlogHandle;\r    Byte            wasState;\r      \r       dlogHandle = (DialogTHndl)GetResource('DLOG', dialogID);\r       if (dlogHandle != nil)\r {\r              wasState = HGetState((Handle)dlogHandle);\r              HLock((Handle)dlogHandle);\r             \r               *bounds = (**dlogHandle).boundsRect;\r           HSetState((Handle)dlogHandle, wasState);\r       }\r}\r\r//--------------------------------------------------------------  TrueCenterDialog\r// Places a dialog DEAD CENTER (as opposed to 1/3 of the way down asÉ\r// is common for Mac dialog centering).\r/*\rvoid TrueCenterDialog (short dialogID)\r{\r      DialogTHndl     dlogHandle;\r    Rect            theScreen, dlogBounds;\r short           hPos, vPos;\r    Byte            wasState;\r      \r       theScreen = qd.screenBits.bounds;\r      theScreen.top += LMGetMBarHeight();\r    \r       dlogHandle = (DialogTHndl)GetResource('DLOG', dialogID);\r       if (dlogHandle != nil)\r {\r              wasState = HGetState((Handle)dlogHandle);\r              HLock((Handle)dlogHandle);\r             \r               dlogBounds = (**dlogHandle).boundsRect;\r                OffsetRect(&dlogBounds, theScreen.left - dlogBounds.left, \r                             theScreen.top - dlogBounds.top);\r               \r               hPos = ((theScreen.right - theScreen.left) - \r                          (dlogBounds.right - dlogBounds.left)) / 2;\r             vPos = ((theScreen.bottom - theScreen.top) - \r                          (dlogBounds.bottom - dlogBounds.top)) / 2;\r             \r               OffsetRect(&dlogBounds, hPos, vPos + LMGetMBarHeight());\r               \r               (**dlogHandle).boundsRect = dlogBounds;\r                HSetState((Handle)dlogHandle, wasState);\r       }\r}\r*/\r//--------------------------------------------------------------  CenterAlert\r// Given an alert ID, this function properly centers it on the main monitor.\r/*\rvoid CenterAlert (short alertID)\r{\r        AlertTHndl      alertHandle;\r   Rect            theScreen, alertRect;\r  short           horiOff, vertOff;\r      Byte            wasState;\r      \r       theScreen = qd.screenBits.bounds;\r      theScreen.top += LMGetMBarHeight();\r    \r       alertHandle = (AlertTHndl)GetResource('ALRT', alertID);\r        if (alertHandle != nil)\r        {\r              wasState = HGetState((Handle)alertHandle);\r             HLock((Handle)alertHandle);\r            \r               alertRect = (**alertHandle).boundsRect;\r                OffsetRect(&alertRect, -alertRect.left, -alertRect.top);\r               \r               horiOff = ((theScreen.right - theScreen.left) - alertRect.right) / 2;   \r               vertOff = ((theScreen.bottom - theScreen.top) - alertRect.bottom) / 3;\r         \r               OffsetRect(&alertRect, horiOff, vertOff + LMGetMBarHeight());\r          \r               (**alertHandle).boundsRect = alertRect;\r                HSetState((Handle)alertHandle, wasState);\r      }\r}\r*/\r//--------------------------------------------------------------  ZoomOutDialogRect\r\r// Given a dialog, this function does the "zoom" animation to make theÉ\r// the dialog appear to expand from nothingness or zoom in at you.\r/*\rvoid ZoomOutDialogRect (short dialogID)\r{\r    #define         kSteps          16\r     #define         kZoomDelay      1\r      DialogTHndl     dlogHandle;\r    GrafPtr         wasPort, tempPort;\r     Rect            dlogBounds, zoomRect;\r  UInt32          dummyLong;\r     Byte            wasState;\r      short           wideStep, highStep, i;\r \r       GetPort(&wasPort);\r     \r       tempPort = (GrafPtr)NewPtrClear(sizeof(GrafPort));\r     OpenPort(tempPort);\r    \r       dlogHandle = (DialogTHndl)GetResource('DLOG', dialogID);\r       if (dlogHandle != nil)\r {\r              wasState = HGetState((Handle)dlogHandle);\r              HLock((Handle)dlogHandle);\r             dlogBounds = (**dlogHandle).boundsRect;\r                HSetState((Handle)dlogHandle, wasState);\r       }\r      \r       wideStep = ((dlogBounds.right - dlogBounds.left) / 2) / kSteps;\r        highStep = ((dlogBounds.bottom - dlogBounds.top) / 2) / kSteps;\r        \r       SetRect(&zoomRect, dlogBounds.left + (wideStep * kSteps), \r                     dlogBounds.top + (highStep * kSteps), \r                 dlogBounds.right - (wideStep * kSteps), \r                       dlogBounds.bottom - (highStep * kSteps));\r      GlobalToLocalRect(&zoomRect);\r  \r       PenPat(GetQDGlobalsGray(&dummyPattern));\r       PenMode(patXor);\r       \r       for (i = 0; i < kSteps; i++)\r   {\r              FrameRect(&zoomRect);\r          Delay(kZoomDelay, &dummyLong);\r         FrameRect(&zoomRect);\r          InsetRect(&zoomRect, -wideStep, -highStep);\r    }\r      \r       ClosePort(tempPort);\r   \r       SetPort((GrafPtr)wasPort);\r}\r*/\r//--------------------------------------------------------------  ZoomOutAlertRect\r\r// Like the above funciton but zooms out alerts instead of dialogs.\r/*\rvoid ZoomOutAlertRect (short alertID)\r{\r     #define         kSteps          16\r     #define         kZoomDelay      1\r      AlertTHndl      alertHandle;\r   GrafPtr         wasPort, tempPort;\r     Rect            alertBounds, zoomRect;\r UInt32          dummyLong;\r     Byte            wasState;\r      short           wideStep, highStep, i;\r \r       GetPort(&wasPort);\r     \r       tempPort = (GrafPtr)NewPtrClear(sizeof(GrafPort));\r     OpenPort(tempPort);\r    \r       alertHandle = (AlertTHndl)GetResource('ALRT', alertID);\r        if (alertHandle != nil)\r        {\r              wasState = HGetState((Handle)alertHandle);\r             HLock((Handle)alertHandle);\r            alertBounds = (**alertHandle).boundsRect;\r              HSetState((Handle)alertHandle, wasState);\r      }\r      \r       wideStep = ((alertBounds.right - alertBounds.left) / 2) / kSteps;\r      highStep = ((alertBounds.bottom - alertBounds.top) / 2) / kSteps;\r      \r       SetRect(&zoomRect, alertBounds.left + (wideStep * kSteps), \r                    alertBounds.top + (highStep * kSteps), \r                        alertBounds.right - (wideStep * kSteps), \r                      alertBounds.bottom - (highStep * kSteps));\r     GlobalToLocalRect(&zoomRect);\r  \r       PenPat(GetQDGlobalsGray(&dummyPattern));\r       PenMode(patXor);\r       \r       for (i = 0; i < kSteps; i++)\r   {\r              FrameRect(&zoomRect);\r          Delay(kZoomDelay, &dummyLong);\r         FrameRect(&zoomRect);\r          InsetRect(&zoomRect, -wideStep, -highStep);\r    }\r      \r       ClosePort(tempPort);\r   \r       SetPort((GrafPtr)wasPort);\r}\r*/\r\r//--------------------------------------------------------------  FlashDialogButton\r// Flashes the default dialog button (item = 1) so as to make it appearÉ\r// as though the user clicked on it.\r\rvoid FlashDialogButton (DialogPtr theDialog, short itemNumber)\r{\r   Rect            itemRect;\r      Handle          itemHandle;\r    UInt32          dummyLong;\r     short           itemType;\r      \r       GetDialogItem(theDialog, itemNumber, &itemType, &itemHandle, &itemRect);\r       HiliteControl((ControlHandle)itemHandle, kControlButtonPart);\r  Delay(8, &dummyLong);\r  HiliteControl((ControlHandle)itemHandle, 0);\r}\r\r//--------------------------------------------------------------  DrawDefaultButton\r// Draws a fat outline around the default item (item = 1).  This is theÉ\r// item that is selected if the user hits the Return key.\r\rvoid DrawDefaultButton (DialogPtr theDialog)\r{\r Rect            itemRect;\r      Handle          itemHandle;\r    short           itemType;\r      \r       GetDialogItem(theDialog, 1, &itemType, &itemHandle, &itemRect);\r        InsetRect(&itemRect, -4, -4);\r  PenSize(3, 3);\r FrameRoundRect(&itemRect, 16, 16);\r     PenNormal();\r}\r\r//--------------------------------------------------------------  GetDialogString\r// Returns a string from a specific dialog item.\r\rvoid GetDialogString (DialogPtr theDialog, short item, StringPtr theString)\r{\r      Rect            itemRect;\r      Handle          itemHandle;\r    short           itemType;\r      \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, &itemRect);\r     GetDialogItemText(itemHandle, theString);\r}\r\r//--------------------------------------------------------------  SetDialogString\r// Sets a specific string to a specific dialog item.\r\rvoid SetDialogString (DialogPtr theDialog, short item, StringPtr theString)\r{\r     Rect            itemRect;\r      Handle          itemHandle;\r    short           itemType;\r      \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, &itemRect);\r     SetDialogItemText(itemHandle, theString);\r}\r\r//--------------------------------------------------------------  GetDialogStringLen\r// Returns the length of a dialog item string (text).\r\rshort GetDialogStringLen (DialogPtr theDialog, short item)\r{\r  Rect            itemRect;\r      Str255          theString;\r     Handle          itemHandle;\r    short           itemType;\r      \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, &itemRect);\r     GetDialogItemText(itemHandle, theString);\r      return (theString[0]);\r}\r\r//--------------------------------------------------------------  GetDialogItemValue\r// Returns the value or "state" of a dialog item.  For checkboxes andÉ\r// radio buttons, this may be a 1 or 0.\r\rvoid GetDialogItemValue (DialogPtr theDialog, short item, short *theState)\r{\r    Rect            itemRect;\r      Handle          itemHandle;\r    short           itemType;\r      \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, &itemRect);\r     *theState = GetControlValue((ControlHandle)itemHandle);\r}\r\r//--------------------------------------------------------------  SetDialogItemValue\r// Sets a specific dialogf items value or state (can set or clearÉ\r// checkboxes, radio buttons, etc.).\r\rvoid SetDialogItemValue (DialogPtr theDialog, short item, short theState)\r{\r   Rect            itemRect;\r      Handle          itemHandle;\r    short           itemType;\r      \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, &itemRect);\r     SetControlValue((ControlHandle)itemHandle, theState);\r}\r\r//--------------------------------------------------------------  ToggleDialogItemValue\r// If item is a checkbox or radio button, its state is toggled.\r\rvoid ToggleDialogItemValue (DialogPtr theDialog, short item)\r{\r       Rect            itemRect;\r      Handle          itemHandle;\r    short           itemType, theState;\r    \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, &itemRect);\r     theState = GetControlValue((ControlHandle)itemHandle);\r if (theState == 0)\r             theState = 1;\r  else\r           theState = 0;\r  SetControlValue((ControlHandle)itemHandle, theState);\r}\r\r//--------------------------------------------------------------  SetDialogNumToStr\r// Function accepts an integer, converts it to a string and sets aÉ\r// dialog items text to this string.\r\rvoid SetDialogNumToStr (DialogPtr theDialog, short item, long theNumber)\r{\r      Str255          theString;\r     Rect            itemRect;\r      Handle          itemHandle;\r    short           itemType;\r      \r       NumToString(theNumber, theString);\r     GetDialogItem(theDialog, item, &itemType, &itemHandle, &itemRect);\r     SetDialogItemText(itemHandle, theString);\r}\r\r//--------------------------------------------------------------  GetDialogNumFromStr\r// Function extracts the text from a dialog item and converts it to anÉ\r// integer for returning.\r\rvoid GetDialogNumFromStr (DialogPtr theDialog, short item, long *theNumber)\r{\r    Str255          theString;\r     Rect            itemRect;\r      Handle          itemHandle;\r    short           itemType;\r      \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, &itemRect);\r     GetDialogItemText(itemHandle, theString);\r      StringToNum(theString, theNumber);\r}\r\r//--------------------------------------------------------------  GetDialogItemRect\r// Returns the bounding rectangle of the specified dialog item.\r\rvoid GetDialogItemRect (DialogPtr theDialog, short item, Rect *theRect)\r{\r   Handle          itemHandle;\r    short           itemType;\r      \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, theRect);\r}\r\r//--------------------------------------------------------------  SetDialogItemRect\r// Sets the bounding rectangle of the specified dialog item.  Used toÉ\r// resize or move a control.\r\rvoid SetDialogItemRect (DialogPtr theDialog, short item, Rect *theRect)\r{\r Rect            oldRect;\r       Handle          itemHandle;\r    short           itemType;\r      \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, &oldRect);\r      OffsetRect(&oldRect, theRect->left - oldRect.left, theRect->top - oldRect.top);\r        SetDialogItem(theDialog, item, itemType, itemHandle, &oldRect);\r}\r\r//--------------------------------------------------------------  OffsetDialogItemRect\r// Moves a dialog item by h and v.\r\rvoid OffsetDialogItemRect (DialogPtr theDialog, short item, short h, short v)\r{\r  Rect            oldRect;\r       Handle          itemHandle;\r    short           itemType;\r      \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, &oldRect);\r      OffsetRect(&oldRect, h, v);\r    SetDialogItem(theDialog, item, itemType, itemHandle, &oldRect);\r}\r\r//--------------------------------------------------------------  SelectFromRadioGroup\r// Assuming a series of consecutively numbered radio buttons, this functionÉ\r// clears the whole range of them but sets the one specified (as thoughÉ\r// the radio buttons are linked and only one can be set at a time).\r\rvoid SelectFromRadioGroup (DialogPtr dial, short which, short first, short last)\r{\r        Rect            iRect;\r Handle          iHandle;\r       short           iType, i;\r      \r       for (i = first; i <= last; i++)\r        {\r              GetDialogItem(dial, i, &iType, &iHandle, &iRect);\r              SetControlValue((ControlHandle)iHandle, (short)false);\r }\r      \r       GetDialogItem(dial, which, &iType, &iHandle, &iRect);\r  SetControlValue((ControlHandle)iHandle, (short)true);\r}\r\r//--------------------------------------------------------------  AddMenuToPopUp\r// Assigns a menu handle to a pop-up dialog item - thus, giving thatÉ\r// pop-up item something to pop up.\r/*\rvoid AddMenuToPopUp (DialogPtr theDialog, short whichItem, MenuHandle theMenu)\r{\r        Rect            iRect;\r Handle          iHandle;\r       short           iType;\r \r       GetDialogItem(theDialog, whichItem, &iType, &iHandle, &iRect);\r (**(ControlHandle)iHandle).contrlRfCon = (long)theMenu;\r}\r*/\r//--------------------------------------------------------------  GetPopUpMenuValu\r// Returns which item is currently selected in a pop-up menu.\r\rvoid GetPopUpMenuValue (DialogPtr theDialog, short whichItem, short *value)\r{\r   Rect            iRect;\r Handle          iHandle;\r       short           iType;\r \r       GetDialogItem(theDialog, whichItem, &iType, &iHandle, &iRect);\r *value = GetControlValue((ControlHandle)iHandle);\r}\r\r//--------------------------------------------------------------  SetPopUpMenuValue\r// Forces a specific item to be set (as though selected) in a pop-up menu.\r\rvoid SetPopUpMenuValue (DialogPtr theDialog, short whichItem, short value)\r{\r      Rect            iRect;\r Handle          iHandle;\r       short           iType;\r \r       GetDialogItem(theDialog, whichItem, &iType, &iHandle, &iRect);\r SetControlValue((ControlHandle)iHandle, value);\r}\r\r//--------------------------------------------------------------  MyEnableControl\r// "Un-grays" or enables a dialog item (usually a button).\r\rvoid MyEnableControl (DialogPtr theDialog, short whichItem)\r{\r Rect            iRect;\r Handle          iHandle;\r       short           iType;\r \r       GetDialogItem(theDialog, whichItem, &iType, &iHandle, &iRect);\r HiliteControl((ControlHandle)iHandle, kActive);\r}\r\r//--------------------------------------------------------------  MyDisableControl\r// "Grays out" or disables a dialog item (usually a button).\r\rvoid MyDisableControl (DialogPtr theDialog, short whichItem)\r{\r     Rect            iRect;\r Handle          iHandle;\r       short           iType;\r \r       GetDialogItem(theDialog, whichItem, &iType, &iHandle, &iRect);\r HiliteControl((ControlHandle)iHandle, kInactive);\r}\r\r//--------------------------------------------------------------  DrawDialogUserText\r// Given a string of text and an item, this function draws the stringÉ\r// within the bounding rect of the item.  Dialog item assumed to beÉ\r// a "user item" (invisible item with only bounds).\r\rvoid DrawDialogUserText (DialogPtr dial, short item, StringPtr text, Boolean invert)\r{\r      Rect            iRect;\r Handle          iHandle;\r       Str255          newString, stringCopy;\r short           iType, textLong, i, inset;\r     \r       TextFont(applFont);\r    TextSize(9);\r   \r       PasStringCopy(text, stringCopy);\r       GetDialogItem(dial, item, &iType, &iHandle, &iRect);\r   if ((StringWidth(stringCopy) + 2) > (iRect.right - iRect.left))\r                CollapseStringToWidth(stringCopy, iRect.right - iRect.left - 2);\r       textLong = stringCopy[0];\r      for (i = 0; i < textLong; i++)\r         newString[i] = stringCopy[i + 1];\r      \r       OffsetRect(&iRect, 0, 1);\r      EraseRect(&iRect);\r     OffsetRect(&iRect, 0, -1);\r     \r       inset = ((iRect.right - iRect.left) - (StringWidth(stringCopy) + 2)) / 2;\r      iRect.left += inset;\r   iRect.right -= inset;\r  \r       TETextBox(newString, textLong, &iRect, teCenter);\r      if (invert)\r    {\r              OffsetRect(&iRect, 0, 1);\r              InvertRect(&iRect);\r    }\r}\r\r//--------------------------------------------------------------  DrawDialogUserText\r// Similar to the above function but doesn't call TETextBox().  Instead,É\r// it truncates the string (and appends "É") to the end in order thatÉ\r// the string fits within the dialog item's bounds.\r\rvoid DrawDialogUserText2 (DialogPtr dial, short item, StringPtr text)\r{\r        Rect            iRect;\r Handle          iHandle;\r       Str255          stringCopy;\r    short           iType;\r \r       TextFont(applFont);\r    TextSize(9);\r   \r       PasStringCopy(text, stringCopy);\r       GetDialogItem(dial, item, &iType, &iHandle, &iRect);\r   if ((StringWidth(stringCopy) + 2) > (iRect.right - iRect.left))\r                CollapseStringToWidth(stringCopy, iRect.right - iRect.left - 2);\r       MoveTo(iRect.left, iRect.bottom);\r      DrawString(stringCopy);\r}\r\r//--------------------------------------------------------------  LoadDialogPICT\r// Draws a 'PICT' specified by ID within the bounds of the specifiedÉ\r// dialog item.\r\rvoid LoadDialogPICT (DialogPtr theDialog, short item, short theID)\r{\r        Rect            iRect;\r Handle          iHandle;\r       PicHandle       thePict;\r       short           iType;\r \r       GetDialogItem(theDialog, item, &iType, &iHandle, &iRect);\r      thePict = GetPicture(theID);\r   if (thePict)\r           DrawPicture(thePict, &iRect);\r}\r\r//--------------------------------------------------------------  FrameDialogItem\r// Given a dialog item, this function draws a box around it.\r\rvoid FrameDialogItem (DialogPtr theDialog, short item)\r{\r      Rect            itemRect;\r      Handle          itemHandle;\r    short           itemType;\r      \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, &itemRect);\r     FrameRect(&itemRect);\r}\r\r//--------------------------------------------------------------  FrameDialogItemC\r// Given a dialog item, this function draws a color (specified) box around it.\r\rvoid FrameDialogItemC (DialogPtr theDialog, short item, long color)\r{\r      RGBColor        theRGBColor, wasColor;\r Rect            itemRect;\r      Handle          itemHandle;\r    short           itemType;\r      \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, &itemRect);\r     GetForeColor(&wasColor);\r       Index2Color(color, &theRGBColor);\r      RGBForeColor(&theRGBColor);\r    FrameRect(&itemRect);\r  RGBForeColor(&wasColor);\r}\r\r//--------------------------------------------------------------  FrameOvalDialogItem\r// Given a dialog item, this function draws an oval around it.\r\rvoid FrameOvalDialogItem (DialogPtr theDialog, short item)\r{\r Rect            itemRect;\r      Handle          itemHandle;\r    short           itemType;\r      \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, &itemRect);\r     FrameOval(&itemRect);\r}\r\r//--------------------------------------------------------------  BorderDialogItem\r// Given a dialog item, this function draws any combination of 4 sidesÉ\r// of a box around it.  Which sides get drawn is encoded in "sides".\r\rvoid BorderDialogItem (DialogPtr theDialog, short item, short sides)\r{\r       Rect            itemRect;\r      Handle          itemHandle;\r    short           itemType;\r      \r       // 1 = left\r    // 2 = top\r     // 4 = bottom\r  // 8 = right ... so 6 = top & bottom, 15 = all 4 sides\r \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, &itemRect);\r     \r       if (sides >= 8)                         // 8 = right\r   {\r              MoveTo(itemRect.right, itemRect.top);\r          LineTo(itemRect.right, itemRect.bottom);\r               sides -= 8;\r    }\r      if (sides >= 4)                         // 4 = bottom\r  {\r              MoveTo(itemRect.left, itemRect.bottom);\r                LineTo(itemRect.right, itemRect.bottom);\r               sides -= 4;\r    }\r      if (sides >= 2)                         // 2 = top\r     {\r              MoveTo(itemRect.left, itemRect.top - 1);\r               LineTo(itemRect.right, itemRect.top - 1);\r              sides -= 2;\r    }\r      if (sides >= 1)                         // 1 = left\r    {\r              MoveTo(itemRect.left - 1, itemRect.top);\r               LineTo(itemRect.left - 1, itemRect.bottom);\r    }\r}\r\r//--------------------------------------------------------------  ShadowDialogItem\r// Draws a drop shadow to the right and below a specified dialog item.\r\rvoid ShadowDialogItem (DialogPtr theDialog, short item, short thickness)\r{\r     Rect            itemRect;\r      Handle          itemHandle;\r    short           itemType;\r      \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, &itemRect);\r     PenSize(thickness, thickness);\r MoveTo(itemRect.left + thickness, itemRect.bottom);\r    Line(itemRect.right - itemRect.left - thickness, 0);\r   MoveTo(itemRect.right, itemRect.top + thickness);\r      Line(0, itemRect.bottom - itemRect.top - thickness);\r   PenNormal();\r}\r\r//--------------------------------------------------------------  EraseDialogItem\r// Erases (but doesn't physically remove) a dialog item.\r\rvoid EraseDialogItem (DialogPtr theDialog, short item)\r{\r   Rect            itemRect;\r      Handle          itemHandle;\r    short           itemType;\r      \r       GetDialogItem(theDialog, item, &itemType, &itemHandle, &itemRect);\r     EraseRect(&itemRect);\r}\r\r
\ No newline at end of file
diff --git a/Sources/DynamicMaps.c b/Sources/DynamicMaps.c
new file mode 100755 (executable)
index 0000000..390cf49
--- /dev/null
@@ -0,0 +1 @@
+//============================================================================\r//----------------------------------------------------------------------------\r//                                                                 DynamicMaps.c\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include "Externs.h"\r#include "Environ.h"\r#include "MainWindow.h"\r#include "Objects.h"\r#include "RectUtils.h"\r#include "Room.h"\r#include "Utilities.h"\r\r\rvoid BackUpFlames (Rect *, short);\rvoid BackUpTikiFlames (Rect *, short);\rvoid BackUpBBQCoals (Rect *, short);\rvoid BackUpPendulum (Rect *, short);\rvoid BackUpStar (Rect *, short);\r\r\rsparklePtr      sparkles;\rflyingPtPtr   flyingPoints;\rflamePtr  flames, tikiFlames, bbqCoals;\rpendulumPtr       pendulums;\rstarPtr              theStars;\rshredPtr      shreds;\rRect            pointsSrc[15];\rshort            numSparkles, numFlyingPts, numChimes;\rshort             numFlames, numSavedMaps, numTikiFlames, numCoals;\rshort         numPendulums, clockFrame, numStars, numShredded;\r\r\rextern       savedType       savedMaps[];\rextern     Rect            flame[], tikiFlame[], coals[], pendulumSrc[];\rextern    Rect            starSrc[];\rextern       short           numGrease, numDynamics;\r\r\r//==============================================================  Functions\r//--------------------------------------------------------------  NilSavedMaps\r// Deletes array of "dyanmics" offscreen pixmaps.\r\rvoid NilSavedMaps (void)\r{\r     short           i;\r     \r       for (i = 0; i < kMaxSavedMaps; i++)\r    {\r              if (savedMaps[i].map != nil)\r           {\r                      DisposeGWorld(savedMaps[i].map);\r//                     KillOffScreenPixMap(savedMaps[i].map);\r                 savedMaps[i].map = nil;\r                }\r              savedMaps[i].where = -1;\r               savedMaps[i].who = -1;\r }\r      numSavedMaps = 0;\r}\r\r//--------------------------------------------------------------  BackUpToSavedMap\r// Saves a copy of the room behind an object to an array of pixmaps.\r// Then when the object in question is drawn, there is a copy of theÉ\r// room that it obscured so that, should the player get the object,É\r// it can be made to "disappear".\r\rshort BackUpToSavedMap (Rect *theRect, short where, short who)\r{\r    Rect            mapRect;\r       OSErr           theErr;\r        \r       if (numSavedMaps >= kMaxSavedMaps)\r             return(-1);\r    \r       mapRect = *theRect;\r    ZeroRectCorner(&mapRect);\r      savedMaps[numSavedMaps].dest = *theRect;\r//     CreateOffScreenPixMap(&mapRect, &savedMaps[numSavedMaps].map);\r theErr = CreateOffScreenGWorld(&savedMaps[numSavedMaps].map, &mapRect, kPreferredDepth);\r       \r       CopyBits((BitMap *)*GetGWorldPixMap(backSrcMap), \r                      GetPortBitMapForCopyBits(savedMaps[numSavedMaps].map), \r                        theRect, &mapRect, srcCopy, nil);\r      \r       savedMaps[numSavedMaps].where = where;\r savedMaps[numSavedMaps].who = who;\r     numSavedMaps++;\r        \r       return (numSavedMaps - 1);      // return array index\r}\r\r//--------------------------------------------------------------  ReBackUpSavedMap\r// This function is similar to the above, but assumes there is alreadyÉ\r// a slot in the pixmap array for the object.  It re-copies the backgroundÉ\r// and is needed when the lights in the room go on or off.\r\rshort ReBackUpSavedMap (Rect *theRect, short where, short who)\r{\r   Rect            mapRect;\r       short           i, foundIndex;\r \r       foundIndex = -1;\r       \r       for (i = 0; i < numSavedMaps; i++)\r     {\r              if ((savedMaps[i].where == where) && (savedMaps[i].who == who))\r                {\r                      foundIndex = i;\r                        mapRect = *theRect;\r                    ZeroRectCorner(&mapRect);\r                      \r                       CopyBits((BitMap *)*GetGWorldPixMap(backSrcMap), \r                                      GetPortBitMapForCopyBits(savedMaps[foundIndex].map), \r                                  theRect, &mapRect, srcCopy, nil);\r                      \r                       return (foundIndex);\r           }\r      }\r      \r       return (foundIndex);\r}\r\r//--------------------------------------------------------------  RestoreFromSavedMap\r\r// This copies the saved background swatch to the screen - effectivelyÉ\r// covering up or "erasing" the object.\r\rvoid RestoreFromSavedMap (short where, short who, Boolean doSparkle)\r{\r Rect            mapRect, bounds;\r       short           i;\r     \r       for (i = 0; i < numSavedMaps; i++)\r     {\r              if ((savedMaps[i].where == where) && (savedMaps[i].who == who) && \r                             (savedMaps[i].map != nil))\r             {\r                      mapRect = savedMaps[i].dest;\r                   ZeroRectCorner(&mapRect);\r                      \r                       CopyBits(GetPortBitMapForCopyBits(savedMaps[i].map), \r                                  (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                       &mapRect, &savedMaps[i].dest, srcCopy, nil);\r                   CopyBits(GetPortBitMapForCopyBits(savedMaps[i].map), \r                                  (BitMap *)*GetGWorldPixMap(workSrcMap), \r                                       &mapRect, &savedMaps[i].dest, srcCopy, nil);\r                   \r                       AddRectToWorkRects(&savedMaps[i].dest);\r                        \r                       if (doSparkle)\r                 {\r                              bounds = savedMaps[i].dest;\r                            QOffsetRect(&bounds, -playOriginH, -playOriginV);\r                              AddSparkle(&bounds);\r                           PlayPrioritySound(kFadeOutSound, kFadeOutPriority);\r                    }\r                      break;\r         }\r      }\r}\r\r//--------------------------------------------------------------  AddSparkle\r\r// This adds a "sparkle" object to the fixed array of sparkles.\r\rvoid AddSparkle (Rect *theRect)\r{\r  Rect            centeredRect;\r  short           i;\r     \r       if (numSparkles < kMaxSparkles)\r        {\r              theRect->left += playOriginH;\r          theRect->right += playOriginH;\r         theRect->top += playOriginV;\r           theRect->bottom += playOriginV;\r                \r               centeredRect = sparkleSrc[0];\r          CenterRectInRect(&centeredRect, theRect);\r              \r               for (i = 0; i < kMaxSparkles; i++)\r                     if (sparkles[i].mode == -1)\r                    {\r                              sparkles[i].bounds = centeredRect;\r                             sparkles[i].mode = 0;\r                          numSparkles++;\r                         break;\r                 }\r      }\r}\r\r//--------------------------------------------------------------  AddFlyingPoint\r\r// This adds a "flying point" object to the array of flying points.\r\rvoid AddFlyingPoint (Rect *theRect, short points, short hVel, short vVel)\r{\r        Rect            centeredRect;\r  short           i;\r     \r       if (numFlyingPts < kMaxFlyingPts)\r      {\r              theRect->left += playOriginH;\r          theRect->right += playOriginH;\r         theRect->top += playOriginV;\r           theRect->bottom += playOriginV;\r                \r               centeredRect = pointsSrc[0];\r           CenterRectInRect(&centeredRect, theRect);\r              \r               for (i = 0; i < kMaxFlyingPts; i++)\r                    if (flyingPoints[i].mode == -1)\r                        {\r                              flyingPoints[i].dest = centeredRect;\r                           flyingPoints[i].whole = centeredRect;\r                          flyingPoints[i].loops = 0;\r                             flyingPoints[i].hVel = hVel;\r                           flyingPoints[i].vVel = vVel;\r                           switch (points)\r                                {\r                                      case 100:\r                                      flyingPoints[i].start = 12;\r                                    flyingPoints[i].stop = 14;\r                                     break;\r                                 \r                                       case 250:\r                                      flyingPoints[i].start = 9;\r                                     flyingPoints[i].stop = 11;\r                                     break;\r                                 \r                                       case 300:\r                                      flyingPoints[i].start = 6;\r                                     flyingPoints[i].stop = 8;\r                                      break;\r                                 \r                                       case 500:\r                                      flyingPoints[i].start = 3;\r                                     flyingPoints[i].stop = 5;\r                                      break;\r                                 \r                                       default:\r                                       flyingPoints[i].start = 0;\r                                     flyingPoints[i].stop = 2;\r                                      break;\r                         }\r                              flyingPoints[i].mode = flyingPoints[i].start;\r                          numFlyingPts++;\r                                break;\r                 }\r      }\r}\r\r//--------------------------------------------------------------  BackUpFlames\r\r// This makes copies of the area of the room behind a flame.  The flameÉ\r// graphic can be "copy masked" to this pixmap then and then simpleÉ\r// CopyBits() calls will properly draw the flame on screen with theÉ\r// proper background.\r\rvoid BackUpFlames (Rect *src, short index)\r{\r    Rect            dest;\r  short           i;\r     \r       QSetRect(&dest, 0, 0, 16, 15);\r for (i = 0; i < kNumCandleFlames; i++)\r {\r                              // Copy background to map.\r             CopyBits((BitMap *)*GetGWorldPixMap(backSrcMap), \r                              GetPortBitMapForCopyBits(savedMaps[index].map), \r                               src, &dest, srcCopy, nil);\r             \r                               // Copy flame to map.\r          CopyMask((BitMap *)*GetGWorldPixMap(blowerSrcMap), \r                            (BitMap *)*GetGWorldPixMap(blowerMaskMap), \r                            GetPortBitMapForCopyBits(savedMaps[index].map), \r                               &flame[i], &flame[i], &dest);\r          \r               \r               QOffsetRect(&dest, 0, 15);\r     }\r}\r\r//--------------------------------------------------------------  ReBackUpFlames\r\r// Like the above function but this is called when the lighting changesÉ\r// in a room (lights go on or off).\r\rvoid ReBackUpFlames (short where, short who)\r{\r    short           i, f;\r  \r       for (i = 0; i < numSavedMaps; i++)\r     {\r              if ((savedMaps[i].where == where) && (savedMaps[i].who == who))\r                {\r                      for (f = 0; f < numFlames; f++)\r                        {\r                              if (flames[f].who == i)\r                                {\r                                      BackUpFlames(&flames[f].dest, i);\r                                      return;\r                                }\r                      }\r              }\r      }\r}\r\r//--------------------------------------------------------------  AddCandleFlame\r\r// This adds a candle flame to tha array of flames.\r\rvoid AddCandleFlame (short where, short who, short h, short v)\r{\r   Rect            src, bounds;\r   short           savedNum;\r      \r       if ((numFlames >= kMaxCandles) || (h < 16) || (v < 15))\r                return;\r        \r       QSetRect(&src, 0, 0, 16, 15);\r  QOffsetRect(&src, h - 8, v - 15);\r      if ((thisMac.isDepth == 4) && ((src.left % 2) == 1))\r   {\r              QOffsetRect(&src, -1, 0);\r              if (src.left < 0)\r                      QOffsetRect(&src, 2, 0);\r       }\r      QSetRect(&bounds, 0, 0, 16, 15 * kNumCandleFlames);\r    savedNum = BackUpToSavedMap(&bounds, where, who);\r      if (savedNum != -1)\r    {\r              BackUpFlames(&src, savedNum);\r          flames[numFlames].dest = src;\r          flames[numFlames].mode = RandomInt(kNumCandleFlames);\r          QSetRect(&flames[numFlames].src, 0, 0, 16, 15);\r                QOffsetRect(&flames[numFlames].src, 0, flames[numFlames].mode * 15);\r           flames[numFlames].who = savedNum;\r              numFlames++;\r   }\r}\r\r//--------------------------------------------------------------  BackUpTikiFlames\r// This is like the function BackUpFlames() but customized for Tiki torches.\r\rvoid BackUpTikiFlames (Rect *src, short index)\r{\r Rect            dest;\r  short           i;\r     \r       QSetRect(&dest, 0, 0, 8, 10);\r  for (i = 0; i < kNumTikiFlames; i++)\r   {\r                              // copy background to map\r              CopyBits((BitMap *)*GetGWorldPixMap(backSrcMap), \r                              GetPortBitMapForCopyBits(savedMaps[index].map), \r                               src, &dest, srcCopy, nil);\r             \r                               // copy flame to map\r           CopyMask((BitMap *)*GetGWorldPixMap(blowerSrcMap), \r                            (BitMap *)*GetGWorldPixMap(blowerMaskMap), \r                            GetPortBitMapForCopyBits(savedMaps[index].map), \r                               &tikiFlame[i], &tikiFlame[i], &dest);\r          \r               QOffsetRect(&dest, 0, 10);\r     }\r}\r\r//--------------------------------------------------------------  ReBackUpTikiFlames\r\r// This is like the function ReBackUpFlames() but customized for Tiki torches.\r\rvoid ReBackUpTikiFlames (short where, short who)\r{\r  short           i, f;\r  \r       for (i = 0; i < numSavedMaps; i++)\r     {\r              if ((savedMaps[i].where == where) && (savedMaps[i].who == who))\r                {\r                      for (f = 0; f < numTikiFlames; f++)\r                    {\r                              if (tikiFlames[f].who == i)\r                            {\r                                      BackUpTikiFlames(&tikiFlames[f].dest, i);\r                                      return;\r                                }\r                      }\r              }\r      }\r}\r\r//--------------------------------------------------------------  AddTikiFlame\r\r// This adds a tiki flame to the array of tiki flames.\r\rvoid AddTikiFlame (short where, short who, short h, short v)\r{\r    Rect            src, bounds;\r   short           savedNum;\r      \r       if ((numTikiFlames >= kMaxTikis) || (h < 8) || (v < 10))\r               return;\r        \r       QSetRect(&src, 0, 0, 8, 10);\r   if ((thisMac.isDepth == 4) && ((h % 2) == 1))\r  {\r              h--;\r           if (h < 0)\r                     h += 2;\r        }\r      QOffsetRect(&src, h, v);\r       QSetRect(&bounds, 0, 0, 8, 10 * kNumTikiFlames);\r       savedNum = BackUpToSavedMap(&bounds, where, who);\r      if (savedNum != -1)\r    {\r              BackUpTikiFlames(&src, savedNum);\r              tikiFlames[numTikiFlames].dest = src;\r          tikiFlames[numTikiFlames].mode = RandomInt(kNumTikiFlames);\r            QSetRect(&tikiFlames[numTikiFlames].src, 0, 0, 8, 10);\r         QOffsetRect(&tikiFlames[numTikiFlames].src, 0, \r                                tikiFlames[numTikiFlames].mode * 10);\r          tikiFlames[numTikiFlames].who = savedNum;\r              numTikiFlames++;\r       }\r}\r\r//--------------------------------------------------------------  BackUpBBQCoals\r\r// Another one - but for BBQ coals.\r\rvoid BackUpBBQCoals (Rect *src, short index)\r{\r     Rect            dest;\r  short           i;\r     \r       QSetRect(&dest, 0, 0, 32, 9);\r  for (i = 0; i < kNumBBQCoals; i++)\r     {\r                              // copy background to map\r              CopyBits((BitMap *)*GetGWorldPixMap(backSrcMap), \r                              GetPortBitMapForCopyBits(savedMaps[index].map), \r                               src, &dest, srcCopy, nil);\r             \r                               // copy flame to map\r           CopyMask((BitMap *)*GetGWorldPixMap(blowerSrcMap), \r                            (BitMap *)*GetGWorldPixMap(blowerMaskMap), \r                            GetPortBitMapForCopyBits(savedMaps[index].map), \r                               &coals[i], &coals[i], &dest);\r          \r               QOffsetRect(&dest, 0, 9);\r      }\r}\r\r//--------------------------------------------------------------  ReBackUpBBQCoals\r\r// Sense a pattern here?\r\rvoid ReBackUpBBQCoals (short where, short who)\r{\r    short           i, f;\r  \r       for (i = 0; i < numSavedMaps; i++)\r     {\r              if ((savedMaps[i].where == where) && (savedMaps[i].who == who))\r                {\r                      for (f = 0; f < numCoals; f++)\r                 {\r                              if (bbqCoals[f].who == i)\r                              {\r                                      BackUpBBQCoals(&bbqCoals[f].dest, i);\r                                  return;\r                                }\r                      }\r              }\r      }\r}\r\r//--------------------------------------------------------------  AddBBQCoals\r\r// Adds BBQ coals to the array of BBQ coals.\r\rvoid AddBBQCoals (short where, short who, short h, short v)\r{\r        Rect            src, bounds;\r   short           savedNum;\r      \r       if ((numCoals >= kMaxCoals) || (h < 32) || (v < 9))\r            return;\r        \r       QSetRect(&src, 0, 0, 32, 9);\r   if ((thisMac.isDepth == 4) && ((h % 2) == 1))\r  {\r              h--;\r           if (h < 0)\r                     h += 2;\r        }\r      QOffsetRect(&src, h, v);\r       QSetRect(&bounds, 0, 0, 32, 9 * kNumBBQCoals);\r savedNum = BackUpToSavedMap(&bounds, where, who);\r      if (savedNum != -1)\r    {\r              BackUpBBQCoals(&src, savedNum);\r                bbqCoals[numCoals].dest = src;\r         bbqCoals[numCoals].mode = RandomInt(kNumBBQCoals);\r             QSetRect(&bbqCoals[numCoals].src, 0, 0, 32, 9);\r                QOffsetRect(&bbqCoals[numCoals].src, 0, bbqCoals[numCoals].mode * 9);\r          bbqCoals[numCoals].who = savedNum;\r             \r               numCoals++;\r    }\r}\r\r//--------------------------------------------------------------  BackUpPendulum\r// Just like many of the previous functions, but for the pendulum on theÉ\r// cuckoo clock.\r\rvoid BackUpPendulum (Rect *src, short index)\r{\r       Rect            dest;\r  short           i;\r     \r       QSetRect(&dest, 0, 0, 32, 28);\r for (i = 0; i < kNumPendulums; i++)\r    {\r              CopyBits((BitMap *)*GetGWorldPixMap(backSrcMap), \r                              GetPortBitMapForCopyBits(savedMaps[index].map), \r                               src, &dest, srcCopy, nil);\r             \r               CopyMask((BitMap *)*GetGWorldPixMap(bonusSrcMap), \r                             (BitMap *)*GetGWorldPixMap(bonusMaskMap), \r                             GetPortBitMapForCopyBits(savedMaps[index].map), \r                               &pendulumSrc[i], &pendulumSrc[i], &dest);\r              \r               QOffsetRect(&dest, 0, 28);\r     }\r}\r\r//--------------------------------------------------------------  ReBackUpPendulum\r\r// Backs up the pendulums in the event of lights going on or off.\r\rvoid ReBackUpPendulum (short where, short who)\r{\r   short           i, f;\r  \r       for (i = 0; i < numSavedMaps; i++)\r     {\r              if ((savedMaps[i].where == where) && (savedMaps[i].who == who))\r                {\r                      for (f = 0; f < numPendulums; f++)\r                     {\r                              if (pendulums[f].who == i)\r                             {\r                                      BackUpPendulum(&pendulums[f].dest, i);\r                                 return;\r                                }\r                      }\r              }\r      }\r}\r\r//--------------------------------------------------------------  AddPendulum\r\r// Adds a pendulum to the array of pendulums.\r\rvoid AddPendulum (short where, short who, short h, short v)\r{\r       Rect            src, bounds;\r   short           savedNum;\r      \r       if ((numPendulums >= kMaxPendulums) || (h < 32) || (v < 28))\r           return;\r        \r       clockFrame = 10;\r       QSetRect(&bounds, 0, 0, 32, 28 * kNumPendulums);\r       savedNum = BackUpToSavedMap(&bounds, where, who);\r      if (savedNum != -1)\r    {\r              QSetRect(&src, 0, 0, 32, 28);\r          if ((thisMac.isDepth == 4) && ((h % 2) == 1))\r          {\r                      h--;\r                   if (h < 0)\r                             h += 2;\r                }\r              QOffsetRect(&src, h, v);\r               BackUpPendulum (&src, savedNum);\r               pendulums[numPendulums].dest = src;\r            pendulums[numPendulums].mode = 1;\r              if (RandomInt(2) == 0)\r                 pendulums[numPendulums].toOrFro = true;\r                else\r                   pendulums[numPendulums].toOrFro = false;\r               pendulums[numPendulums].active = true;\r         QSetRect(&pendulums[numPendulums].src, 0, 0, 32, 28);\r          QOffsetRect(&pendulums[numPendulums].src, 0, 28);\r              pendulums[numPendulums].who = savedNum;\r                pendulums[numPendulums].where = where;\r         pendulums[numPendulums].link = who;\r            numPendulums++;\r        }\r}\r\r//--------------------------------------------------------------  BackUpStar\r\r// Makes a copy of background beneath a star.\r\rvoid BackUpStar (Rect *src, short index)\r{\r   Rect            dest;\r  short           i;\r     \r       QSetRect(&dest, 0, 0, 32, 31);\r for (i = 0; i < 6; i++)\r        {\r              CopyBits((BitMap *)*GetGWorldPixMap(backSrcMap), \r                              GetPortBitMapForCopyBits(savedMaps[index].map), \r                               src, &dest, srcCopy, nil);\r             \r                               // copy flame to map\r           CopyMask((BitMap *)*GetGWorldPixMap(bonusSrcMap), \r                             (BitMap *)*GetGWorldPixMap(bonusMaskMap), \r                             GetPortBitMapForCopyBits(savedMaps[index].map), \r                               &starSrc[i], &starSrc[i], &dest);\r              \r               QOffsetRect(&dest, 0, 31);\r     }\r}\r\r//--------------------------------------------------------------  ReBackUpStar\r\r// Re-backs up the stars - in the event of lighting switch.\r\rvoid ReBackUpStar (short where, short who)\r{\r short           i, f;\r  \r       for (i = 0; i < numSavedMaps; i++)\r     {\r              if ((savedMaps[i].where == where) && (savedMaps[i].who == who))\r                {\r                      for (f = 0; f < numStars; f++)\r                 {\r                              if (theStars[f].who == i)\r                              {\r                                      BackUpStar(&theStars[f].dest, i);\r                                      return;\r                                }\r                      }\r              }\r      }\r}\r\r//--------------------------------------------------------------  AddStar\r\r// Adds a star to the star array.\r\rvoid AddStar (short where, short who, short h, short v)\r{\r   Rect            src, bounds;\r   short           savedNum;\r      \r       if (numStars >= kMaxStars)\r             return;\r        \r       QSetRect(&src, 0, 0, 32, 31);\r  if ((thisMac.isDepth == 4) && ((h % 2) == 1))\r  {\r              h--;\r           if (h < 0)\r                     h += 2;\r        }\r      QOffsetRect(&src, h, v);\r       \r       QSetRect(&bounds, 0, 0, 32, 31 * 6);\r   savedNum = BackUpToSavedMap(&bounds, where, who);\r      if (savedNum != -1)\r    {\r              BackUpStar(&src, savedNum);\r            theStars[numStars].dest = src;\r         theStars[numStars].mode = RandomInt(6);\r                QSetRect(&theStars[numStars].src, 0, 0, 32, 31);\r               QOffsetRect(&theStars[numStars].src, 0, theStars[numStars].mode * 31);\r         theStars[numStars].who = savedNum;\r             theStars[numStars].link = who;\r         theStars[numStars].where = where;\r              \r               numStars++;\r    }\r}\r\r//--------------------------------------------------------------  StopPendulum\r\r// Will set a flag to kill a pendulum.\r\rvoid StopPendulum (short where, short who)\r{\r      short           i;\r     \r       for (i = 0; i < numPendulums; i++)\r     {\r              if ((pendulums[i].link == who) && (pendulums[i].where == where))\r                       pendulums[i].active = false;\r   }\r}\r\r//--------------------------------------------------------------  StopStar\r\r// Will set a flag to kill a star.\r\rvoid StopStar (short where, short who)\r{\r  short           i;\r     \r       for (i = 0; i < numStars; i++)\r {\r              if ((theStars[i].link == who) && (theStars[i].where == where))\r                 theStars[i].mode = -1;\r }\r}\r\r//--------------------------------------------------------------  AddAShreddedGlider\r\r// Adds a shredded glider.\r\rvoid AddAShreddedGlider (Rect *bounds)\r{\r        if (numShredded > kMaxShredded)\r                return;\r        \r       shreds[numShredded].bounds.left = bounds->left + 4;\r    shreds[numShredded].bounds.right = shreds[numShredded].bounds.left + 40;\r       shreds[numShredded].bounds.top = bounds->top + 14;\r     shreds[numShredded].bounds.bottom = shreds[numShredded].bounds.top;\r    shreds[numShredded].frame = 0;\r \r       numShredded++;\r}\r\r//--------------------------------------------------------------  RemoveShreds\r\r// Remves the shredded glider.\r\rvoid RemoveShreds (void)\r{\r   short           largest, who, i;\r       \r       largest = 0;\r   who = -1;\r      for (i = 0; i < numShredded; i++)\r      {\r              if (shreds[i].frame > largest)\r         {\r                      largest = shreds[i].frame;\r                     who = i;\r               }\r      }\r      \r       if (who != -1)\r {\r              if (who == (numShredded - 1))\r          {\r                      numShredded--;\r                 shreds[who].frame = 0;\r         }\r              else\r           {\r                      numShredded--;\r                 shreds[who].bounds = shreds[numShredded].bounds;\r                       shreds[who].frame = shreds[numShredded].frame;\r                 shreds[numShredded].frame = 0;\r         }\r      }\r}\r\r//--------------------------------------------------------------  ZeroFlamesAndTheLike\r\r// Zeroes all counters that indicate the number of flames, pendulums, etc thereÉ\r// are in a room.  Called before a room is drawn.  As the room is drawn, theÉ\r// above functions are called and the counters incremented as objects of theÉ\r// specified types are drawn.\r\rvoid ZeroFlamesAndTheLike (void)\r{\r    numFlames = 0;\r numTikiFlames = 0;\r     numCoals = 0;\r  numPendulums = 0;\r      numGrease = 0;\r numStars = 0;\r  numShredded = 0;\r       numChimes = 0;\r}\r\r
\ No newline at end of file
diff --git a/Sources/Dynamics.c b/Sources/Dynamics.c
new file mode 100755 (executable)
index 0000000..37ed103
--- /dev/null
@@ -0,0 +1 @@
+\r//============================================================================\r//----------------------------------------------------------------------------\r//                                                                 Dynamics.c\r//----------------------------------------------------------------------------\r//============================================================================\r\r\r#include "Externs.h"\r#include "Environ.h"\r#include "MainWindow.h"\r#include "Objects.h"\r#include "RectUtils.h"\r#include "Room.h"\r\r\r#define kShoveVelocity          8\r\r\rRect                breadSrc[kNumBreadPicts];\r\rextern       dynaPtr         dinahs;\rextern  bandPtr         bands;\rextern   short           numBands, tvWithMovieNumber;\rextern     Boolean         evenFrame, twoPlayerGame, onePlayerLeft, playerDead;\r\r\r//==============================================================  Functions\r//--------------------------------------------------------------  CheckDynamicCollision\r\r// Checks for a collision betwen the glider and one of the dynamic objects.\r// For example, did the glider hit a flying piece of toast?\r\rvoid CheckDynamicCollision (short who, gliderPtr thisGlider, Boolean doOffset)\r{\r  Rect            dinahRect;\r     \r       dinahRect = dinahs[who].dest;\r  if (doOffset)\r          QOffsetRect(&dinahRect, -playOriginH, -playOriginV);\r   \r       if (SectGlider(thisGlider, &dinahRect, true))\r  {\r              if ((thisGlider->mode == kGliderNormal) || \r                            (thisGlider->mode == kGliderFaceLeft) || \r                              (thisGlider->mode == kGliderFaceRight) || \r                             (thisGlider->mode == kGliderBurning) || \r                               (thisGlider->mode == kGliderGoingFoil) || \r                             (thisGlider->mode == kGliderLosingFoil))\r               {\r                      if ((foilTotal > 0) || (thisGlider->mode == kGliderLosingFoil))\r                        {\r                              if (IsRectLeftOfRect(&dinahRect, &thisGlider->dest))\r                                   thisGlider->hDesiredVel = kShoveVelocity;\r                              else\r                                   thisGlider->hDesiredVel = -kShoveVelocity;\r                             if (dinahs[who].vVel < 0)\r                                      thisGlider->vDesiredVel = dinahs[who].vVel;\r                            PlayPrioritySound(kFoilHitSound, kFoilHitPriority);\r                            if ((evenFrame) && (foilTotal > 0))\r                            {\r                                      foilTotal--;\r                                   if (foilTotal <= 0)\r                                            StartGliderFoilLosing(thisGlider);\r                             }\r                      }\r                      else\r                   {\r                              StartGliderFadingOut(thisGlider);\r                              PlayPrioritySound(kFadeOutSound, kFadeOutPriority);\r                    }\r              }\r      }\r}\r\r//--------------------------------------------------------------  DidBandHitDynamic\r\r// Checks to see if a rubber band struck a dynamic.\r\rBoolean DidBandHitDynamic (short who)\r{\r Rect            dinahRect;\r     short           i;\r     Boolean         collided;\r      \r       dinahRect = dinahs[who].dest;\r  \r       for (i = 0; i < numBands; i++)\r {\r              if (bands[i].dest.bottom < dinahRect.top)\r                      collided = false;\r              else if (bands[i].dest.top > dinahRect.bottom)\r                 collided = false;\r              else if (bands[i].dest.right < dinahRect.left)\r                 collided = false;\r              else if (bands[i].dest.left > dinahRect.right)\r                 collided = false;\r              else\r                   collided = true;\r               \r               if (collided)\r                  break;\r }\r      \r       return (collided);\r}\r\r//--------------------------------------------------------------  RenderToast\r\r// The following handful of functions handle drawing specific "dynamic" objecsts.\r\rvoid RenderToast (short who)\r{\r Rect            src, dest;\r     short           vClip;\r \r       if (dinahs[who].moving)\r        {\r              dest = dinahs[who].dest;\r               QOffsetRect(&dest, playOriginH, playOriginV);\r          src = breadSrc[dinahs[who].frame];\r             vClip = dinahs[who].dest.bottom - dinahs[who].hVel;\r            if (vClip > 0)\r         {\r                      src.bottom -= vClip;\r                   dest.bottom -= vClip;\r          }\r              \r               CopyMask((BitMap *)*GetGWorldPixMap(toastSrcMap), \r                             (BitMap *)*GetGWorldPixMap(toastMaskMap), \r                             (BitMap *)*GetGWorldPixMap(workSrcMap), \r                               &src, &src, &dest);\r            \r               AddRectToBackRects(&dest);\r             dest = dinahs[who].whole;\r              QOffsetRect(&dest, playOriginH, playOriginV);\r          AddRectToWorkRects(&dest);\r     }\r}\r\r//--------------------------------------------------------------  RenderBalloon\r\rvoid RenderBalloon (short who)\r{\r Rect            src, dest;\r     \r       if (dinahs[who].moving)\r        {\r              dest = dinahs[who].dest;\r               QOffsetRect(&dest, playOriginH, playOriginV);\r          src = balloonSrc[dinahs[who].frame];\r           \r               CopyMask((BitMap *)*GetGWorldPixMap(balloonSrcMap), \r                           (BitMap *)*GetGWorldPixMap(balloonMaskMap), \r                           (BitMap *)*GetGWorldPixMap(workSrcMap), \r                               &src, &src, &dest);\r            \r               AddRectToBackRects(&dest);\r             dest = dinahs[who].whole;\r              QOffsetRect(&dest, playOriginH, playOriginV);\r          AddRectToWorkRects(&dest);\r     }\r}\r\r//--------------------------------------------------------------  RenderCopter\r\rvoid RenderCopter (short who)\r{\r   Rect            src, dest;\r     \r       if (dinahs[who].moving)\r        {\r              dest = dinahs[who].dest;\r               QOffsetRect(&dest, playOriginH, playOriginV);\r          src = copterSrc[dinahs[who].frame];\r            \r               CopyMask((BitMap *)*GetGWorldPixMap(copterSrcMap), \r                            (BitMap *)*GetGWorldPixMap(copterMaskMap), \r                            (BitMap *)*GetGWorldPixMap(workSrcMap), \r                               &src, &src, &dest);\r            \r               AddRectToBackRects(&dest);\r             dest = dinahs[who].whole;\r              QOffsetRect(&dest, playOriginH, playOriginV);\r          AddRectToWorkRects(&dest);\r     }\r}\r\r//--------------------------------------------------------------  RenderDart\r\rvoid RenderDart (short who)\r{\r       Rect            src, dest;\r     \r       if (dinahs[who].moving)\r        {\r              dest = dinahs[who].dest;\r               QOffsetRect(&dest, playOriginH, playOriginV);\r          src = dartSrc[dinahs[who].frame];\r              \r               CopyMask((BitMap *)*GetGWorldPixMap(dartSrcMap), \r                              (BitMap *)*GetGWorldPixMap(dartMaskMap), \r                              (BitMap *)*GetGWorldPixMap(workSrcMap), \r                               &src, &src, &dest);\r            \r               AddRectToBackRects(&dest);\r             dest = dinahs[who].whole;\r              QOffsetRect(&dest, playOriginH, playOriginV);\r          AddRectToWorkRects(&dest);\r     }\r}\r\r//--------------------------------------------------------------  RenderBall\r\rvoid RenderBall (short who)\r{\r       Rect            src, dest;\r     \r       dest = dinahs[who].dest;\r       QOffsetRect(&dest, playOriginH, playOriginV);\r  src = ballSrc[dinahs[who].frame];\r      \r       CopyMask((BitMap *)*GetGWorldPixMap(ballSrcMap), \r                      (BitMap *)*GetGWorldPixMap(ballMaskMap), \r                      (BitMap *)*GetGWorldPixMap(workSrcMap), \r                       &src, &src, &dest);\r    \r       AddRectToBackRects(&dest);\r     dest = dinahs[who].whole;\r      QOffsetRect(&dest, playOriginH, playOriginV);\r  AddRectToWorkRects(&dest);\r}\r\r//--------------------------------------------------------------  RenderDrip\r\rvoid RenderDrip (short who)\r{\r      Rect            src, dest;\r     \r       dest = dinahs[who].dest;\r       QOffsetRect(&dest, playOriginH, playOriginV);\r  src = dripSrc[dinahs[who].frame];\r      \r       CopyMask((BitMap *)*GetGWorldPixMap(dripSrcMap), \r                      (BitMap *)*GetGWorldPixMap(dripMaskMap), \r                      (BitMap *)*GetGWorldPixMap(workSrcMap), \r                       &src, &src, &dest);\r    \r       AddRectToBackRects(&dest);\r     dest = dinahs[who].whole;\r      QOffsetRect(&dest, playOriginH, playOriginV);\r  AddRectToWorkRects(&dest);\r}\r\r//--------------------------------------------------------------  RenderFish\r\rvoid RenderFish (short who)\r{\r      Rect            src, dest;\r     \r       dest = dinahs[who].dest;\r       QOffsetRect(&dest, playOriginH, playOriginV);\r  src = fishSrc[dinahs[who].frame];\r      \r       if (dinahs[who].moving)\r        {\r              CopyMask((BitMap *)*GetGWorldPixMap(fishSrcMap), \r                              (BitMap *)*GetGWorldPixMap(fishMaskMap), \r                              (BitMap *)*GetGWorldPixMap(workSrcMap), \r                               &src, &src, &dest);\r            AddRectToBackRects(&dest);\r             dest = dinahs[who].whole;\r              QOffsetRect(&dest, playOriginH, playOriginV);\r          AddRectToWorkRects(&dest);\r     }\r      else\r   {\r              CopyBits((BitMap *)*GetGWorldPixMap(fishSrcMap), \r                              (BitMap *)*GetGWorldPixMap(workSrcMap), \r                               &src, &dest, srcCopy, nil);\r            AddRectToBackRects(&dest);\r             dest = dinahs[who].whole;\r              QOffsetRect(&dest, playOriginH, playOriginV);\r          AddRectToWorkRects(&dest);\r     }\r}\r\r//--------------------------------------------------------------  HandleSparkleObject\r\r// The following handful of functions are called each game frame and handleÉ\r// the movement and state of the various types of dynamic objects.\r\rvoid HandleSparkleObject (short who)\r{\r    Rect            tempRect;\r      \r       if (dinahs[who].active)                                                         // is it on?\r   {\r              if (dinahs[who].frame <= 0)                                             // is it idle?\r         {                                                                                               // it is idle\r                  dinahs[who].timer--;\r                   if (dinahs[who].timer <= 0)\r                    {\r                              dinahs[who].timer = RandomInt(240) + 60;// reset timer\r                         dinahs[who].frame = kNumSparkleModes;   // time to sparkle\r                             tempRect = dinahs[who].dest;\r                           AddSparkle(&tempRect);\r                         PlayPrioritySound(kMysticSound, kMysticPriority);\r                      }\r              }\r              else                                                                                    // it's sparkling\r                      dinahs[who].frame--;\r   }\r      else\r   {\r      }\r}\r\r//--------------------------------------------------------------  HandleToast\r\rvoid HandleToast (short who)\r{\r     Rect            dest;\r  \r       if (dinahs[who].moving)\r        {\r              if (evenFrame)\r         {\r                      dinahs[who].frame++;\r                   if (dinahs[who].frame >= kNumBreadPicts)\r                               dinahs[who].frame = 0;\r         }\r              if (twoPlayerGame)\r             {\r                      if (onePlayerLeft)\r                     {\r                              if (playerDead == theGlider.which)\r                                     CheckDynamicCollision(who, &theGlider2, false);\r                                else\r                                   CheckDynamicCollision(who, &theGlider, false);\r                 }\r                      else\r                   {\r                              CheckDynamicCollision(who, &theGlider, false);\r                         CheckDynamicCollision(who, &theGlider2, false);\r                        }\r              }\r              else\r                   CheckDynamicCollision(who, &theGlider, false);\r         VOffsetRect(&dinahs[who].dest, dinahs[who].vVel);\r              dinahs[who].whole = dinahs[who].dest;\r          if (dinahs[who].vVel > 0)\r                      dinahs[who].whole.top -= dinahs[who].vVel;\r             else\r                   dinahs[who].whole.bottom -= dinahs[who].vVel;\r          dinahs[who].vVel++;                                                                     // falls\r               if (dinahs[who].vVel > dinahs[who].count)\r              {\r                      dest = dinahs[who].whole;\r                      QOffsetRect(&dest, playOriginH, playOriginV);\r                  AddRectToWorkRects(&dest);\r                     dinahs[who].moving = false;\r                    dinahs[who].frame = dinahs[who].timer;\r                 PlayPrioritySound(kToastLandSound, kToastLandPriority);\r                }\r      }\r      else\r   {\r              if (dinahs[who].active)\r                        dinahs[who].frame--;\r           if (dinahs[who].frame <= 0)\r            {\r                      if (dinahs[who].active)\r                        {\r                              dinahs[who].vVel = (short)-dinahs[who].count;\r                          dinahs[who].frame = 0;\r                         dinahs[who].moving = true;\r                             PlayPrioritySound(kToastLaunchSound, kToastLaunchPriority);\r                    }\r                      else\r                           dinahs[who].frame = dinahs[who].timer;\r         }\r      }\r}\r\r//--------------------------------------------------------------  HandleMacPlus\r\rvoid HandleMacPlus (short who)\r{\r if (dinahs[who].timer > 0)\r     {\r              dinahs[who].timer--;\r           if (dinahs[who].active)\r                {\r                      if (dinahs[who].timer == 0)\r                            AddRectToWorkRects(&dinahs[who].dest);\r                 else if (dinahs[who].timer == 1)\r                       {\r                              PlayPrioritySound(kMacBeepSound, kMacBeepPriority);\r                            CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                         (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                               &plusScreen2, &dinahs[who].dest, \r                                              srcCopy, nil);\r                         AddRectToBackRects(&dinahs[who].dest);\r                 }\r                      else if (dinahs[who].timer == 30)\r                              PlayPrioritySound(kMacOnSound, kMacOnPriority);\r                }\r              else\r           {\r                      if (dinahs[who].timer == 0)\r                            AddRectToWorkRects(&dinahs[who].dest);\r                 else if (dinahs[who].timer == 1)\r                       {\r                              PlayPrioritySound(kMacOffSound, kMacOffPriority);\r                              CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                         (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                               &plusScreen1, &dinahs[who].dest, \r                                              srcCopy, nil);\r                         AddRectToBackRects(&dinahs[who].dest);\r                 }\r              }\r      }\r}\r\r//--------------------------------------------------------------  HandleTV\r\rvoid HandleTV (short who)\r{\r   if (dinahs[who].timer > 0)\r     {\r              dinahs[who].timer--;\r           if (dinahs[who].active)\r                {\r                      if (dinahs[who].timer == 0)\r                    {\r                              if ((thisMac.hasQT) && (hasMovie) && (tvInRoom) && \r                                            (who == tvWithMovieNumber))\r                            {\r                              }\r                              else\r                           {\r                                      AddRectToWorkRects(&dinahs[who].dest);\r                         }\r                      }\r                      else if (dinahs[who].timer == 1)\r                       {\r                              PlayPrioritySound(kTVOnSound, kTVOnPriority);\r                          if ((thisMac.hasQT) && (hasMovie) && (tvInRoom) && \r                                            (who == tvWithMovieNumber))\r                            {\r                              }\r                              else\r                           {\r                                      CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                                 (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                                       &tvScreen2, &dinahs[who].dest, \r                                                        srcCopy, nil);\r                                 AddRectToBackRects(&dinahs[who].dest);\r                         }\r                      }\r              }\r              else\r           {\r                      if (dinahs[who].timer == 0)\r                            AddRectToWorkRects(&dinahs[who].dest);\r                 else if (dinahs[who].timer == 1)\r                       {\r                              PlayPrioritySound(kTVOffSound, kTVOffPriority);\r                                CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                         (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                               &tvScreen1, &dinahs[who].dest, \r                                                srcCopy, nil);\r                         AddRectToBackRects(&dinahs[who].dest);\r                 }\r              }\r      }\r}\r\r//--------------------------------------------------------------  HandleCoffee\r\rvoid HandleCoffee (short who)\r{\r   if (dinahs[who].timer > 0)\r     {\r              dinahs[who].timer--;\r           if (dinahs[who].active)\r                {\r                      if (dinahs[who].timer == 0)\r                    {\r                              AddRectToWorkRects(&dinahs[who].dest);\r                         dinahs[who].timer = 200 + RandomInt(200);\r                      }\r                      else if (dinahs[who].timer == 1)\r                       {\r                              PlayPrioritySound(kMacOnSound, kMacOnPriority);\r                                CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                         (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                               &coffeeLight2, &dinahs[who].dest, \r                                             srcCopy, nil);\r                         AddRectToBackRects(&dinahs[who].dest);\r                 }\r                      else if (dinahs[who].timer == 100)\r                     {\r                              PlayPrioritySound(kCoffeeSound, kCoffeePriority);\r                              dinahs[who].timer = 200 + RandomInt(200);\r                      }\r              }\r              else\r           {\r                      if (dinahs[who].timer == 0)\r                            AddRectToWorkRects(&dinahs[who].dest);\r                 else if (dinahs[who].timer == 1)\r                       {\r                              PlayPrioritySound(kMacOffSound, kMacOffPriority);\r                              CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                         (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                               &coffeeLight1, &dinahs[who].dest, \r                                             srcCopy, nil);\r                         AddRectToBackRects(&dinahs[who].dest);\r                 }\r              }\r      }\r}\r\r//--------------------------------------------------------------  HandleOutlet\r\rvoid HandleOutlet (short who)\r{\r   if (dinahs[who].position != 0)\r {\r              dinahs[who].timer--;\r           \r               if (twoPlayerGame)\r             {\r                      if (onePlayerLeft)\r                     {\r                              if (playerDead == theGlider.which)\r                                     CheckDynamicCollision(who, &theGlider2, false);\r                                else\r                                   CheckDynamicCollision(who, &theGlider, false);\r                 }\r                      else\r                   {\r                              CheckDynamicCollision(who, &theGlider, true);\r                          CheckDynamicCollision(who, &theGlider2, true);\r                 }\r              }\r              else\r                   CheckDynamicCollision(who, &theGlider, true);\r          \r               if (dinahs[who].timer <= 0)\r            {\r                      dinahs[who].frame = 0;\r                 dinahs[who].position = 0;\r                      dinahs[who].timer = dinahs[who].count;\r         }\r              else\r           {\r                      if ((dinahs[who].timer % 5) == 0)\r                              PlayPrioritySound(kZapSound, kZapPriority);\r                    dinahs[who].frame++;\r                   if (dinahs[who].frame >= kNumOutletPicts)\r                              dinahs[who].frame = 1;\r         }\r              \r               if ((dinahs[who].position != 0) || (dinahs[who].hVel > 0))\r             {\r                      CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                 (BitMap *)*GetGWorldPixMap(workSrcMap), \r                                       &outletSrc[dinahs[who].frame], \r                                        &dinahs[who].dest, \r                                    srcCopy, nil);\r         }\r              else\r           {\r//                    SetPort((GrafPtr)workSrcMap);\r                  PaintRect(&dinahs[who].dest);\r          }\r              AddRectToWorkRects(&dinahs[who].dest);\r }\r      else\r   {\r              if (dinahs[who].active)\r                        dinahs[who].timer--;\r           \r               if (dinahs[who].timer <= 0)\r            {\r                      if (dinahs[who].active)\r                        {\r                              dinahs[who].position = 1;\r                              dinahs[who].timer = kLengthOfZap;\r                              PlayPrioritySound(kZapSound, kZapPriority);\r                    }\r                      else\r                           dinahs[who].timer = dinahs[who].count;\r         }\r      }\r}\r\r//--------------------------------------------------------------  HandleVCR\r\rvoid HandleVCR (short who)\r{\r if (dinahs[who].timer > 0)\r     {\r              dinahs[who].timer--;\r           if (dinahs[who].active)\r                {\r                      if (dinahs[who].timer == 0)\r                    {\r                              AddRectToWorkRects(&dinahs[who].dest);\r                         dinahs[who].timer = 115;\r                       }\r                      else if (dinahs[who].timer == 5)\r                               PlayPrioritySound(kMacOnSound, kMacOnPriority);\r                        else if (dinahs[who].timer == 1)\r                       {\r                              PlayPrioritySound(kVCRSound, kVCRPriority);\r                            CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                         (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                               &vcrTime2, &dinahs[who].dest, \r                                         srcCopy, nil);\r                         AddRectToBackRects(&dinahs[who].dest);\r                 }\r                      else if (dinahs[who].timer == 100)\r                     {\r                              AddRectToWorkRects(&dinahs[who].dest);\r                         dinahs[who].timer = 115;\r                               dinahs[who].frame = 1 - dinahs[who].frame;\r                     }\r                      else if (dinahs[who].timer == 101)\r                     {\r                              if (dinahs[who].frame == 0)\r                            {\r                                      CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                                 (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                                       &vcrTime2, &dinahs[who].dest, \r                                                 srcCopy, nil);\r                                 AddRectToBackRects(&dinahs[who].dest);\r                         }\r                              else\r                           {\r                                      CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                                 (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                                       &vcrTime1, &dinahs[who].dest, \r                                                 srcCopy, nil);\r                                 AddRectToBackRects(&dinahs[who].dest);\r                         }\r                      }\r              }\r              else\r           {\r                      if (dinahs[who].timer == 0)\r                            AddRectToWorkRects(&dinahs[who].dest);\r                 else if (dinahs[who].timer == 1)\r                       {\r                              PlayPrioritySound(kMacOffSound, kMacOffPriority);\r                              CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                         (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                               &vcrTime1, &dinahs[who].dest, \r                                         srcCopy, nil);\r                         AddRectToBackRects(&dinahs[who].dest);\r                 }\r              }\r      }\r}\r\r//--------------------------------------------------------------  HandleStereo\r\rvoid HandleStereo (short who)\r{\r   if (dinahs[who].timer > 0)\r     {\r              dinahs[who].timer--;\r           if (dinahs[who].active)\r                {\r                      if (dinahs[who].timer == 0)\r                    {\r                              AddRectToWorkRects(&dinahs[who].dest);\r                         ToggleMusicWhilePlaying();\r                     }\r                      else if (dinahs[who].timer == 1)\r                       {\r                              PlayPrioritySound(kMacOnSound, kMacOnPriority);\r                                CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                         (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                               &stereoLight2, &dinahs[who].dest, \r                                             srcCopy, nil);\r                         AddRectToBackRects(&dinahs[who].dest);\r                 }\r              }\r              else\r           {\r                      if (dinahs[who].timer == 0)\r                    {\r                              AddRectToWorkRects(&dinahs[who].dest);\r                         ToggleMusicWhilePlaying();\r                     }\r                      else if (dinahs[who].timer == 1)\r                       {\r                              PlayPrioritySound(kMacOffSound, kMacOffPriority);\r                              CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                         (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                               &stereoLight1, &dinahs[who].dest, \r                                             srcCopy, nil);\r                         AddRectToBackRects(&dinahs[who].dest);\r                 }\r              }\r      }\r}\r\r//--------------------------------------------------------------  HandleMicrowave\r\rvoid HandleMicrowave (short who)\r{\r     Rect            dest;\r  \r       if (dinahs[who].timer > 0)\r     {\r              dinahs[who].timer--;\r           if (dinahs[who].active)\r                {\r                      if (dinahs[who].timer == 0)\r                            AddRectToWorkRects(&dinahs[who].dest);\r                 else if (dinahs[who].timer == 1)\r                       {\r                              PlayPrioritySound(kMacOnSound, kMacOnPriority);\r                                dest = dinahs[who].dest;\r                               dest.right = dest.left + 16;\r                           CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                         (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                               &microOn, &dest, \r                                              srcCopy, nil);\r                         QOffsetRect(&dest, 16, 0);\r                             CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                         (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                               &microOn, &dest, \r                                              srcCopy, nil);\r                         QOffsetRect(&dest, 16, 0);\r                             CopyBits((BitMap *)*GetGWorldPixMap(applianceSrcMap), \r                                         (BitMap *)*GetGWorldPixMap(backSrcMap), \r                                               &microOn, &dest, \r                                              srcCopy, nil);\r                         AddRectToBackRects(&dinahs[who].dest);\r                 }\r              }\r              else\r           {\r                      if (dinahs[who].timer == 0)\r                            AddRectToWorkRects(&dinahs[who].dest);\r   &