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

Comparing ray/src/rt/ambient.c (file contents):
Revision 2.22 by greg, Fri Aug 6 17:24:24 1993 UTC vs.
Revision 2.23 by greg, Sat Dec 18 10:37:01 1993 UTC

# Line 214 | Line 214 | double s;
214                  /*
215                   *  Ambient level test.
216                   */
217 <                if (av->lvl > al || av->weight < r->rweight-FTINY)
217 >                if (av->lvl > al)       /* list sorted, so this works */
218 >                        break;
219 >                if (av->weight < r->rweight-FTINY)
220                          continue;
221                  /*
222                   *  Ambient radius test.
# Line 401 | Line 403 | avinsert(av)                           /* insert ambient value in our tree */
403   register AMBVAL  *av;
404   {
405          register AMBTREE  *at;
406 +        register AMBVAL  *ap;
407 +        AMBVAL  avh;
408          FVECT  ck0;
409          double  s;
410          int  branch;
# Line 424 | Line 428 | register AMBVAL         *av;
428                          }
429                  at = at->kid + branch;
430          }
431 <        av->next = at->alist;
432 <        at->alist = av;
431 >        avh.next = at->alist;           /* order by increasing level */
432 >        for (ap = &avh; ap->next != NULL; ap = ap->next)
433 >                if (ap->next->lvl >= av->lvl)
434 >                        break;
435 >        av->next = ap->next;
436 >        ap->next = av;
437 >        at->alist = avh.next;
438   }
439  
440  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines