home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / lbmcomp / lbmcomp.c next >
Text File  |  1998-06-08  |  2KB  |  96 lines

  1. /*
  2. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  3. SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
  4. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  5. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  6. IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  7. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  8. FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  9. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
  10. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.  
  11. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  12. */
  13. /*
  14.  * $Source: h:/miner/source/xcolor/RCS/xcolor.c $
  15.  * $Revision: 1.1 $
  16.  * $Author: john $
  17.  * $Date: 1994/01/24 11:09:24 $
  18.  * 
  19.  * .
  20.  * 
  21.  * $Log: xcolor.c $
  22.  * Revision 1.1  1994/01/24  11:09:24  john
  23.  * Initial revision
  24.  * 
  25.  * 
  26.  */
  27.  
  28.  
  29. #pragma off (unreferenced)
  30. static char rcsid[] = "$Id: xcolor.c 1.1 1994/01/24 11:09:24 john Exp $";
  31. #pragma on (unreferenced)
  32.  
  33. #include <dos.h>
  34. #include <stdio.h>
  35. #include <stdlib.h>
  36.  
  37. #include "types.h"
  38. #include "gr.h"
  39. #include "iff.h"
  40. #include "mem.h"
  41.  
  42. ubyte palette[768];
  43.  
  44. void dofile( char * filename )
  45. {
  46.     grs_bitmap * bitmap;
  47.  
  48.     MALLOC( bitmap, grs_bitmap, 1 );    
  49.  
  50.     printf( "Compressing %s... Reading,", filename );
  51.     iff_read_bitmap( filename, bitmap, BM_LINEAR, palette );
  52.     printf( "Writing" );
  53.     iff_write_bitmap(filename,bitmap, palette );
  54.     printf( "," );
  55.     gr_free_bitmap(bitmap);
  56.     printf( "Done.\n" );
  57. }
  58.  
  59. void main(int argc, char * argv[])    {
  60.     int numfiles = 0;
  61.      struct find_t find;
  62.     char * cp;
  63.     char * cp1;
  64.  
  65.     setbuf(stdout, NULL);    // unbuffered output via printf
  66.  
  67.     argv++; argc--;
  68.     for (;argc--;argv++)
  69.     {
  70.         if( !_dos_findfirst( *argv, 0xffff, &find ) )
  71.         {
  72.             dofile( find.name );
  73.             numfiles++;
  74.             while( !_dos_findnext( &find ) )    {
  75.                 numfiles++;
  76.                 dofile( find.name );
  77.             }
  78.          }
  79.     }
  80.  
  81.     if ( numfiles < 1 )    {
  82.         printf( "lbmcomp- this program compresses bbm files by removing\n");
  83.         printf( "unused chunks. The command line is the file specs\n" );
  84.         printf( "to convert. ie.. lbmcomp john*.bbm adam*.bbm\n\n" );
  85.         exit(1);
  86.     }
  87.  
  88.  
  89. }
  90.  
  91.  
  92.  
  93.  
  94.  
  95. 
  96.