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.19 by greg, Wed Sep 9 21:28:19 2020 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 45 | Line 44 | int    lim_dist = 0;                   /* limit distance? */
44  
45   int     report_intvl = 0;               /* reporting interval (seconds) */
46  
47 < const char      *modname[MAXMODLIST];   /* ordered modifier name list */
48 < int             nmods = 0;              /* number of modifiers */
47 > 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 +                                "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 +                                "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
73   printdefaults(void)                     /* print default values to stdout */
# Line 67 | 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 179 | 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 < #if defined(_WIN32) || defined(_WIN64)
204 <        _setmaxstdio(2048);             /* increase file limit to maximum */
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);
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 */
213 <        initfunc();
190 <        setcontext(RCCONTEXT);
212 >        initfunc();                     /* initialize calcomp routines */
213 >        calcontext(RCCONTEXT);
214                                          /* option city */
215          for (i = 1; i < argc; i++) {
216                                                  /* expand arguments */
# Line 238 | Line 261 | main(int argc, char *argv[])
261                          if (rval) erract[WARNING].pf = wputs;
262                          else erract[WARNING].pf = NULL;
263                          break;
241                case 'e':                       /* expression */
242                        check(2,"s");
243                        scompile(argv[++i], NULL, 0);
244                        break;
264                  case 'l':                       /* limit distance */
265                          if (argv[i][2] != 'd')
266                                  goto badopt;
# Line 250 | 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 */
254 <                        if (!argv[i][2]) {
255 <                                check(2,"s");
256 <                                loadfunc(argv[++i]);
257 <                                break;
258 <                        }
272 >                case 'f':                       /* force or format */
273                          if (argv[i][2] == 'o') {
274                                  check_bool(3,force_open);
275                                  break;
# Line 266 | Line 280 | main(int argc, char *argv[])
280                          check(2,"s");
281                          curout = argv[++i];
282                          break;
269                case 'c':                       /* input rays per output */
270                        check(2,"i");
271                        accumulate = atoi(argv[++i]);
272                        break;
283                  case 'r':                       /* recover output */
284                          check_bool(2,recover);
285                          break;
# Line 280 | 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 309 | 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 363 | Line 380 | main(int argc, char *argv[])
380          
381          rcontrib();                     /* trace ray contributions (loop) */
382  
366        ambsync();                      /* flush ambient file */
367
383          /* PMAP: free photon maps */
384          ray_done_pmap();    
385          
# Line 385 | 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 396 | 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)