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

Comparing ray/src/util/glarendx.c (file contents):
Revision 2.14 by greg, Mon Feb 17 19:19:45 2020 UTC vs.
Revision 2.17 by greg, Tue Jun 3 21:31:51 2025 UTC

# Line 22 | Line 22 | static const char      RCSid[] = "$Id$";
22   #include <string.h>
23  
24   #include "standard.h"
25 + #include "paths.h"
26   #include "view.h"
27  
28  
# Line 76 | Line 77 | struct named_func {
77  
78   #define newp(type)      (type *)malloc(sizeof(type))
79  
79 char    *progname;
80   int     print_header = 1;
81  
82   VIEW    midview = STDVIEW;
# Line 91 | Line 91 | main(
91   )
92   {
93          struct named_func       *funp;
94        char    *progtail;
94          int     i;
95                                          /* get program name */
96 <        progname = argv[0];
98 <        progtail = strrchr(progname, '/');      /* final component */
99 <        if (progtail == NULL)
100 <                progtail = progname;
101 <        else
102 <                progtail++;
96 >        progname = fixargv0(argv[0]);
97                                          /* get options */
98          for (i = 1; i < argc && argv[i][0] == '-'; i++)
99                  switch (argv[i][1]) {
100                  case 't':
101 <                        progtail = argv[++i];
101 >                        progname = argv[++i];
102                          break;
103                  case 'h':
104                          print_header = 0;
# Line 121 | Line 115 | main(
115                  }
116                                          /* find and run calculation */
117          for (funp = all_funcs; funp->name != NULL; funp++)
118 <                if (!strcmp(funp->name, progtail)) {
118 >                if (!strcmp(funp->name, progname)) {
119                          init();
120                          read_input();
121                          if (print_header) {
# Line 380 | Line 374 | dgi(           /* compute Daylight Glare Index */
374                  omega += (2.*PI-r*PI*(1.+1./(r*r)))*(-p[0]-0.1667*(p[1]+p[3])
375                            +0.3334*(p[2]+p[4]+p[5]+p[6]));
376                  if (omega <= 0.)
377 <                        omega = 0.;
377 >                        continue;
378                  sum += pow(gs->lum,1.6) * pow(omega,0.8) /
379                         (gd->indirect*(1./PI) + 0.07*sqrt(gs->dom)*gs->lum);
380          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines