--- ray/src/meta/meta2tga.c 2003/02/22 02:07:26 1.1 +++ ray/src/meta/meta2tga.c 2003/10/27 10:28:59 1.4 @@ -1,33 +1,24 @@ #ifndef lint -static const char RCSid[] = "$Id: meta2tga.c,v 1.1 2003/02/22 02:07:26 greg Exp $"; +static const char RCSid[] = "$Id: meta2tga.c,v 1.4 2003/10/27 10:28:59 schorsch Exp $"; #endif /* * Program to convert meta-files to Targa 8-bit color-mapped format */ +#include "copyright.h" -#define MAXALLOC 5000 - -#define DXSIZE 400 /* default x resolution */ - -#define DYSIZE 400 /* default y resolution */ - -#define XCOM "pexpand +vOCImsp -DP %s | psort +y" - - - - +#include "rtprocess.h" #include "meta.h" - #include "plot.h" - #include "rast.h" - #include "targa.h" +#define MAXALLOC 5000 +#define DXSIZE 400 /* default x resolution */ +#define DYSIZE 400 /* default y resolution */ +#define XCOM "pexpand +vOCImsp -DP %s | psort +y" - char *progname; SCANBLOCK outblock; @@ -65,36 +56,23 @@ char **argv; { FILE *fp; -#ifdef UNIX - FILE *popen(); -#endif char comargs[200], command[300]; -#ifdef CPM - fixargs("meta2tga", &argc, &argv); -#endif - fout = stdout; progname = *argv++; argc--; condonly = FALSE; -#ifdef CPM - conditioned = TRUE; -#else conditioned = FALSE; -#endif while (argc && **argv == '-') { switch (*(*argv+1)) { -#ifdef UNIX case 'c': condonly = TRUE; break; case 'r': conditioned = TRUE; break; -#endif case 'm': minwidth = atoi(*++argv); argc--; @@ -142,7 +120,6 @@ char **argv; argc--; } sprintf(command, XCOM, comargs); -#ifdef UNIX if (condonly) return(system(command)); else { @@ -153,7 +130,6 @@ char **argv; if (lineno) nextpage(); } -#endif } return(0); @@ -175,8 +151,12 @@ thispage() /* rewind current file */ initfile() /* initialize this file */ { static int filenum = 0; + /* static unsigned char cmap[24] = {255,255,255, 255,152,0, 0,188,0, 0,0,255, 179,179,0, 255,0,255, 0,200,200, 0,0,0}; + */ + static unsigned char cmap[24] = {0,0,0, 0,0,255, 0,188,0, 255,152,0, + 0,200,200, 255,0,255, 179,179,0, 255,255,255}; struct hdStruct thead; register int i;