home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / grafik / fls / playfls.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-11-07  |  1.5 KB  |  62 lines

  1. Program PlayFLS;
  2.  
  3. {$B- }
  4. { This program requires the units from GameTP2.0 }
  5. {  Copyright 1992 Scott D. Ramsay   e-mail:  ramsays@access.digex.com }
  6.  
  7. Uses Crt,VgaKern,Flics,Dsound,MiscFunc;
  8.  
  9. const
  10.   playtimes : array[boolean] of shortint =
  11.               (1,-1);
  12. var
  13.   d    : byte;
  14.   s,l  : string;
  15.   cont,
  16.   wait : boolean;
  17.  
  18. procedure for_every_frame(totframe,frame,loop:longint;var fquit:boolean); far;
  19. begin
  20.   if keypressed and (readkey=#27)
  21.     then fquit := true
  22.     else fquit := false;
  23. end;
  24.  
  25.  
  26. begin
  27.   writeln('FLS/FLI player.  Copyright 1992 Scott Ramsay');
  28.   writeln;
  29.   if paramcount<1
  30.     then
  31.       begin
  32.         writeln('Syntax:');
  33.         writeln(' PLAYFLS animatonfile [/W]');
  34.         writeln;
  35.         writeln('  animationfile     A FLI or FLS file');
  36.         writeln('    /W              For FLS files wait for sound to finish');
  37.         writeln('    /C              Play continuous. (Press ESC to quit)');
  38.         halt(1);
  39.       end;
  40.   s := paramstr(1); l := '';
  41.   for d := 2 to paramcount do
  42.     l := l+ups(paramstr(d));
  43.   wait := (pos('/W',l)<>0);
  44.   cont := (pos('/C',l)<>0);
  45.   if not exist(s)
  46.     then
  47.       if exist(s+'.FLS')
  48.         then s := s+'.FLS'
  49.         else
  50.           if exist(s+'.FLI')
  51.             then s := s+'.FLI'
  52.             else
  53.               begin
  54.                 writeln('The file: ',s,' could not be found');
  55.                 halt(1);
  56.               end;
  57.   openmode(1);
  58.   ScardSetup(0,0);
  59.   every_frame := for_every_frame;
  60.   fli_play(s,-1,playtimes[cont],wait);
  61.   closemode;
  62. end.