--- ray/src/util/rad.c 2015/05/27 14:26:04 2.117 +++ ray/src/util/rad.c 2015/10/28 02:52:17 2.123 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rad.c,v 2.117 2015/05/27 14:26:04 greg Exp $"; +static const char RCSid[] = "$Id: rad.c,v 2.123 2015/10/28 02:52:17 greg Exp $"; #endif /* * Executive program for oconv, rpict and pfilt @@ -9,6 +9,7 @@ static const char RCSid[] = "$Id: rad.c,v 2.117 2015/0 #include #include +#include #include "platform.h" #include "rtprocess.h" @@ -644,6 +645,8 @@ mkpmap(void) /* run mkpmap if indicated */ for (cp = combuf; *cp; cp++) ; mkpmapopts(cp); + /* force file overwrite */ + cp = addarg(cp, "-fo+"); if (vdef(REPORT)) { char errfile[256]; int n; @@ -657,16 +660,12 @@ mkpmap(void) /* run mkpmap if indicated */ badvalue(REPORT); } if (pgmapname != NULL && pgmapdate < oct1date) { - if (pgmapdate) - rmfile(pgmapname); cp = addarg(cp, "-apg"); addarg(cp, vval(PGMAP)); cp = sskip(sskip(cp)); /* remove any bandwidth */ *cp = '\0'; } if (pcmapname != NULL && pcmapdate < oct1date) { - if (pcmapdate) - rmfile(pcmapname); cp = addarg(cp, "-apc"); addarg(cp, vval(PCMAP)); cp = sskip(sskip(cp)); /* remove any bandwidth */ @@ -807,6 +806,13 @@ renderopts( /* set rendering options */ { char pmapf[256], *bw; + if (vdef(PGMAP)) { + *op = '\0'; + bw = sskip2(vval(PGMAP), 2); + atos(pmapf, sizeof(pmapf), vval(PGMAP)); + op = addarg(addarg(op, "-ap"), pmapf); + if (atoi(bw) > 0) op = addarg(op, bw); + } switch(vscale(QUALITY)) { case LOW: lowqopts(op, po); @@ -818,12 +824,6 @@ renderopts( /* set rendering options */ hiqopts(op, po); break; } - if (vdef(PGMAP)) { - bw = sskip2(vval(PGMAP), 2); - atos(pmapf, sizeof(pmapf), vval(PGMAP)); - op = addarg(addarg(op, "-ap"), pmapf); - if (atoi(bw) > 0) op = addarg(op, bw); - } if (vdef(PCMAP)) { bw = sskip2(vval(PCMAP), 2); atos(pmapf, sizeof(pmapf), vval(PCMAP)); @@ -833,19 +833,21 @@ renderopts( /* set rendering options */ if (vdef(RENDER)) op = addarg(op, vval(RENDER)); if (rvdevice != NULL) { - if (vdef(RVU)) + if (vdef(RVU)) { if (vval(RVU)[0] != '-') { atos(c_rvu, sizeof(c_rvu), vval(RVU)); po = addarg(po, sskip2(vval(RVU), 1)); } else po = addarg(po, vval(RVU)); + } } else { - if (vdef(RPICT)) + if (vdef(RPICT)) { if (vval(RPICT)[0] != '-') { atos(c_rpict, sizeof(c_rpict), vval(RPICT)); po = addarg(po, sskip2(vval(RPICT), 1)); } else po = addarg(po, vval(RPICT)); + } } } @@ -1146,12 +1148,13 @@ pfiltopts( /* get pfilt options */ po = addarg(po, "-m .25"); break; } - if (vdef(PFILT)) + if (vdef(PFILT)) { if (vval(PFILT)[0] != '-') { atos(c_pfilt, sizeof(c_pfilt), vval(PFILT)); po = addarg(po, sskip2(vval(PFILT), 1)); } else po = addarg(po, vval(PFILT)); + } } @@ -1342,7 +1345,7 @@ getview( /* get view n, or NULL if none */ } numview: mv = nvalue(VIEWS, n); /* use view n */ - if ((vn != NULL) & (mv != NULL)) + if ((vn != NULL) & (mv != NULL)) { if (*mv != '-') { char *mv2 = mv; while (*mv2 && !isspace(*mv2)) @@ -1350,7 +1353,7 @@ numview: *vn = '\0'; } else sprintf(vn, "%d", n+1); - + } return(specview(mv)); } @@ -1518,6 +1521,7 @@ rpict( /* run rpict and pfilt for each view */ fprintf(stderr, "%s: cannot create\n", pfile); quit(1); } + pfile[-5] = '\0'; pfile = NULL; } }