GliderPRO/Sources/StructuresInit2.c

1 line
16 KiB
C
Raw Permalink Normal View History

//============================================================================ //---------------------------------------------------------------------------- // StructuresInit2.c //---------------------------------------------------------------------------- //============================================================================ #include <Resources.h> #include "Externs.h" #include "Environ.h" #include "GameOver.h" #include "MainWindow.h" #include "Objects.h" #include "RectUtils.h" #include "Room.h" #include "RoomGraphics.h" #include "Utilities.h" #define kAngelPictID 1019 #define kSupportPictID 1999 #define kClutterPictID 4018 void InitClutter (void); void InitSupport (void); void InitAngel (void); extern Rect suppSrcRect, justRoomsRect; extern Rect tileSrcRect, angelSrcRect; extern GDHandle thisGDevice; extern CGrafPtr tileSrcMap; extern FSSpecPtr theHousesSpecs; extern hotPtr hotSpots; extern sparklePtr sparkles; extern flyingPtPtr flyingPoints; extern flamePtr flames, tikiFlames, bbqCoals; extern pendulumPtr pendulums; extern savedPtr savedMaps; extern bandPtr bands; extern greasePtr grease; extern starPtr theStars; extern shredPtr shreds; extern dynaPtr dinahs; extern demoPtr demoData; extern short maxFiles; //============================================================== Functions //-------------------------------------------------------------- InitClutter // Structures and graphics relating to clutter are loaded up. // Clutter includes mirrors, teddy bears, fireplaces, calendars, etc. void InitClutter (void) { CGrafPtr wasCPort; GDHandle wasWorld; OSErr theErr; GetGWorld(&wasCPort, &wasWorld); QSetRect(&clutterSrcRect, 0, 0, 128, 69); theErr = CreateOffScreenGWorld(&clutterSrcMap, &clutterSrcRect, kPreferredDepth); SetGWorld(clutterSrcMap, nil); LoadGraphic(kClutterPictID); theErr = CreateOffScreenGWorld(&clutterMaskMap, &clutterSrcRect, 1); SetGWorld(clutterMaskMap, nil); LoadGraphic(kClutterPictID + 1000); QSetRect(&flowerSrc[0], 0, 0, 10, 28); QOffsetRect(&flowerSrc[0], 0, 23); QSetRect(&flowerSrc[1], 0, 0, 24, 35); QOffsetRect(&flowerSrc[1], 10, 16); QSetRect(&flowerSrc[2], 0, 0, 34, 35); QOffsetRect(&flowerSrc[2], 34, 16); QSetRect(&flowerSrc[3], 0, 0, 27, 23); QOffsetRect(&flowerSrc[3], 68, 14); QSetRect(&flowerSrc[4], 0, 0, 27, 14); QOffsetRect(&flowerSrc[4], 68, 37); QSetRect(&flowerSrc[5], 0, 0, 32, 51); QOffsetRect(&flowerSrc[5], 95, 0); SetGWorld(wasCPort, wasWorld); } //-------------------------------------------------------------- InitSupport // The floor support grphic is loaded up. It is only visible when<65> // playing in 9-room mode. It is the horizontal wooden beam that<61> // seperates floors from one another. void InitSupport (void) { CGrafPtr wasCPort; GDHandle wasWorld; OSErr theErr; GetGWorld(&wasCPort, &wasWorld); QSetRect(&suppSrcRect, 0, 0, kRoomWide, kFloorSupportTall); // 44 theErr = CreateOffScreenGWorld(&suppSrcMap, &suppSrcRect, kPreferredDepth); SetGWorld(suppSrcMap, nil); LoadGraphic(kSupportPictID); SetGWorld(wasCPort, wasWorld); } //-------------------------------------------------------------- InitAngel // This loads the graphic of the girl riding the glider. It is seen<65> // only upon completing a house. She flies across the screen dropping<6E> // stars below. void InitAngel (void) { CGrafPtr wasCPort; GDHandle wasWorld; OSErr theErr; GetGWorld(&wasCPort, &wasWorld); QSetRect(&angelSrcRect, 0, 0, 96, 44); theErr = CreateOffScreenGWorld(&angelSrcMap, &angelSrcRect, kPreferredDepth); SetGWorld(angelSrcMap, nil); LoadGraphic(kAngelPictID); theErr = CreateOffScreenGWorld(&angelMaskMap, &angelSrcRect, 1); SetGWorld(angelMaskMap, nil); LoadGraphic(kAngelPictID + 1); SetGWorld(wasCPort, wasWorld); } //-------------------------------------------------------------- CreateOffscreens // All "utility" or "work" offscreen pix/bit maps are created here. // These would be offscreens that are reused throughout a game - they<65> // are not static (mere repositories for gr