LBMCOMP.C 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. #pragma off (unreferenced)
  28. static char rcsid[] = "$Id: xcolor.c 1.1 1994/01/24 11:09:24 john Exp $";
  29. #pragma on (unreferenced)
  30. #include <dos.h>
  31. #include <stdio.h>
  32. #include <stdlib.h>
  33. #include "types.h"
  34. #include "gr.h"
  35. #include "iff.h"
  36. #include "mem.h"
  37. ubyte palette[768];
  38. void dofile( char * filename )
  39. {
  40. grs_bitmap * bitmap;
  41. MALLOC( bitmap, grs_bitmap, 1 );
  42. printf( "Compressing %s... Reading,", filename );
  43. iff_read_bitmap( filename, bitmap, BM_LINEAR, palette );
  44. printf( "Writing" );
  45. iff_write_bitmap(filename,bitmap, palette );
  46. printf( "," );
  47. gr_free_bitmap(bitmap);
  48. printf( "Done.\n" );
  49. }
  50. void main(int argc, char * argv[]) {
  51. int numfiles = 0;
  52. struct find_t find;
  53. char * cp;
  54. char * cp1;
  55. setbuf(stdout, NULL); // unbuffered output via printf
  56. argv++; argc--;
  57. for (;argc--;argv++)
  58. {
  59. if( !_dos_findfirst( *argv, 0xffff, &find ) )
  60. {
  61. dofile( find.name );
  62. numfiles++;
  63. while( !_dos_findnext( &find ) ) {
  64. numfiles++;
  65. dofile( find.name );
  66. }
  67. }
  68. }
  69. if ( numfiles < 1 ) {
  70. printf( "lbmcomp- this program compresses bbm files by removing\n");
  71. printf( "unused chunks. The command line is the file specs\n" );
  72. printf( "to convert. ie.. lbmcomp john*.bbm adam*.bbm\n\n" );
  73. exit(1);
  74. }
  75. }
  76.