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

Comparing ray/src/cv/pabopto2bsdf.c (file contents):
Revision 2.40 by greg, Mon Apr 5 19:56:18 2021 UTC vs.
Revision 2.44 by greg, Sat Jun 7 05:09:45 2025 UTC

# Line 13 | Line 13 | static const char RCSid[] = "$Id$";
13   #include <ctype.h>
14   #include <math.h>
15   #include "rtio.h"
16 #include "platform.h"
16   #include "bsdfrep.h"
18                                /* global argv[0] */
19 char                    *progname;
17  
18   typedef struct {
19          const char      *fname;         /* input file path */
# Line 229 | Line 226 | int
226   main(int argc, char *argv[])
227   {
228          extern int      nprocs;
229 <        int             auto_grazing = 0;
229 >        static char     gval_buf[16];
230 >        char *          auto_grazing = NULL;
231          const char      *symmetry = "0";
232          int             ninpfiles, totinc;
233          int             a, i;
234 <
235 <        progname = argv[0];                     /* get options */
234 >                                        /* set global progname */
235 >        fixargv0(argv[0]);
236 >                                        /* get options */
237          for (a = 1; a < argc && argv[a][0] == '-'; a++)
238                  switch (argv[a][1]) {
239                  case 't':
# Line 248 | Line 247 | main(int argc, char *argv[])
247                          break;
248                  case 'g':
249                          if (toupper(argv[a+1][0]) == 'A')
250 <                                auto_grazing = 1;
250 >                                auto_grazing = argv[a+1] = gval_buf;
251                          else
252                                  lim_graze = atof(argv[a+1]);
253                          ++a;
# Line 272 | Line 271 | main(int argc, char *argv[])
271                  if (auto_grazing && fabs(inpfile[i].theta - 90.) < lim_graze)
272                          lim_graze = fabs(inpfile[i].theta - 90.);
273          }
274 +        if (auto_grazing)
275 +                sprintf(auto_grazing, "%.2f", lim_graze);
276          for (i = ninpfiles; i < totinc; i++) {  /* copy for "up" symmetry */
277                  inpfile[i] = inpfile[i-ninpfiles];
278                  inpfile[i].phi += 180.;         /* invert duplicate data */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines