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

Comparing ray/src/hd/clumpbeams.c (file contents):
Revision 3.1 by gwlarson, Mon Nov 9 17:11:04 1998 UTC vs.
Revision 3.2 by gwlarson, Tue Nov 10 18:05:41 1998 UTC

# Line 20 | Line 20 | static int     bneighrem;
20  
21   #define nextneigh()     (bneighrem<=0 ? 0 : bneighlist[--bneighrem])
22  
23 static BEAMI    *beamdir;
23  
25
24   gcshifti(gc, ia, di, hp)        /* shift cell row or column */
25   register GCOORD *gc;
26   int     ia, di;
# Line 97 | Line 95 | int    b;
95   }
96  
97  
98 < static int
101 < bpcmp(b1p, b2p)                 /* compare beam positions on disk */
102 < int     *b1p, *b2p;
103 < {
104 <        register long   pdif = beamdir[*b1p].fo - beamdir[*b2p].fo;
105 <
106 <        if (pdif > 0L) return(1);
107 <        if (pdif < 0L) return(-1);
108 <        return(0);
109 < }
110 <
111 <
112 < clumpbeams(hp, maxcnt, maxsiz, bf)      /* clump beams from hinp */
98 > clumpbeams(hp, maxcnt, maxsiz, cf)      /* clump beams from hinp */
99   register HOLO   *hp;
100   int     maxcnt, maxsiz;
101 < int     (*bf)();
101 > int     (*cf)();
102   {
103          static short    primes[] = {9431,6803,4177,2659,1609,887,587,251,47,1};
118        HDBEAMI bis;
119        BEAM    *bp;
104          unsigned int4   *bflags;
105          int     *bqueue;
106          int     bqlen;
# Line 169 | Line 153 | int    (*bf)();
153                          if (i > 0)
154                                  break;
155                  }
156 <                beamdir = hp->bi;               /* sort queue */
173 <                qsort((char *)bqueue, bqlen, sizeof(*bqueue), bpcmp);
174 <                                                /* transfer each beam */
175 <                for (i = 0; i < bqlen; i++) {
176 <                        bp = hdgetbeam(bis.h=hp, bis.b=bqueue[i]);
177 <                        (*bf)(bp, &bis);
178 <                }
179 <                hdfreebeam(NULL, 0);            /* write & free clump */
156 >                (*cf)(hp, bqueue, bqlen);       /* transfer clump */
157          }
158 <        hdsync(NULL, 0);                /* we're done -- clean up */
158 >                                        /* all done; clean up */
159          free((char *)bqueue);
160          free((char *)bflags);
161   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines