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

Comparing ray/src/rt/mkpmap.c (file contents):
Revision 2.8 by rschregle, Fri Feb 2 19:47:55 2018 UTC vs.
Revision 2.10 by rschregle, Fri Aug 7 01:21:13 2020 UTC

# Line 9 | Line 9 | static const char RCSid[] = "$Id$";
9    
10     Roland Schregle (roland.schregle@{hslu.ch, gmail.com})
11     (c) Fraunhofer Institute for Solar Energy Systems,
12 <       Lucerne University of Applied Sciences & Arts
12 >       supported by the German Research Foundation (DFG)
13 >       under the FARESYS project.
14     (c) Lucerne University of Applied Sciences and Arts,
15 <       supported by the Swiss National Science Foundation (SNSF, #147053)
15 >       supported by the Swiss National Science Foundation (SNSF #147053).
16 >   (c) Tokyo University of Science,
17 >       supported by the JSPS KAKENHI Grant Number JP19KK0115.
18     ======================================================================
19    
20     $Id$    
# Line 20 | Line 23 | static const char RCSid[] = "$Id$";
23  
24   #include "pmap.h"
25   #include "pmapmat.h"
26 + #include "pmapsrc.h"
27   #include "pmapcontrib.h"
28   #include "pmaprand.h"
29   #include "paths.h"
# Line 49 | Line 53 | int      clobber = 0;               /* overwrite outpu
53   COLOR    cextinction = BLKCOLOR;    /* global extinction coefficient */
54   COLOR    salbedo = BLKCOLOR;        /* global scattering albedo */
55   double   seccg = 0;                 /* global scattering eccentricity */
56 < int      ambincl = -1;              /* photon port flag */
57 < char     *amblist [AMBLLEN + 1];    /* photon port list */
56 > char     *amblist [AMBLLEN + 1];    /* ambient include/exclude list */
57 > int      ambincl = -1;              /* include == 1, exclude == 0 */
58   char     *diagFile = NULL;          /* diagnostics output file */
59   int      rand_samp = 1;             /* uncorrelated random sampling */
60   unsigned nproc = 1;                 /* number of parallel processes */
# Line 80 | Line 84 | void printdefaults()
84     /* EvalDRC support */
85     puts("-A\t\t\t\t# angular source file");
86   #endif    
87 +   puts("-ae  mod\t\t\t\t# exclude modifier");
88 +   puts("-aE  file\t\t\t\t# exclude modifiers from file");
89 +   puts("-ai  mod\t\t\t\t# include modifier");
90 +   puts("-aI  file\t\t\t\t# include modifiers from file");
91   #ifdef PMAP_EKSPERTZ
92     puts("-api xmin ymin zmin xmax ymax zmax\t# region of interest");
93   #endif
# Line 92 | Line 100 | void printdefaults()
100     printf("-apD %f\t\t\t\t# predistribution factor\n", preDistrib);
101     printf("-apM %d\t\t\t\t\t# max predistrib passes\n", maxPreDistrib);
102   #if 1
103 <   /* Kept for backwards compat, will be gradually phased out by -lD, -lr */
103 >   /* Kept for backwards compat, will be gradually phased out by -ld, -lr */
104     printf("-apm %ld\t\t\t\t# limit photon bounces\n", photonMaxBounce);
105   #endif
106 <   puts("-apo mod\t\t\t\t# photon port modifier");
107 <   puts("-apO file\t\t\t\t# photon port file");
106 >   puts("-apo+ mod\t\t\t\t# photon port modifier");
107 >   puts("-apO+ file\t\t\t\t# photon ports from file");
108     printf("-apP %f\t\t\t\t# precomputation factor\n", finalGather);
109     printf("-apr %d\t\t\t\t\t# random seed\n", randSeed);
110     puts("-aps mod\t\t\t\t# antimatter sensor modifier");
111 <   puts("-apS file\t\t\t\t# antimatter sensor file");
111 >   puts("-apS file\t\t\t\t# antimatter sensors from file");
112  
113     printf(backvis ? "-bv+\t\t\t\t\t# back face visibility on\n"
114                    : "-bv-\t\t\t\t\t# back face visibility off\n");
# Line 110 | Line 118 | void printdefaults()
118     printf(clobber ? "-fo+\t\t\t\t\t# force overwrite\n"
119                    : "-fo-\t\t\t\t\t# do not overwrite\n");
120   #ifdef PMAP_EKSPERTZ
121 <   /* NU STUFF for Ze Exspertz! */      
121 >   /* (Formerly) NU STUFF for Ze Exspertz! */      
122     printf("-ld %.1f\t\t\t\t\t# limit photon distance\n", photonMaxDist);
123     printf("-lr %ld\t\t\t\t# limit photon bounces\n", photonMaxBounce);  
124   #endif  
# Line 121 | Line 129 | void printdefaults()
129            colval(cextinction,BLU));          
130     printf("-mg  %.2f\t\t\t\t# scattering eccentricity\n", seccg);
131   #if NIX  
132 <   /* Multiprocessing on NIX only */
132 >   /* Multiprocessing on NIX only; so tuff luck, Windoze Weenies! */
133     printf("-n   %d\t\t\t\t\t# number of parallel processes\n", nproc);
134   #endif  
135     printf("-t   %-9d\t\t\t\t# time between reports\n", photonRepTime);
# Line 132 | Line 140 | void printdefaults()
140  
141   int main (int argc, char* argv [])
142   {
143 <   #define check(ol, al) if (argv [i][ol] || \
144 <                             badarg(argc - i - 1,argv + i + 1, al)) \
145 <                            goto badopt
146 <                            
143 >   #define check(ol, al) if ( \
144 >      argv [i][ol] || badarg(argc - i - 1,argv + i + 1, al) \
145 >   ) goto badopt
146 >  
147 >   /* Evaluate boolean option, setting var accordingly */                        
148     #define check_bool(olen, var) switch (argv [i][olen]) { \
149 <                             case '\0': var = !var; break; \
150 <                             case 'y': case 'Y': case 't': case 'T': \
151 <                             case '+': case '1': var = 1; break; \
152 <                             case 'n': case 'N': case 'f': case 'F': \
153 <                             case '-': case '0': var = 0; break; \
154 <                             default: goto badopt; \
155 <                          }  
149 >      case '\0': \
150 >         var = !var; break; \
151 >      case 'y': case 'Y': case 't': case 'T': case '+': case '1': \
152 >         var = 1; break; \
153 >      case 'n': case 'N': case 'f': case 'F': case '-': case '0': \
154 >         var = 0; break; \
155 >      default: \
156 >         goto badopt; \
157 >   }
158 >  
159 >   /* Evaluate trinary option, setting bits v1 and v2 in var accordingly */
160 >   #define check_tri(olen, v1, v2, var) switch (argv [i][olen]) { \
161 >      case '\0': case '+': \
162 >         var = v1; break; \
163 >      case '-': \
164 >         var = v2; break;\
165 >      case '0': \
166 >         var = v1 | v2; break; \
167 >      default: \
168 >         goto badopt; \
169 >   }
170  
171 <   int loadflags = IO_CHECK | IO_SCENE | IO_TREE | IO_BOUNDS, rval, i;
172 <   char **portLp = NULL, **sensLp = photonSensorList;
173 <   struct stat pmstat;
171 >   int      loadflags = IO_CHECK | IO_SCENE | IO_TREE | IO_BOUNDS,
172 >            rval, i, j, n;
173 >   char     **portLp = photonPortList, **sensLp = photonSensorList,
174 >            **amblp = NULL, sbuf [MAXSTR], portFlags [2] = "\0\0";
175 >   struct   stat pmstat;
176  
177     /* Global program name */
178     progname = fixargv0(argv [0]);
# Line 183 | Line 208 | int main (int argc, char* argv [])
208        }
209              
210        switch (argv [i][1]) {
211 <         case 'a':
212 <            if (!strcmp(argv [i] + 2, "pg")) {
213 <               /* Global photon map */
214 <               check(4, "ss");
215 <               globalPmapParams.fileName = argv [++i];
216 <               globalPmapParams.distribTarget =
217 <                  parseMultiplier(argv [++i]);
218 <               if (!globalPmapParams.distribTarget)
219 <                  goto badopt;                        
220 <               globalPmapParams.minGather = globalPmapParams.maxGather = 0;
221 <            }                              
211 >         case 'a': /* Ambient */
212 >            switch (argv [i][2]) {
213 >               case 'i': /* Ambient include */
214 >               case 'I':
215 >                  check(3, "s");
216 >                  if (ambincl != 1) {
217 >                     ambincl = 1;
218 >                     amblp = amblist;
219 >                  }
220 >                  if (argv [i][2] == 'I') {    
221 >                     /* Add modifiers from file */
222 >                     rval = wordfile(amblp, AMBLLEN - (amblp - amblist),
223 >                                     getpath(argv [++i],
224 >                                     getrlibpath(), R_OK));
225 >                     if (rval < 0) {
226 >                        sprintf(errmsg,
227 >                                "cannot open ambient include file \"%s\"",
228 >                                argv [i]);
229 >                        error(SYSTEM, errmsg);
230 >                     }
231 >                     amblp += rval;
232 >                  }
233 >                  else {
234 >                     /* Add modifier from next arg */
235 >                     *amblp++ = savqstr(argv [++i]);
236 >                     *amblp = NULL;
237 >                  }
238 >                  break;
239 >
240 >               case 'e': /* Ambient exclude */
241 >               case 'E':
242 >                  check(3, "s");
243 >                  if (ambincl != 0) {
244 >                     ambincl = 0;
245 >                     amblp = amblist;
246 >                  }
247 >                  if (argv [i][2] == 'E') {
248 >                     /* Add modifiers from file */
249 >                     rval = wordfile(amblp, AMBLLEN - (amblp - amblist),
250 >                                     getpath(argv [++i],
251 >                                     getrlibpath(), R_OK));
252 >                     if (rval < 0) {
253 >                        sprintf(errmsg,
254 >                                "cannot open ambient exclude file \"%s\"",
255 >                                argv [i]);
256 >                        error(SYSTEM, errmsg);
257 >                     }
258 >                     amblp += rval;
259 >                  }
260 >                  else {
261 >                     /* Add modifier from next arg */
262 >                     *amblp++ = savqstr(argv [++i]);
263 >                     *amblp = NULL;
264 >                  }
265 >                  break;
266              
267 <            else if (!strcmp(argv [i] + 2, "pp")) {
268 <               /* Precomputed global photon map */
269 <               check(4, "ssi");
270 <               preCompPmapParams.fileName = argv [++i];
271 <               preCompPmapParams.distribTarget =
272 <                  parseMultiplier(argv [++i]);
273 <               if (!preCompPmapParams.distribTarget)
274 <                  goto badopt;
275 <               preCompPmapParams.minGather = preCompPmapParams.maxGather =
276 <                  atoi(argv [++i]);
277 <               if (!preCompPmapParams.maxGather)
278 <                  goto badopt;
210 <            }
267 >               case 'p': /* Pmap-specific */
268 >                  switch (argv [i][3]) {                        
269 >                     case 'g': /* Global photon map */
270 >                        check(4, "ss");
271 >                        globalPmapParams.fileName = argv [++i];
272 >                        globalPmapParams.distribTarget =
273 >                           parseMultiplier(argv [++i]);
274 >                        if (!globalPmapParams.distribTarget)
275 >                           goto badopt;                        
276 >                        globalPmapParams.minGather =
277 >                           globalPmapParams.maxGather = 0;
278 >                        break;
279              
280 <            else if (!strcmp(argv [i] + 2, "pc")) {
281 <               /* Caustic photon map */
282 <               check(4, "ss");
283 <               causticPmapParams.fileName = argv [++i];
284 <               causticPmapParams.distribTarget =
285 <                  parseMultiplier(argv [++i]);
286 <               if (!causticPmapParams.distribTarget)
287 <                  goto badopt;
288 <            }
280 >                     case 'p': /* Precomputed global photon map */
281 >                        check(4, "ssi");
282 >                        preCompPmapParams.fileName = argv [++i];
283 >                        preCompPmapParams.distribTarget =
284 >                           parseMultiplier(argv [++i]);
285 >                        if (!preCompPmapParams.distribTarget)
286 >                           goto badopt;
287 >                        preCompPmapParams.minGather =
288 >                           preCompPmapParams.maxGather = atoi(argv [++i]);
289 >                        if (!preCompPmapParams.maxGather)
290 >                           goto badopt;
291 >                        break;
292              
293 <            else if (!strcmp(argv [i] + 2, "pv")) {
294 <               /* Volume photon map */
295 <               check(4, "ss");
296 <               volumePmapParams.fileName = argv [++i];
297 <               volumePmapParams.distribTarget =
298 <                  parseMultiplier(argv [++i]);
299 <               if (!volumePmapParams.distribTarget)
300 <                  goto badopt;                      
301 <            }
302 <            
303 <            else if (!strcmp(argv [i] + 2, "pd")) {
304 <               /* Direct photon map */
305 <               check(4, "ss");
306 <               directPmapParams.fileName = argv [++i];
307 <               directPmapParams.distribTarget =
308 <                  parseMultiplier(argv [++i]);
309 <               if (!directPmapParams.distribTarget)
310 <                  goto badopt;
311 <            }
312 <            
313 <            else if (!strcmp(argv [i] + 2, "pC")) {
314 <               /* Light source contribution photon map */
315 <               check(4, "ss");
316 <               contribPmapParams.fileName = argv [++i];
317 <               contribPmapParams.distribTarget =
318 <                  parseMultiplier(argv [++i]);
319 <               if (!contribPmapParams.distribTarget)
320 <                  goto badopt;
321 <            }
293 >                     case 'c': /* Caustic photon map */
294 >                        check(4, "ss");
295 >                        causticPmapParams.fileName = argv [++i];
296 >                        causticPmapParams.distribTarget =
297 >                           parseMultiplier(argv [++i]);
298 >                        if (!causticPmapParams.distribTarget)
299 >                           goto badopt;
300 >                        break;
301 >                  
302 >                     case 'v': /* Volume photon map */
303 >                        check(4, "ss");
304 >                        volumePmapParams.fileName = argv [++i];
305 >                        volumePmapParams.distribTarget =
306 >                           parseMultiplier(argv [++i]);
307 >                        if (!volumePmapParams.distribTarget)
308 >                           goto badopt;                      
309 >                        break;
310 >                    
311 >                     case 'd': /* Direct photon map */
312 >                        check(4, "ss");
313 >                        directPmapParams.fileName = argv [++i];
314 >                        directPmapParams.distribTarget =
315 >                           parseMultiplier(argv [++i]);
316 >                        if (!directPmapParams.distribTarget)
317 >                           goto badopt;
318 >                        break;
319 >                    
320 >                     case 'C': /* Contribution photon map */
321 >                        check(4, "ss");
322 >                        contribPmapParams.fileName = argv [++i];
323 >                        contribPmapParams.distribTarget =
324 >                           parseMultiplier(argv [++i]);
325 >                        if (!contribPmapParams.distribTarget)
326 >                           goto badopt;
327 >                        break;
328  
329 <            else if (!strcmp(argv [i] + 2, "pD")) {
330 <               /* Predistribution factor */
331 <               check(4, "f");
332 <               preDistrib = atof(argv [++i]);
333 <               if (preDistrib <= 0)
334 <                  error(USER, "predistribution factor must be > 0");
258 <            }
329 >                     case 'D': /* Predistribution factor */
330 >                        check(4, "f");
331 >                        preDistrib = atof(argv [++i]);
332 >                        if (preDistrib <= 0)
333 >                           error(USER, "predistrib factor must be > 0");
334 >                        break;
335  
336 <            else if (!strcmp(argv [i] + 2, "pM")) {
337 <               /* Max predistribution passes */
338 <               check(4, "i");
339 <               maxPreDistrib = atoi(argv [++i]);
340 <               if (maxPreDistrib <= 0)
341 <                  error(USER, "max predistribution passes must be > 0");
342 <            }
336 >                     case 'M': /* Max predistribution passes */
337 >                        check(4, "i");
338 >                        maxPreDistrib = atoi(argv [++i]);
339 >                        if (maxPreDistrib <= 0)
340 >                           error(USER, "max predistrib passes must be > 0");
341 >                        break;
342 >
343   #if 1
344 <            /* Kept for backwards compat, to be phased out by -lr */
345 <            else if (!strcmp(argv [i] + 2, "pm")) {
346 <               /* Max photon bounces */
347 <               check(4, "i");              
348 <               photonMaxBounce = atol(argv [++i]);
349 <               if (photonMaxBounce <= 0)
350 <                  error(USER, "max photon bounces must be > 0");
275 <            }            
344 >                     /* Kept for backwards compat, to be phased out by -lr */
345 >                     case 'm': /* Max photon bounces */
346 >                        check(4, "i");
347 >                        photonMaxBounce = atol(argv [++i]);
348 >                        if (photonMaxBounce <= 0)
349 >                           error(USER, "max photon bounces must be > 0");
350 >                        break;
351   #endif
352 < #ifdef PMAP_EKSPERTZ
353 <            /* Add region of interest; for Ze Ekspertz only! */
354 <            else if (!strcmp(argv [i] + 2, "pi")) {
355 <               unsigned j, n = pmapNumROI;
356 <               check(4, "ffffff");
357 <              
358 <               pmapROI = realloc(pmapROI,
359 <                                 ++pmapNumROI * sizeof(PhotonMapROI));
360 <               if (!pmapROI)
361 <                  error(SYSTEM, "failed to allocate ROI");
362 <                  
363 <               pmapROI [n].min [0] = atof(argv [++i]);
364 <               pmapROI [n].min [1] = atof(argv [++i]);
365 <               pmapROI [n].min [2] = atof(argv [++i]);
366 <               pmapROI [n].max [0] = atof(argv [++i]);
367 <               pmapROI [n].max [1] = atof(argv [++i]);
368 <               pmapROI [n].max [2] = atof(argv [++i]);
369 <              
370 <               for (j = 0; j < 3; j++)
371 <                  if (pmapROI [n].min [j] >= pmapROI [n].max [j])
297 <                     error(USER,
298 <                           "invalid region of interest (swapped min/max?)");
299 <            }
352 >
353 > #ifdef PMAP_EKSPERTZ                    
354 >                     case 'i': /* Add region of interest */
355 >                        check(4, "ffffff");                        
356 >                        n = pmapNumROI;
357 >                        pmapROI = realloc(pmapROI,
358 >                                          ++pmapNumROI * sizeof(PhotonMapROI));
359 >                        if (!pmapROI)
360 >                           error(SYSTEM, "failed to allocate ROI");
361 >                        pmapROI [n].min [0] = atof(argv [++i]);
362 >                        pmapROI [n].min [1] = atof(argv [++i]);
363 >                        pmapROI [n].min [2] = atof(argv [++i]);
364 >                        pmapROI [n].max [0] = atof(argv [++i]);
365 >                        pmapROI [n].max [1] = atof(argv [++i]);
366 >                        pmapROI [n].max [2] = atof(argv [++i]);                        
367 >                        for (j = 0; j < 3; j++)
368 >                           if (pmapROI [n].min [j] >= pmapROI [n].max [j])
369 >                              error(USER, "invalid region of interest "
370 >                                    "(swapped min/max?)");
371 >                        break;
372   #endif            
301            else if (!strcmp(argv [i] + 2, "pP")) {
302               /* Global photon precomputation factor */
303               check(4, "f");
304               finalGather = atof(argv [++i]);
305               if (finalGather <= 0 || finalGather > 1)
306                  error(USER, "global photon precomputation factor "
307                        "must be in range ]0, 1]");
308            }                  
309            
310            else if (!strcmp(argv [i] + 2, "po") ||
311                     !strcmp(argv [i] + 2, "pO")) {
312               /* Photon port */
313               check(4, "s");
314              
315               if (ambincl != 1) {
316                  ambincl = 1;
317                  portLp = amblist;
318               }
319              
320               if (argv[i][3] == 'O') {
321                  /* Get port modifiers from file */
322                  rval = wordfile(portLp, AMBLLEN-(portLp-amblist),
323                                  getpath(argv [++i], getrlibpath(), R_OK));
324                                  
325                  if (rval < 0) {
326                      sprintf(errmsg, "cannot open photon port file %s",
327                              argv [i]);
328                      error(SYSTEM, errmsg);
329                  }
330                  
331                  portLp += rval;
332               }
333              
334               else {
335                  /* Append modifier to port list */
336                  *portLp++ = argv [++i];
337                  *portLp = NULL;
338               }
339            }
340            
341            else if (!strcmp(argv [i] + 2, "pr")) {
342               /* Random seed */
343               check(4, "i");
344               randSeed = atoi(argv [++i]);
345            }                  
373  
374 <            else if (!strcmp(argv [i] + 2, "ps") ||
375 <                     !strcmp(argv [i] + 2, "pS")) {
376 <               /* Antimatter sensor */
377 <               check(4, "s");
378 <              
379 <               if (argv[i][3] == 'S') {
380 <                  /* Get sensor modifiers from file */
381 <                  rval = wordfile(sensLp, MAXSET-(sensLp-photonSensorList),
382 <                                  getpath(argv [++i], getrlibpath(), R_OK));
383 <                                  
384 <                  if (rval < 0) {
385 <                      sprintf(errmsg, "cannot open antimatter sensor file %s",
386 <                              argv [i]);
387 <                      error(SYSTEM, errmsg);
374 >                     case 'P': /* Global photon precomp ratio */
375 >                        check(4, "f");
376 >                        finalGather = atof(argv [++i]);
377 >                        if (finalGather <= 0 || finalGather > 1)
378 >                           error(USER, "global photon precomputation ratio "
379 >                                 "must be in range ]0, 1]");
380 >                        break;
381 >                    
382 >                     case 'o': /* Photon port */
383 >                     case 'O':
384 >                        /* Check for bad arg and length, taking into account
385 >                         * default forward orientation if none specified, in
386 >                         * order to maintain previous behaviour */
387 >                        check(argv [i][4] ? 5 : 4, "s");
388 >                        /* Get port orientation flags */
389 >                        check_tri(
390 >                           4, PMAP_PORTFWD, PMAP_PORTBWD, portFlags [0]
391 >                        );
392 >                        
393 >                        if (argv [i][3] == 'O') {      
394 >                           /* Add port modifiers from file */
395 >                           rval = wordfile(
396 >                              portLp, MAXSET - (portLp - photonPortList),
397 >                              getpath(argv [++i], getrlibpath(), R_OK)
398 >                           );
399 >                           if (rval < 0) {
400 >                               sprintf(
401 >                                  errmsg, "cannot open photon port file %s",
402 >                                  argv [i]
403 >                               );
404 >                               error(SYSTEM, errmsg);
405 >                           }
406 >                           /* HACK: append port orientation flags to every
407 >                            * modifier; note this requires reallocation */
408 >                           for (; rval--; portLp++) {
409 >                              j = strlen(*portLp);
410 >                              if (!(*portLp = realloc(*portLp, j + 2))) {
411 >                                  sprintf(
412 >                                     errmsg,
413 >                                     "cannot allocate photon port modifiers"
414 >                                     " from file %s", argv [i]
415 >                                  );
416 >                                  error(SYSTEM, errmsg);
417 >                              }
418 >                              strcat(*portLp, portFlags);
419 >                           }
420 >                        }
421 >                        else {
422 >                           /* Append port flags to port modifier, add to
423 >                            * port list and mark of end list with NULL */
424 >                           strcpy(sbuf, argv [++i]);
425 >                           strcat(sbuf, portFlags);
426 >                           *portLp++ = savqstr(sbuf);
427 >                           *portLp = NULL;
428 >                        }
429 >                        break;
430 >                    
431 >                     case 'r': /* Random seed */
432 >                        check(4, "i");
433 >                        randSeed = atoi(argv [++i]);
434 >                        break;                  
435 >
436 >                     case 's': /* Antimatter sensor */
437 >                     case 'S':
438 >                        check(4, "s");
439 >                        if (argv[i][3] == 'S') {        
440 >                           /* Add sensor modifiers from file */
441 >                           rval = wordfile(sensLp,
442 >                                           MAXSET - (sensLp - photonSensorList),
443 >                                           getpath(argv [++i],
444 >                                           getrlibpath(), R_OK));
445 >                           if (rval < 0) {
446 >                               sprintf(errmsg,
447 >                                       "cannot open antimatter sensor file %s",
448 >                                       argv [i]);
449 >                               error(SYSTEM, errmsg);
450 >                           }
451 >                           sensLp += rval;
452 >                        }
453 >                        else {
454 >                           /* Append modifier to sensor list, mark end with
455 >                            * NULL */
456 >                           *sensLp++ = savqstr(argv [++i]);
457 >                           *sensLp = NULL;
458 >                        }
459 >                        break;
460 >
461 >                     default: goto badopt;
462                    }
463 +                  break;
464                    
465 <                  sensLp += rval;
364 <               }
365 <              
366 <               else {
367 <                  /* Append modifier to sensor list */
368 <                  *sensLp++ = argv [++i];
369 <                  *sensLp = NULL;
370 <               }
465 >               default: goto badopt;
466              }
372
373            else goto badopt;                  
467              break;
468 <                  
469 <         case 'b':
468 >                
469 >         case 'b': /* Back face visibility */
470              if (argv [i][2] == 'v') {
378               /* Back face visibility */
471                 check_bool(3, backvis);
472              }
381                  
473              else goto badopt;
474              break;
475                    
# Line 403 | Line 494 | int main (int argc, char* argv [])
494              diagFile = argv [++i];
495              break;
496                    
497 <         case 'f':
497 >         case 'f': /* Force overwrite */
498              if (argv [i][2] == 'o') {
408               /* Force overwrite */
499                 check_bool(3, clobber);
500              }
411                  
501              else goto badopt;
502              break;
503 +
504   #ifdef PMAP_EKSPERTZ
505           case 'l': /* Limits */
506              switch (argv [i][2]) {
# Line 432 | Line 522 | int main (int argc, char* argv [])
522              }
523              break;
524   #endif
525 +
526           case 'm': /* Medium */
527              switch (argv[i][2]) {
528                 case 'e':        /* Eggs-tinction coefficient */
# Line 456 | Line 547 | int main (int argc, char* argv [])
547                 default: goto badopt;
548              }                  
549              break;
550 +            
551   #if NIX
552           case 'n': /* Num parallel processes (NIX only) */
553              check(2, "i");
# Line 468 | Line 560 | int main (int argc, char* argv [])
560                 error(WARNING, errmsg);
561              }            
562              break;                  
563 < #endif                        
563 > #endif
564 >
565           case 't': /* Timer */
566              check(2, "i");
567              photonRepTime = atoi(argv [++i]);
# Line 476 | Line 569 | int main (int argc, char* argv [])
569              
570           case 'v':   /* Verbosity */
571              check_bool(2, verbose);
572 <            break;            
572 >            break;
573 >            
574   #ifdef EVALDRC_HACK
575           case 'A':   /* Angular source file */
576              check(2,"s");
577              angsrcfile = argv[++i];
578              break;                  
579 < #endif                              
580 <         default: goto badopt;
579 > #endif
580 >
581 >        default: goto badopt;
582        }
583     }
584    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines