--- ray/src/util/rad.c 2015/05/27 14:12:09 2.115 +++ ray/src/util/rad.c 2015/10/22 18:09:37 2.122 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rad.c,v 2.115 2015/05/27 14:12:09 greg Exp $"; +static const char RCSid[] = "$Id: rad.c,v 2.122 2015/10/22 18:09:37 greg Exp $"; #endif /* * Executive program for oconv, rpict and pfilt @@ -9,6 +9,7 @@ static const char RCSid[] = "$Id: rad.c,v 2.115 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; @@ -803,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); @@ -814,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)); @@ -829,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)); + } } } @@ -1142,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)); + } }