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.32 by greg, Wed Nov 15 18:02:53 2023 UTC vs.
Revision 2.42 by greg, Thu Jun 5 18:26:46 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 55 | Line 54 | char   RCCONTEXT[] = "RC.";            /* our special evaluation c
54  
55   #if defined(_WIN32) || defined(_WIN64)
56   #define RCONTRIB_FEATURES       "Accumulation\nSummation\nRecovery\n" \
57 <                                "Hyperspectral\nImmediateIrradiance\n" \
57 >                                "ImmediateIrradiance\n" \
58                                  "ProgressReporting\nDistanceLimiting\n" \
59                                  "InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \
60 <                                "Outputs=V,W\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 <                                "Hyperspectral\nImmediateIrradiance\n" \
65 >                                "ImmediateIrradiance\n" \
66                                  "ProgressReporting\nDistanceLimiting\n" \
67                                  "InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \
68 <                                "Outputs=V,W\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 */
74   {
75          printf("-c %-5d\t\t\t# accumulated rays per record\n", accumulate);
75        if (NCSAMP > 3) {
76                printf("-cs %-2d\t\t\t\t# number of spectral bins\n", NCSAMP);
77                printf("-cw %3.0f %3.0f\t\t\t# wavelength limits (nm)\n",
78                                WLPART[3], WLPART[0]);
79        }
76          printf("-V%c\t\t\t\t# output %s\n", contrib ? '+' : '-',
77                          contrib ? "contributions" : "coefficients");
78          if (imm_irrad)
# Line 91 | Line 87 | printdefaults(void)                    /* print default values to stdou
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 199 | 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? */
# Line 211 | Line 209 | main(int argc, char *argv[])
209                  if (_setmaxstdio(i) == i)
210                          break;
211   #endif
212 <                                        /* initialize calcomp routines early */
215 <        initfunc();
212 >        initfunc();                     /* initialize calcomp routines */
213          calcontext(RCCONTEXT);
214                                          /* option city */
215          for (i = 1; i < argc; i++) {
# Line 264 | Line 261 | main(int argc, char *argv[])
261                          if (rval) erract[WARNING].pf = wputs;
262                          else erract[WARNING].pf = NULL;
263                          break;
267                case 'e':                       /* expression */
268                        check(2,"s");
269                        scompile(argv[++i], NULL, 0);
270                        break;
264                  case 'l':                       /* limit distance */
265                          if (argv[i][2] != 'd')
266                                  goto badopt;
# Line 276 | 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 */
280 <                        if (!argv[i][2]) {
281 <                                check(2,"s");
282 <                                loadfunc(argv[++i]);
283 <                                break;
284 <                        }
272 >                case 'f':                       /* force or format */
273                          if (argv[i][2] == 'o') {
274                                  check_bool(3,force_open);
275                                  break;
# Line 302 | Line 290 | main(int argc, char *argv[])
290                          check(2,"s");
291                          set_eparams(prms = argv[++i]);
292                          break;
293 <                case 'c':                               /* spectral sampling or count */
294 <                        switch (argv[i][2]) {
295 < #if MAXCSAMP>3
308 <                        case 's':                       /* spectral bin count */
309 <                                check(3,"i");
310 <                                NCSAMP = atoi(argv[++i]);
311 <                                break;
312 <                        case 'w':                       /* wavelength extrema */
313 <                                check(3,"ff");
314 <                                WLPART[0] = atof(argv[++i]);
315 <                                WLPART[3] = atof(argv[++i]);
316 <                                break;
317 < #endif
318 <                        case '\0':                      /* sample count */
319 <                                check(2,"i");
320 <                                accumulate = atoi(argv[++i]);
321 <                                break;
322 <                        default:
323 <                                goto badopt;
324 <                        }
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') {
# Line 352 | 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 406 | Line 380 | main(int argc, char *argv[])
380          
381          rcontrib();                     /* trace ray contributions (loop) */
382  
409        ambsync();                      /* flush ambient file */
410
383          /* PMAP: free photon maps */
384          ray_done_pmap();    
385          
# Line 432 | 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)