--- ray/src/rt/rcmain.c 2022/10/20 17:18:32 2.24 +++ ray/src/rt/rcmain.c 2024/01/17 01:31:08 2.34 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rcmain.c,v 2.24 2022/10/20 17:18:32 greg Exp $"; +static const char RCSid[] = "$Id: rcmain.c,v 2.34 2024/01/17 01:31:08 greg Exp $"; #endif /* * rcmain.c - main for rtcontrib ray contribution tracer @@ -55,14 +55,16 @@ char RCCONTEXT[] = "RC."; /* our special evaluation c #if defined(_WIN32) || defined(_WIN64) #define RCONTRIB_FEATURES "Accumulation\nSummation\nRecovery\n" \ - "ValueContribution\nImmediateIrradiance\n" \ + "ImmediateIrradiance\n" \ "ProgressReporting\nDistanceLimiting\n" \ + "InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \ "Outputs=V,W\n" #else #define RCONTRIB_FEATURES "Multiprocessing\n" \ "Accumulation\nSummation\nRecovery\n" \ - "ValueContribution\nImmediateIrradiance\n" \ + "ImmediateIrradiance\n" \ "ProgressReporting\nDistanceLimiting\n" \ + "InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \ "Outputs=V,W\n" #endif @@ -80,8 +82,8 @@ printdefaults(void) /* print default values to stdou printf("-y %-9d\t\t\t# y resolution\n", yres); printf(lim_dist ? "-ld+\t\t\t\t# limit distance on\n" : "-ld-\t\t\t\t# limit distance off\n"); - printf("-h%c\t\t\t\t# %s header\n", header ? '+' : '-', - header ? "output" : "no"); + printf(header ? "-h+\t\t\t\t# output header\n" : + "-h-\t\t\t\t# no header\n"); printf("-f%c%c\t\t\t\t# format input/output = %s/%s\n", inpfmt, outfmt, formstr(inpfmt), formstr(outfmt)); printf(erract[WARNING].pf != NULL ? @@ -197,10 +199,12 @@ main(int argc, char *argv[]) gargc = argc; /* feature check only? */ strcat(RFeatureList, RCONTRIB_FEATURES); - if (!strcmp(argv[1], "-features")) + if (argc > 1 && !strcmp(argv[1], "-features")) return feature_status(argc-2, argv+2); -#if defined(_WIN32) || defined(_WIN64) - _setmaxstdio(2048); /* increase file limit to maximum */ +#if defined(_WIN32) || defined(_WIN64) /* increase file limit to maximum */ + for (i = 8192; i > _IOB_ENTRIES; i >>= 1) + if (_setmaxstdio(i) == i) + break; #endif /* initialize calcomp routines early */ initfunc(); @@ -283,10 +287,6 @@ main(int argc, char *argv[]) check(2,"s"); curout = argv[++i]; break; - case 'c': /* input rays per output */ - check(2,"i"); - accumulate = atoi(argv[++i]); - break; case 'r': /* recover output */ check_bool(2,recover); break; @@ -297,6 +297,10 @@ main(int argc, char *argv[]) check(2,"s"); set_eparams(prms = argv[++i]); break; + case 'c': /* sample count */ + check(2,"i"); + accumulate = atoi(argv[++i]); + break; case 'b': /* bin expression/count */ if (argv[i][2] == 'n') { check(3,"s"); @@ -326,6 +330,10 @@ main(int argc, char *argv[]) error(USER, "missing required modifier argument"); /* override some option settings */ override_options(); + /* set/check spectral sampling */ + rval = setspectrsamp(CNDX, WLPART); + if (rval < 0) + error(USER, "unsupported spectral sampling"); /* initialize object types */ initotypes(); /* initialize urand */ @@ -402,7 +410,7 @@ badopt: void wputs( /* warning output function */ - char *s + const char *s ) { int lasterrno = errno; @@ -413,7 +421,7 @@ wputs( /* warning output function */ void eputs( /* put string to stderr */ - char *s + const char *s ) { static int midline = 0;