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.43 by greg, Tue Jun 3 21:31:51 2025 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines