home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / g / gametp20.zip / FLICS.INT < prev    next >
Text File  |  1992-11-05  |  4KB  |  101 lines

  1. Unit Flics;
  2.  
  3. { FLICS version 1.0 Copyright (C) 1992 Scott D. Ramsay      }
  4. {                                  ramsays@access.digex.com }
  5.  
  6. {   This unit allows one to play Autodesk Animatior FLI files. And   }
  7. { my own version FLS files which has embedded VOC files in frames.   }
  8. {   See VOCINFLS.EXE, SEEFLS.EXE, PLAYFLS.EXE, FLS2VOC.EXE           }
  9. { to modify your FLI files to FLS files.                             }
  10. {   FLICS.TPU can be used freely in commerical and non-commerical    }
  11. { programs.  As long as you don't give yourself credit for writing   }
  12. { this portion of the code.  When distributing it please include all }
  13. { files and samples so others may enjoy using the code.  Thanks.     }
  14.  
  15. Interface
  16.  
  17. Uses VgaKern,DSound;
  18.  
  19. const
  20.   fli_vocplay : boolean = true;      { Set to FALSE to keep FLS files quiet }
  21.   leavelast   : boolean = false;     { Set to TRUE to skip last frame       }
  22.   VOC_MAGIC   = $FF03;               { Voice header word                    }
  23.  
  24. type
  25.   frameproc = procedure(totframe,frame,loop:longint;var fquit:boolean);
  26.   fli_hdr   = record
  27.                  size          : longint;        { size of FLI file  }
  28.                  magic,                          { should be $AF11   }
  29.                  frames,                         { number of frames  }
  30.                  width,height,                   { should be 320,200 }
  31.                  depth,next    : word;
  32.                  speed,frit    : longint;        { fli speed in jiffies }
  33.                  reserved      : array[1..104] of byte;
  34.                end;
  35.   frame_hdr = record
  36.                 size         : longint;          { header size }
  37.                 magic,                           { = $FF03 for voice }
  38.                 chunks : word;                   { chunk type }
  39.                 reserved     : array[1..8] of byte;
  40.               end;
  41.  
  42. var
  43.   every_frame : frameproc;      { Set your far procedure to this    }
  44.                                 { for user call at every frame      }
  45.  
  46. (******************************)
  47.      { e.g.
  48.  
  49. procedure MyCall_EveryFrame(totframe,frame,loop:longint;var fquit:boolean);far;
  50. { notice parameter list is the same as frameproc type
  51.  
  52.     totframe     Number of frames passed.
  53.     frame        Current frame number
  54.     loop         Loop number
  55.     fquit        Set to TRUE to halt fli animation.
  56. }
  57. begin
  58.   { this will be done for every frame }
  59. end;
  60.  
  61.  begin
  62.    every_frame := MyCall_EveryFrame;
  63.    fli_play('MyAni.FLS',-1,1,false);
  64.  end;                                   }
  65.  
  66. (******************************)
  67.  
  68.   crnthdr     : fli_hdr;                { Current frame header }
  69.                                         { set to last FLI/FLS loaded }
  70.   framesdid,                            { Global of frames did }
  71.   crntfrm     : longint;                { File positon of last FLI/FLS }
  72.                                         { file where frame data starts }
  73.  
  74. function fli_header(fl:string):boolean;
  75. function fli_play(fl:string;sp,tms:integer;swait:boolean):boolean;
  76.  
  77. { See Implementation section for description of functions }
  78.  
  79. implementation
  80.  
  81. (*************************************************************************)
  82. function fli_header(fl:string):boolean;
  83.  
  84.     Reads a FLI/FLS file and sets CRNTHDR, CRNTFRM
  85.  
  86.     fl     FLI or FLS file name.
  87.  
  88.     returns TRUE if fl is a FLI or FLS file.
  89.  
  90. (*************************************************************************)
  91. function fli_play(fl:string;sp,tms:integer;swait:boolean):boolean;
  92.  
  93.     Plays a FLI/FLS file.
  94.  
  95.     fl     FLI or FLS file name
  96.     sp     Override speed of flic.  Set to -1 to use speed in file.
  97.     tms    Number of times to loop flic.  Set to -1 to loop forever.
  98.            (note: for -1 be sure to override EVERY_FRAME so you can
  99.             exit from the flic.)
  100.     swait  Set to TRUE if you want the flic to keep playing until
  101.            sounds playing are completed.