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.23 by greg, Wed Oct 19 23:10:34 2022 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" \
58 <                                "ProgressReporting\nDistanceLimiting\n"
57 >                                "ImmediateIrradiance\n" \
58 >                                "ProgressReporting\nDistanceLimiting\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" \
66 <                                "ProgressReporting\nDistanceLimiting\n"
65 >                                "ImmediateIrradiance\n" \
66 >                                "ProgressReporting\nDistanceLimiting\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 78 | 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 190 | 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 (!strcmp(argv[1], "-features"))
205 >        if (argc > 1 && !strcmp(argv[1], "-features"))
206                  return feature_status(argc-2, argv+2);
207 < #if defined(_WIN32) || defined(_WIN64)
208 <        _setmaxstdio(2048);             /* increase file limit to maximum */
207 > #if defined(_WIN32) || defined(_WIN64)  /* increase file limit to maximum */
208 >        for (i = 8192; i > _IOB_ENTRIES; i >>= 1)
209 >                if (_setmaxstdio(i) == i)
210 >                        break;
211   #endif
212 <                                        /* initialize calcomp routines early */
204 <        initfunc();
212 >        initfunc();                     /* initialize calcomp routines */
213          calcontext(RCCONTEXT);
214                                          /* option city */
215          for (i = 1; i < argc; i++) {
# Line 253 | Line 261 | main(int argc, char *argv[])
261                          if (rval) erract[WARNING].pf = wputs;
262                          else erract[WARNING].pf = NULL;
263                          break;
256                case 'e':                       /* expression */
257                        check(2,"s");
258                        scompile(argv[++i], NULL, 0);
259                        break;
264                  case 'l':                       /* limit distance */
265                          if (argv[i][2] != 'd')
266                                  goto badopt;
# Line 265 | 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 */
269 <                        if (!argv[i][2]) {
270 <                                check(2,"s");
271 <                                loadfunc(argv[++i]);
272 <                                break;
273 <                        }
272 >                case 'f':                       /* force or format */
273                          if (argv[i][2] == 'o') {
274                                  check_bool(3,force_open);
275                                  break;
# Line 281 | Line 280 | main(int argc, char *argv[])
280                          check(2,"s");
281                          curout = argv[++i];
282                          break;
284                case 'c':                       /* input rays per output */
285                        check(2,"i");
286                        accumulate = atoi(argv[++i]);
287                        break;
283                  case 'r':                       /* recover output */
284                          check_bool(2,recover);
285                          break;
# Line 295 | 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 324 | 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 378 | Line 380 | main(int argc, char *argv[])
380          
381          rcontrib();                     /* trace ray contributions (loop) */
382  
381        ambsync();                      /* flush ambient file */
382
383          /* PMAP: free photon maps */
384          ray_done_pmap();    
385          
# Line 400 | Line 400 | badopt:
400  
401   void
402   wputs(                          /* warning output function */
403 <        char    *s
403 >        const char      *s
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   }
# Line 411 | Line 413 | wputs(                         /* warning output function */
413  
414   void
415   eputs(                          /* put string to stderr */
416 <        char  *s
416 >        const char  *s
417   )
418   {
419          static int  midline = 0;

Diff Legend

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