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

Comparing ray/src/rt/ambcomp.c (file contents):
Revision 2.10 by greg, Tue Feb 25 02:47:22 2003 UTC vs.
Revision 2.13 by greg, Wed Apr 13 23:00:59 2005 UTC

# Line 34 | Line 34 | AMBSAMP  *d1, *d2;
34   {
35          register int  c;
36  
37 <        if (c = d1->t - d2->t)
37 >        if ( (c = d1->t - d2->t) )
38                  return(c);
39          return(d1->p - d2->p);
40   }
# Line 142 | Line 142 | FVECT  pg, dg;
142                  qsort(div, ndivs, sizeof(AMBSAMP), ambcmp);     /* sort divs */
143                                                  /* super-sample */
144                  for (i = ns; i > 0; i--) {
145 <                        copystruct(&dnew, div);
145 >                        dnew = *div;
146                          if (divsample(&dnew, &hemi, r) < 0)
147                                  goto oopsy;
148                                                          /* reinsert */
149                          dp = div;
150                          j = ndivs < i ? ndivs : i;
151                          while (--j > 0 && dnew.k < dp[1].k) {
152 <                                copystruct(dp, dp+1);
152 >                                *dp = *(dp+1);
153                                  dp++;
154                          }
155 <                        copystruct(dp, &dnew);
155 >                        *dp = dnew;
156                  }
157                  if (pg != NULL || dg != NULL)   /* restore order */
158                          qsort(div, ndivs, sizeof(AMBSAMP), ambnorm);
# Line 230 | Line 230 | double  wt;
230   {
231          register int  i;
232                                          /* set number of divisions */
233        if (wt < (.25*PI)/ambdiv+FTINY) {
234                hp->nt = hp->np = 0;
235                return;                 /* zero samples */
236        }
233          hp->nt = sqrt(ambdiv * wt / PI) + 0.5;
234 +        i = ambacc > FTINY ? 3 : 1;     /* minimum number of samples */
235 +        if (hp->nt < i)
236 +                hp->nt = i;
237          hp->np = PI * hp->nt + 0.5;
238                                          /* make axes */
239          VCOPY(hp->uz, r->ron);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines