home *** CD-ROM | disk | FTP | other *** search
/ Reflux 1: The Becoming / Reflux.iso / shared.dxr / 00467.ls < prev    next >
Encoding:
Text File  |  1995-05-01  |  1.4 KB  |  71 lines

  1. on initializationRoutines
  2.   global purgeLevel
  3.   set purgeLevel to 500
  4.   initLists()
  5.   setAnimationSpeed()
  6. end
  7.  
  8. on idle
  9.   processList()
  10. end
  11.  
  12. on processList
  13.   global nextList, nextPtr, idleFlag
  14.   if idleFlag = 1 then
  15.     if nextPtr <= count(nextList) then
  16.       set nCast to getAt(nextList, nextPtr)
  17.       set ok to 0
  18.       if voidp(nCast) = 0 then
  19.         if integerp(nCast) = 1 then
  20.           if the castType of cast nCast <> #empty then
  21.             set ok to 1
  22.           end if
  23.         else
  24.           if the number of cast nCast <> -1 then
  25.             set ok to 1
  26.           end if
  27.         end if
  28.       end if
  29.       if ok = 1 then
  30.         preLoadCast(nCast)
  31.       end if
  32.       set nextPtr to nextPtr + 1
  33.     end if
  34.   end if
  35. end
  36.  
  37. on initLists
  38.   global currentList, nextList, nextPtr, idleFlag
  39.   set purgeList to []
  40.   set currentList to []
  41.   set nextList to []
  42.   set nextPtr to 1
  43.   set idleFlag to 1
  44. end
  45.  
  46. on startList pCast
  47.   global currentList
  48.   append(currentList, pCast)
  49. end
  50.  
  51. on newList
  52.   global currentList, nextList, nextPtr
  53.   unloadPurgeList()
  54.   repeat with i = 1 to count(nextList)
  55.     append(currentList, getAt(nextList, i))
  56.   end repeat
  57.   set nextList to []
  58.   set nextPtr to 1
  59. end
  60.  
  61. on unloadPurgeList
  62.   global currentList, purgeLevel
  63.   if the freeBytes < purgeLevel then
  64.     repeat with i = 1 to count(currentList)
  65.       set nCast to getAt(currentList, i)
  66.       unLoadCast(nCast)
  67.     end repeat
  68.   end if
  69.   set currentList to []
  70. end
  71.