GliderPRO/Sources/Main.c

1 line
11 KiB
C
Raw Normal View History

//============================================================================ //---------------------------------------------------------------------------- // Glider PRO 1.0.4 // by john calhoun //---------------------------------------------------------------------------- //============================================================================ #include <Resources.h> #include <Sound.h> #include "Externs.h" #include "Environ.h" #include "House.h" #define kPrefsVersion 0x0034 void ReadInPrefs (void); void WriteOutPrefs (void); void main (void); short isVolume, wasVolume; short isDepthPref, dataResFile, numSMWarnings; Boolean quitting, doZooms, quickerTransitions, isUseSecondScreen; extern Str31 highBanner; extern Str15 leftName, rightName, batteryName, bandName; extern Str15 highName; //extern long encryptedNumber; extern short maxFiles, numNeighbors, houseRefNum, willMaxFiles; extern short isEditH, isEditV, isMapH, isMapV; extern short isToolsH, isToolsV, isCoordH, isCoordV; extern short isLinkH, isLinkV, toolMode, mapLeftRoom, mapTopRoom; extern short mapRoomsWide, mapRoomsHigh, wasFloor, wasSuite; extern Boolean isMusicOn, isSoundOn, isPlayMusicIdle, isHouseChecks; extern Boolean houseOpen, isDoColorFade, isEscPauseKey; extern Boolean autoRoomEdit, doAutoDemo, doBackground; extern Boolean isMapOpen, isToolsOpen, isCoordOpen; extern Boolean doPrettyMap, doBitchDialogs; //extern Boolean didValidation; //============================================================== Functions //-------------------------------------------------------------- ReadInPrefs // Called only once when game launches - reads in the preferences saved<65> // from the last time Glider PRO was launched. If no prefs are found,<2C> // it assigns default settings. void ReadInPrefs (void) { prefsInfo thePrefs; if (LoadPrefs(&thePrefs, kPrefsVersion)) { #ifdef COMPILEDEMO PasStringCopy("\pDemo House", thisHouseName); #else PasStringCopy(thePrefs.wasDefaultName, thisHouseName); #endif PasStringCopy(thePrefs.wasLeftName, leftName); PasStringCopy(thePrefs.wasRightName, rightName); PasStringCopy(thePrefs.wasBattName, batteryName); PasStringCopy(thePrefs.wasBandName, bandName); PasStringCopy(thePrefs.wasHighName, highName); PasStringCopy(thePrefs.wasHighBanner, highBanner); theGlider.leftKey = thePrefs.wasLeftMap; theGlider.rightKey = thePrefs.wasRightMap; theGlider.battKey = thePrefs.wasBattMap; theGlider.bandKey = thePrefs.wasBandMap; #ifndef COMPILEDEMO #ifndef COMPILENOCP encryptedNumber = thePrefs.encrypted; #endif // COMPILENOCP #endif // COMPILEDEMO isVolume = thePrefs.wasVolume; isDepthPref = thePrefs.wasDepthPref; isMusicOn = thePrefs.wasMusicOn; doZooms = thePrefs.wasZooms; quickerTransitions = thePrefs.wasQuickTrans; isDoColorFade = thePrefs.wasDoColorFade; isPlayMusicIdle = thePrefs.wasIdleMusic; isPlayMusicGame = thePrefs.wasGameMusic; isHouseChecks = thePrefs.wasHouseChecks; maxFiles = thePrefs.wasMaxFiles; if ((maxFiles < 12) || (maxFiles > 500)) maxFiles = 12; isEditH = thePrefs.wasEditH; isEditV = thePrefs.wasEditV; isMapH = thePrefs.wasMapH; isMapV = thePrefs.wasMapV; mapRoomsWide = thePrefs.wasMapWide; mapRoomsHigh = thePrefs.wasMapHigh; isToolsH = thePrefs.wasToolsH; isToolsV = thePrefs.wasToolsV; isLinkH = thePrefs.wasLinkH; isLinkV = thePrefs.wasLinkV; isCoordH = thePrefs.wasCoordH; isCoordV = thePrefs.wasCoordV; mapLeftRoom = thePrefs.isMapLeft; mapTopRoom = thePrefs.isMapTop; wasFloor = thePrefs.wasFloor; wasSuite = thePrefs.wasSuite; numSMWarnings = thePrefs.smWarnings; autoRoomEdit = thePrefs.wasAutoEdit; isMapOpen = thePrefs.wasMapOpen; isToolsOpen = thePrefs.wasToolsOpen; isCoordOpen = thePrefs.wasCoordOpen; numNeighbors = thePrefs.wasNumNeighbors; toolMode = thePrefs.wasToolGroup; doAutoDemo = thePrefs.wasDoAutoDemo; isEscPauseKey = thePrefs.wasEscPauseKey; isUseSecondScreen = thePrefs.wasScreen2; if (thisMac.numScreens < 2) isUseSecondScreen = false; doBackground =