--- ray/src/rt/rtmain.c 2009/12/12 19:01:00 2.18 +++ ray/src/rt/rtmain.c 2013/08/07 05:10:09 2.22 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rtmain.c,v 2.18 2009/12/12 19:01:00 greg Exp $"; +static const char RCSid[] = "$Id: rtmain.c,v 2.22 2013/08/07 05:10:09 greg Exp $"; #endif /* * rtmain.c - main for rtrace per-ray calculation program @@ -77,8 +77,8 @@ main(int argc, char *argv[]) default: goto badopt; } int persist = 0; char *octnm = NULL; - char **tralp; - int duped1; + char **tralp = NULL; + int duped1 = -1; int rval; int i; /* global program name */ @@ -88,6 +88,7 @@ main(int argc, char *argv[]) ; addobjnotify[i] = tranotify; /* set our defaults */ + rand_samp = 1; maxdepth = -10; minweight = 2e-3; /* option city */ @@ -251,9 +252,7 @@ main(int argc, char *argv[]) if (nproc > 1) { if (persist) error(USER, "multiprocessing incompatible with persist file"); - if (imm_irrad) - error(USER, "multiprocessing incompatible with immediate irradiance"); - if (hresolu > 0 && hresolu < nproc) + if (!vresolu && hresolu > 0 && hresolu < nproc) error(WARNING, "number of cores should not exceed horizontal resolution"); if (trace != NULL) error(WARNING, "multiprocessing does not work properly with trace mode"); @@ -354,10 +353,8 @@ runagain: if (persist) dupheader(); /* send header to stdout */ #endif - if (nproc > 1) /* start multiprocessing */ - ray_popen(nproc); /* trace rays */ - rtrace(NULL); + rtrace(NULL, nproc); /* flush ambient file */ ambsync(); #ifdef PERSIST @@ -462,7 +459,8 @@ printdefaults(void) /* print default values to stdou if (imm_irrad) printf("-I+\t\t\t\t# immediate irradiance on\n"); printf("-n %-2d\t\t\t\t# number of rendering processes\n", nproc); - printf("-x %-9d\t\t\t# x resolution (flush interval)\n", hresolu); + printf("-x %-9d\t\t\t# %s\n", hresolu, + vresolu && hresolu ? "x resolution" : "flush interval"); printf("-y %-9d\t\t\t# y resolution\n", vresolu); printf(lim_dist ? "-ld+\t\t\t\t# limit distance on\n" : "-ld-\t\t\t\t# limit distance off\n");