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

Comparing ray/src/hd/rhd_qtree.c (file contents):
Revision 3.16 by gregl, Wed Dec 31 09:06:54 1997 UTC vs.
Revision 3.18 by gwlarson, Mon Aug 10 18:39:46 1998 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1997 Silicon Graphics, Inc. */
1 > /* Copyright (c) 1998 Silicon Graphics, Inc. */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ SGI";
# Line 29 | Line 29 | double qtDepthEps = .05;       /* epsilon to compare depths
29   int     qtMinNodesiz = 2;       /* minimum node dimension (pixels) */
30   struct rleaves  qtL;            /* our pile of leaves */
31  
32 + int     rayqleft = 0;           /* rays left to queue before flush */
33 +
34   static int4     falleaves;      /* our list of fallen leaves */
35  
36   #define composted(li)   (qtL.bl <= qtL.tl ? \
# Line 330 | Line 332 | dropit:
332   }
333  
334  
335 < dev_value(c, p, v)              /* add a pixel value to our quadtree */
335 > dev_value(c, d, p)              /* add a pixel value to our quadtree */
336   COLR    c;
337 < FVECT   p, v;
337 > FVECT   d, p;
338   {
339          register int    li;
340          int     mapit;
# Line 351 | Line 353 | FVECT  p, v;
353                          qtCompost(LFREEPCT);
354                  mapit = 0;                      /* we'll map it later */
355          }
356 <        VCOPY(qtL.wp[li], p);
357 <        qtL.wd[li] = encodedir(v);
356 >        if (p == NULL)
357 >                VSUM(qtL.wp[li], odev.v.vp, d, FHUGE);
358 >        else
359 >                VCOPY(qtL.wp[li], p);
360 >        qtL.wd[li] = encodedir(d);
361          tmCvColrs(&qtL.brt[li], qtL.chr[li], c, 1);
362 <        if (putleaf(li, 1) && mapit)
363 <                tmMapPixels(qtL.rgb+li, qtL.brt+li, qtL.chr+li, 1);
362 >        if (putleaf(li, 1)) {
363 >                if (mapit)
364 >                        tmMapPixels(qtL.rgb+li, qtL.brt+li, qtL.chr+li, 1);
365 >                if (--rayqleft == 0)
366 >                        dev_flush();            /* flush output */
367 >        }
368   }
369  
370  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines