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.1 by gregl, Wed Nov 19 18:01:03 1997 UTC vs.
Revision 3.2 by gregl, Thu Nov 20 14:46:07 1997 UTC

# Line 5 | Line 5 | static char SCCSid[] = "$SunId$ SGI";
5   #endif
6  
7   /*
8 < * Holodeck beam tracking
8 > * Holodeck beam tracking for display process
9   */
10  
11   #include "rholo.h"
# Line 15 | Line 15 | static char SCCSid[] = "$SunId$ SGI";
15   extern int      *getviewcells();
16  
17   typedef struct {
18 <        int     hd;             /* holodeck section number */
18 >        int     hd;             /* holodeck section number (-1 if inactive) */
19          int     i[3];           /* voxel index (may be outside section) */
20   } VOXL;                 /* a voxel */
21  
# Line 36 | Line 36 | static int     ncbeams = 0;    /* number of sorted beams in c
36   static int      xcbeams = 0;    /* extra (unregistered) beams past ncbeams */
37   static int      maxcbeam = 0;   /* size of cbeam array */
38  
39
39   struct cellact {
40          short   vi;             /* voxel index */
41          short   add;            /* zero means delete */
42   };              /* action for cell */
43  
45
44   struct beamact {
45          struct cellact  ca;     /* cell action */
46          GCOORD  gc;             /* grid coordinate */
# Line 292 | Line 290 | register struct beamact        *bp;
290          copystruct(gc, gcp);
291          copystruct(gc+1, &bp->gc);
292          if ((bi = hdbindex(hdlist[voxel[bp->ca.vi].hd], gc)) <= 0)
293 <                return(0);              /* should report an error? */
293 >                error(CONSISTENCY, "bad grid coordinate in dobeam");
294          if (bp->ca.add) {               /* add it in */
295                  i = getcbeam(voxel[bp->ca.vi].hd, bi);
296                  cbeam[i].wants |= 1<<bp->ca.vi; /* say we want it */
# Line 403 | Line 401 | VIEW   *vold, *vnew;
401                  }
402                                  /* take care of list tails */
403          for (ca.add = 1; ncnt > 0; ncnt--)
404 <                docell(ngcp++, &ca);
404 >                netchange += docell(ngcp++, &ca);
405          for (ca.add = 0; ocnt > 0; ocnt--)
406 <                docell(ogcp++, &ca);
406 >                netchange -= docell(ogcp++, &ca);
407                                  /* clean up */
408          if (ocl != NULL) free((char *)ocl);
409          if (ncl != NULL) free((char *)ncl);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines