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

Comparing ray/src/hd/rholo3.c (file contents):
Revision 3.5 by gregl, Thu Nov 6 16:11:49 1997 UTC vs.
Revision 3.8 by gregl, Thu Nov 20 11:39:57 1997 UTC

# Line 116 | Line 116 | int    nents;
116          default:
117                  error(CONSISTENCY, "bundle_set called with unknown operation");
118          }
119 <        n = 0;                          /* allocate packet holder */
119 >        if (outdev == NULL)
120 >                return;
121 >        n = RPACKSIZ;                           /* allocate packet holder */
122          for (i = 0; i < nents; i++)
123                  if (clist[i].nr > n)
124                          n = clist[i].nr;
# Line 126 | Line 128 | int    nents;
128                                          /* display what we have */
129          for (i = 0; i < nents; i++)
130                  if ((b = hdgetbeam(hdlist[clist[i].hd], clist[i].bi)) != NULL) {
131 <                        bcopy((char *)hdbray(b), (char *)packrays(p),
131 >                        if (b->nrm > n) {
132 >                                n = b->nrm;
133 >                                p = (PACKHEAD *)realloc((char *)p, packsiz(n));
134 >                                if (p == NULL)
135 >                                        goto memerr;
136 >                        }
137 >                        bcopy((char *)hdbray(b), (char *)packra(p),
138                                          (p->nr=b->nrm)*sizeof(RAYVAL));
139 +                        p->hd = clist[i].hd;
140 +                        p->bi = clist[i].bi;
141                          disp_packet(p);
142                  }
143          free((char *)p);                /* clean up */
# Line 272 | Line 282 | sortcomplist()                 /* fix our list order */
282          done_packets(flush_queue());
283          if (complen <= 0)       /* check to see if there is even a list */
284                  return;
285 <        if (lastin < 0)         /* flag to sort entire list */
285 >        if (lastin < 0 || listpos*4 >= complen*3)
286                  qsort((char *)complist, complen, sizeof(PACKHEAD), beamcmp);
287          else if (listpos) {     /* else sort and merge sublist */
288                  list2 = (PACKHEAD *)malloc(listpos*sizeof(PACKHEAD));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines