--- ray/src/px/ra_t16.c 1991/08/23 13:40:04 1.14 +++ ray/src/px/ra_t16.c 1992/10/30 09:11:36 2.4 @@ -13,8 +13,16 @@ static char SCCSid[] = "$SunId$ LBL"; #include +#ifdef MSDOS +#include +#endif + +#include + #include "color.h" +#include "resolu.h" + #include "random.h" #include "targa.h" @@ -32,10 +40,8 @@ static char SCCSid[] = "$SunId$ LBL"; extern char *ecalloc(), *emalloc(); -extern double atof(), pow(); +double gamcor = 2.2; /* gamma correction */ -double gamma = 2.2; /* gamma correction */ - int bradj = 0; /* brightness adjustment */ char *progname; @@ -50,7 +56,12 @@ char *argv[]; struct hdStruct head; int reverse = 0; int i; - +#ifdef MSDOS + extern int _fmode; + _fmode = O_BINARY; + setmode(fileno(stdin), O_BINARY); + setmode(fileno(stdout), O_BINARY); +#endif progname = argv[0]; head.dataBits = 16; @@ -58,7 +69,7 @@ char *argv[]; if (argv[i][0] == '-') switch (argv[i][1]) { case 'g': - gamma = atof(argv[++i]); + gamcor = atof(argv[++i]); break; case 'r': reverse = !reverse; @@ -93,7 +104,7 @@ char *argv[]; quiterr(msg); } /* set gamma */ - setcolrgam(gamma); + setcolrgam(gamcor); /* convert */ if (reverse) { /* get header */ @@ -105,12 +116,12 @@ char *argv[]; printargs(i, argv, stdout); fputformat(COLRFMT, stdout); putchar('\n'); - fputresolu(YMAJOR|YDECR, head.x, head.y, stdout); + fprtresolu(head.x, head.y, stdout); /* convert file */ tg2ra(&head); } else { if (checkheader(stdin, COLRFMT, NULL) < 0 || - fgetresolu(&head.x, &head.y, stdin) != (YMAJOR|YDECR)) + fgetresolu(&head.x, &head.y, stdin) < 0) quiterr("bad picture file"); /* assign header */ head.textSize = 0;