--- ray/src/rt/rpmain.c 2004/03/30 16:13:01 2.8 +++ ray/src/rt/rpmain.c 2013/08/07 05:10:09 2.15 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rpmain.c,v 2.8 2004/03/30 16:13:01 schorsch Exp $"; +static const char RCSid[] = "$Id: rpmain.c,v 2.15 2013/08/07 05:10:09 greg Exp $"; #endif /* * rpmain.c - main for rpict batch rendering program @@ -7,7 +7,7 @@ static const char RCSid[] = "$Id: rpmain.c,v 2.8 2004/ #include "copyright.h" -#include +#include #include #include "platform.h" @@ -49,6 +49,8 @@ extern double dstrpix; /* square pixel distribution extern double mblur; /* motion blur parameter */ +extern double dblur; /* depth-of-field blur parameter */ + static void onsig(int signo); static void sigdie(int signo, char *msg); static void printdefaults(void); @@ -74,7 +76,7 @@ main(int argc, char *argv[]) int loadflags = ~IO_FILES; int seqstart = 0; int persist = 0; - int duped1; + int duped1 = -1; int rval; int i; /* record start time */ @@ -152,6 +154,10 @@ main(int argc, char *argv[]) check(3,"f"); mblur = atof(argv[++i]); break; + case 'd': /* aperture */ + check(3,"f"); + dblur = atof(argv[++i]); + break; default: goto badopt; } @@ -220,7 +226,13 @@ main(int argc, char *argv[]) /* initialize object types */ initotypes(); /* initialize urand */ - initurand(2048); + if (rand_samp) { + srandom((long)time(0)); + initurand(0); + } else { + srandom(0L); + initurand(2048); + } /* set up signal handling */ sigdie(SIGINT, "Interrupt"); #ifdef SIGHUP @@ -305,10 +317,11 @@ main(int argc, char *argv[]) pflock(1); pfhold(); tstart = time((time_t *)NULL); + ambsync(); /* load new values */ } if (rval < 0) error(SYSTEM, "cannot fork child for persist function"); - pfdetach(); /* parent exits */ + pfdetach(); /* parent will run then exit */ } } runagain: @@ -429,6 +442,7 @@ printdefaults(void) /* print default values to stdou ourview.type==VT_HEM ? "hemispherical" : ourview.type==VT_ANG ? "angular" : ourview.type==VT_CYL ? "cylindrical" : + ourview.type==VT_PLS ? "planisphere" : "unknown"); printf("-vp %f %f %f\t# view point\n", ourview.vp[0], ourview.vp[1], ourview.vp[2]); @@ -447,6 +461,7 @@ printdefaults(void) /* print default values to stdou printf("-pa %f\t\t\t# pixel aspect ratio\n", pixaspect); printf("-pj %f\t\t\t# pixel jitter\n", dstrpix); printf("-pm %f\t\t\t# pixel motion\n", mblur); + printf("-pd %f\t\t\t# pixel depth-of-field\n", dblur); printf("-ps %-9d\t\t\t# pixel sample\n", psample); printf("-pt %f\t\t\t# pixel threshold\n", maxdiff); printf("-t %-9d\t\t\t# time between reports\n", ralrm);