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

Comparing ray/src/util/glaresrc.c (file contents):
Revision 1.11 by greg, Wed Apr 10 15:59:10 1991 UTC vs.
Revision 1.12 by greg, Fri Apr 12 10:28:36 1991 UTC

# Line 131 | Line 131 | double br;
131  
132   comp_thresh()                   /* compute glare threshold */
133   {
134 +        SPANERR sperr;
135          int     h, v;
136          int     nsamps;
137          double  brsum, br;
# Line 140 | Line 141 | comp_thresh()                  /* compute glare threshold */
141                                  progname);
142          brsum = 0.0;
143          nsamps = 0;
144 <        for (v = vsize; v >= -vsize; v -= TSAMPSTEP)
144 >        for (v = vsize; v >= -vsize; v -= TSAMPSTEP) {
145 >                setspanerr(&sperr, v);
146                  for (h = -hsize; h <= hsize; h += TSAMPSTEP) {
147 <                        if ((br = getviewpix(h, v)) < 0.0)
147 >                        if ((br = getviewpix(h, v, &sperr)) < 0.0)
148                                  continue;
149                          brsum += br;
150                          nsamps++;
151                  }
152 +        }
153          if (nsamps == 0) {
154                  fprintf(stderr, "%s: no viewable scene!\n", progname);
155                  exit(1);
# Line 287 | Line 290 | register struct source *sp;
290          for (ss = sp->first; ss != NULL; ss = ss->next) {
291                  sp->brt += ss->brsum;
292                  n += ss->r - ss->l;
293 <                if (compdir(dright, ss->r, ss->v) < 0)
294 <                        compdir(dright, ss->r-2, ss->v);
293 >                if (compdir(dright, ss->r, ss->v, NULL) < 0)
294 >                        compdir(dright, ss->r-2, ss->v, NULL);
295                  for (h = ss->r-1; h >= ss->l; h--)
296 <                        if (compdir(dthis, h, ss->v) == 0) {
296 >                        if (compdir(dthis, h, ss->v, NULL) == 0) {
297                                  d = dist2(dthis, dright);
298                                  fvsum(sp->dir, sp->dir, dthis, d);
299                                  sp->dom += d;
# Line 305 | Line 308 | register struct source *sp;
308          donelist = sp;
309          if (verbose)
310                  fprintf(stderr,
311 <        "%s: found source at (%.3f,%.3f,%.3f), dw %.5f, br %.1f (%d samps)\n",
311 >        "%s: source at [%.3f,%.3f,%.3f], dw %.5f, br %.1f (%d samps)\n",
312                          progname, sp->dir[0], sp->dir[1], sp->dir[2],
313                          sp->dom, sp->brt, n);
314   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines