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

Comparing ray/src/hd/rhdisp2.c (file contents):
Revision 3.7 by gregl, Tue Nov 25 10:48:38 1997 UTC vs.
Revision 3.8 by gregl, Tue Dec 2 15:02:37 1997 UTC

# Line 158 | Line 158 | int    adopt;
158   }
159  
160  
161 + cbeamadj(v, hr, vr)             /* adjust our beam list */
162 + VIEW    *v;
163 + int     hr, vr;
164 + {
165 +        register PACKHEAD       *pa;
166 +        register int    i;
167 +        int     n;
168 +                                        /* first handle additions */
169 +        pa = (PACKHEAD *)malloc(xcbeams*sizeof(PACKHEAD));
170 +        if (xcbeams && pa == NULL)
171 +                goto memerr;
172 +        for (i = xcbeams; i--; ) {
173 +                pa[i].hd = cbeam[ncbeams+i].hd;
174 +                pa[i].bi = cbeam[ncbeams+i].bi;
175 +                pa[i].nr = npixels(v, hr, vr, hdlist[pa[i].hd], pa[i].bi);
176 +        }
177 +        n = xcbeams;                    /* now sort list for deletions */
178 +        cbeamsort(0);
179 +        pa = (PACKHEAD *)realloc((char *)pa, (n+xcbeams)*sizeof(PACKHEAD));
180 +        if (n+xcbeams && pa == NULL)
181 +                goto memerr;
182 +        for (i = xcbeams; i--; ) {
183 +                pa[n+i].hd = cbeam[ncbeams+i].hd;
184 +                pa[n+i].bi = cbeam[ncbeams+i].bi;
185 +                pa[n+i].nr = 0;
186 +        }
187 +        n += xcbeams;
188 +        xcbeams = 0;                    /* delete orphans */
189 +        serv_request(DR_ADJSET, n*sizeof(PACKHEAD), (char *)pa);
190 +        free((char *)pa);
191 +        return;
192 + memerr:
193 +        error(SYSTEM, "out of memory in cbeamadj");
194 + }
195 +
196 +
197   cbeamop(op, bl, n, v, hr, vr)   /* update beams on server list */
198   int     op;
199   register struct beamcomp        *bl;
# Line 432 | Line 468 | VIEW   *vn;
468                          mvview(ca.vi, &dvw, vn);
469                  else                    /* else add all new cells */
470                          doview(&ca, vn);
471 + #if 1
472 +        cbeamadj(vn, odev.hres, odev.vres);
473 + #else
474                                          /* inform server of new beams */
475          cbeamop(DR_ADDSET, cbeam+ncbeams, xcbeams, vn, odev.hres, odev.vres);
476                                          /* sort list to put orphans at end */
# Line 439 | Line 478 | VIEW   *vn;
478                                          /* tell server to delete orphans */
479          cbeamop(DR_DELSET, cbeam+ncbeams, xcbeams, NULL, 0, 0);
480          xcbeams = 0;                    /* truncate our list */
481 + #endif
482          copystruct(&dvw, vn);           /* record new view */
483   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines