home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Ken Long / rinth / util.c < prev   
Encoding:
Text File  |  1994-12-04  |  793 b   |  49 lines  |  [TEXT/KAHL]

  1.  
  2. LoadSound(soundH, soundID, soundName)
  3.     Handle        *soundH;
  4.     short        soundID;
  5.     Str255        soundName;
  6. {
  7.     if ((*soundH = GetResource('snd ', soundID)) == 0L) {
  8.         ExitAppl();
  9.     } /* if */
  10.     MoveHHi(*soundH);
  11.     HLock(*soundH);
  12.     HNoPurge(*soundH);
  13.     
  14. } /* LoadSound() */
  15.  
  16. UnloadSound(soundH)
  17.     Handle    soundH;
  18. {
  19.     HUnlock(soundH);
  20.     HPurge(soundH);
  21.     ReleaseResource(soundH);
  22.  
  23. } /* UnloadSound() */
  24.  
  25. ExitAppl()
  26. {
  27.     extern    CWindowPtr    gPictureWindow;
  28.     
  29.     if (gPictureWindow)
  30.         DisposeWindow((WindowPtr)gPictureWindow);
  31.     FlushEvents(everyEvent, 0);
  32.     UnloadSounds();
  33.     ExitToShell();
  34.     
  35. } /* ExitAppl() */
  36.  
  37. ErasePort(whichPort, whatRect)
  38.     CGrafPort        *whichPort;
  39.     Rect            whatRect;
  40. {
  41.     GrafPtr        savePort;
  42.     
  43.     GetPort(&savePort);
  44.     SetPort((GrafPtr)whichPort);
  45.     EraseRect (&whatRect);    
  46.     SetPort(savePort);
  47.     
  48. } /* ErasePort() */
  49.