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

Comparing ray/src/rt/rcmain.c (file contents):
Revision 2.10 by greg, Wed Aug 7 05:10:09 2013 UTC vs.
Revision 2.14 by greg, Tue Feb 24 19:39:27 2015 UTC

# Line 13 | Line 13 | static const char      RCSid[] = "$Id$";
13   #include "random.h"
14   #include "source.h"
15   #include "ambient.h"
16 + #include "pmapray.h"
17 + #include "pmapcontrib.h"
18  
19   int     gargc;                          /* global argc */
20   char    **gargv;                        /* global argv */
# Line 169 | Line 171 | main(int argc, char *argv[])
171                                  case '-': case '0': var = 0; break; \
172                                  default: goto badopt; }
173          char    *curout = NULL;
174 +        char    *prms = NULL;
175          char    *binval = NULL;
176          int     bincnt = 0;
177          int     rval;
# Line 268 | Line 271 | main(int argc, char *argv[])
271                  case 'h':                       /* header output */
272                          bool(2,header);
273                          break;
274 +                case 'p':                       /* parameter setting(s) */
275 +                        check(2,"s");
276 +                        set_eparams(prms = argv[++i]);
277 +                        break;
278                  case 'b':                       /* bin expression/count */
279                          if (argv[i][2] == 'n') {
280                                  check(3,"s");
# Line 279 | Line 286 | main(int argc, char *argv[])
286                          break;
287                  case 'm':                       /* modifier name */
288                          check(2,"s");
289 <                        addmodifier(argv[++i], curout, binval, bincnt);
289 >                        addmodifier(argv[++i], curout, prms, binval, bincnt);
290                          break;
291                  case 'M':                       /* modifier file */
292                          check(2,"s");
293 <                        addmodfile(argv[++i], curout, binval, bincnt);
293 >                        addmodfile(argv[++i], curout, prms, binval, bincnt);
294                          break;
295                  default:
296                          goto badopt;
297                  }
298          }
299 +        if (nmods <= 0)
300 +                error(USER, "missing required modifier argument");
301                                          /* override some option settings */
302          override_options();
303                                          /* initialize object types */
# Line 333 | Line 342 | main(int argc, char *argv[])
342          readoct(octname, ~(IO_FILES|IO_INFO), &thescene, NULL);
343          nsceneobjs = nobjects;
344  
345 +        /* PMAP: set up & load photon maps */
346 +        ray_init_pmap();    
347 +        
348          marksources();                  /* find and mark sources */
349 +        
350 +        /* PMAP: init photon map for light source contributions */
351 +        initPmapContrib(&modconttab, nmods);
352  
353          setambient();                   /* initialize ambient calculation */
354 <
354 >        
355          rcontrib();                     /* trace ray contributions (loop) */
356  
357          ambsync();                      /* flush ambient file */
358  
359 +        /* PMAP: free photon maps */
360 +        ray_done_pmap();    
361 +        
362          quit(0);        /* exit clean */
363  
364   badopt:
365          fprintf(stderr,
366 < "Usage: %s [-n nprocs][-V][-r][-e expr][-f source][-o ospec][-b binv][-bn N] {-m mod | -M file} [rtrace options] octree\n",
366 > "Usage: %s [-n nprocs][-V][-r][-e expr][-f source][-o ospec][-p p1=V1,p2=V2][-b binv][-bn N] {-m mod | -M file} [rtrace options] octree\n",
367                          progname);
368          sprintf(errmsg, "command line error at '%s'", argv[i]);
369          error(USER, errmsg);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines