ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/Development/ray/src/rt/rcmain.c
(Generate patch)

Comparing ray/src/rt/rcmain.c (file contents):
Revision 2.28 by greg, Fri Feb 24 18:25:36 2023 UTC vs.
Revision 2.43 by greg, Fri Jun 20 16:34:23 2025 UTC

# Line 19 | Line 19 | static const char      RCSid[] = "$Id$";
19   int     gargc;                          /* global argc */
20   char    **gargv;                        /* global argv */
21   char    *octname;                       /* global octree name */
22 char    *progname;                      /* global argv[0] */
22  
23   char    *sigerr[NSIG];                  /* signal error messages */
24  
# Line 49 | Line 48 | char   **modname = NULL;               /* ordered modifier name list
48   int     nmods = 0;                      /* number of modifiers */
49   int     modasiz = 0;                    /* allocated modifier array size */
50  
51 < void    (*addobjnotify[8])() = {ambnotify, NULL};
51 > void    (*addobjnotify[])() = {ambnotify, NULL};
52  
53   char    RCCONTEXT[] = "RC.";            /* our special evaluation context */
54  
55   #if defined(_WIN32) || defined(_WIN64)
56   #define RCONTRIB_FEATURES       "Accumulation\nSummation\nRecovery\n" \
57 <                                "ValueContribution\nImmediateIrradiance\n" \
57 >                                "ImmediateIrradiance\n" \
58                                  "ProgressReporting\nDistanceLimiting\n" \
59 <                                "Outputs=V,W\n"
59 >                                "InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \
60 >                                "Outputs=V,W\n" \
61 >                                "OutputCS=RGB,spec\n"
62   #else
63   #define RCONTRIB_FEATURES       "Multiprocessing\n" \
64                                  "Accumulation\nSummation\nRecovery\n" \
65 <                                "ValueContribution\nImmediateIrradiance\n" \
65 >                                "ImmediateIrradiance\n" \
66                                  "ProgressReporting\nDistanceLimiting\n" \
67 <                                "Outputs=V,W\n"
67 >                                "InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \
68 >                                "Outputs=V,W\n" \
69 >                                "OutputCS=RGB,spec\n"
70   #endif
71  
72   static void
# Line 80 | Line 83 | printdefaults(void)                    /* print default values to stdou
83          printf("-y %-9d\t\t\t# y resolution\n", yres);
84          printf(lim_dist ? "-ld+\t\t\t\t# limit distance on\n" :
85                          "-ld-\t\t\t\t# limit distance off\n");
86 <        printf("-h%c\t\t\t\t# %s header\n", header ? '+' : '-',
87 <                        header ? "output" : "no");
86 >        printf(header ? "-h+\t\t\t\t# output header\n" :
87 >                        "-h-\t\t\t\t# no header\n");
88          printf("-f%c%c\t\t\t\t# format input/output = %s/%s\n",
89                          inpfmt, outfmt, formstr(inpfmt), formstr(outfmt));
90 +        if (report_intvl > 0)
91 +                printf("-t %-9d\t\t\t#  time between reports\n", report_intvl);
92          printf(erract[WARNING].pf != NULL ?
93                          "-w+\t\t\t\t# warning messages on\n" :
94                          "-w-\t\t\t\t# warning messages off\n");
# Line 192 | Line 197 | main(int argc, char *argv[])
197          int     rval;
198          int     i;
199                                          /* global program name */
200 <        progname = argv[0] = fixargv0(argv[0]);
200 >        argv[0] = fixargv0(argv[0]);
201          gargv = argv;
202          gargc = argc;
203                                          /* feature check only? */
204          strcat(RFeatureList, RCONTRIB_FEATURES);
205          if (argc > 1 && !strcmp(argv[1], "-features"))
206                  return feature_status(argc-2, argv+2);
202 #if defined(_WIN32) || defined(_WIN64)
203
207   #if defined(_WIN32) || defined(_WIN64)  /* increase file limit to maximum */
208          for (i = 8192; i > _IOB_ENTRIES; i >>= 1)
209 <                if (_setmaxstdio(i) == 0)
209 >                if (_setmaxstdio(i) == i)
210                          break;
211   #endif
212 <                                        /* initialize calcomp routines early */
210 <        initfunc();
212 >        initfunc();                     /* initialize calcomp routines */
213          calcontext(RCCONTEXT);
214                                          /* option city */
215          for (i = 1; i < argc; i++) {
# Line 259 | Line 261 | main(int argc, char *argv[])
261                          if (rval) erract[WARNING].pf = wputs;
262                          else erract[WARNING].pf = NULL;
263                          break;
262                case 'e':                       /* expression */
263                        check(2,"s");
264                        scompile(argv[++i], NULL, 0);
265                        break;
264                  case 'l':                       /* limit distance */
265                          if (argv[i][2] != 'd')
266                                  goto badopt;
# Line 271 | Line 269 | main(int argc, char *argv[])
269                  case 'I':                       /* immed. irradiance */
270                          check_bool(2,imm_irrad);
271                          break;
272 <                case 'f':                       /* file or force or format */
275 <                        if (!argv[i][2]) {
276 <                                check(2,"s");
277 <                                loadfunc(argv[++i]);
278 <                                break;
279 <                        }
272 >                case 'f':                       /* force or format */
273                          if (argv[i][2] == 'o') {
274                                  check_bool(3,force_open);
275                                  break;
# Line 287 | Line 280 | main(int argc, char *argv[])
280                          check(2,"s");
281                          curout = argv[++i];
282                          break;
290                case 'c':                       /* input rays per output */
291                        check(2,"i");
292                        accumulate = atoi(argv[++i]);
293                        break;
283                  case 'r':                       /* recover output */
284                          check_bool(2,recover);
285                          break;
# Line 301 | Line 290 | main(int argc, char *argv[])
290                          check(2,"s");
291                          set_eparams(prms = argv[++i]);
292                          break;
293 +                case 'c':                       /* sample count */
294 +                        check(2,"i");
295 +                        accumulate = atoi(argv[++i]);
296 +                        break;
297                  case 'b':                       /* bin expression/count */
298                          if (argv[i][2] == 'n') {
299                                  check(3,"s");
# Line 330 | Line 323 | main(int argc, char *argv[])
323                  error(USER, "missing required modifier argument");
324                                          /* override some option settings */
325          override_options();
326 +                                        /* set/check spectral sampling */
327 +        if (setspectrsamp(CNDX, WLPART) < 0)
328 +                error(USER, "unsupported spectral sampling");
329                                          /* initialize object types */
330          initotypes();
331                                          /* initialize urand */
# Line 384 | Line 380 | main(int argc, char *argv[])
380          
381          rcontrib();                     /* trace ray contributions (loop) */
382  
387        ambsync();                      /* flush ambient file */
388
383          /* PMAP: free photon maps */
384          ray_done_pmap();    
385          
# Line 410 | Line 404 | wputs(                         /* warning output function */
404   )
405   {
406          int  lasterrno = errno;
407 +        if (erract[WARNING].pf == NULL)
408 +                return;         /* called by calcomp or someone */
409          eputs(s);
410          errno = lasterrno;
411   }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)