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.6 by gregl, Mon Nov 24 15:17:28 1997 UTC vs.
Revision 3.7 by gregl, Tue Nov 25 10:48:38 1997 UTC

# Line 14 | Line 14 | static char SCCSid[] = "$SunId$ SGI";
14  
15   extern GCOORD   *getviewcells();
16  
17 + static VIEW     dvw;            /* current view corresponding to beam list */
18 +
19   typedef struct {
20          int     hd;             /* holodeck section number (-1 if inactive) */
21          int     i[3];           /* voxel index (may be outside section) */
# Line 361 | Line 363 | VIEW   *vold, *vnew;
363          struct cellact  oca, nca;
364          int     ocnt, ncnt;
365          int     c;
366 +        GCOORD  *ogcl, *ngcl;
367          register GCOORD *ogcp, *ngcp;
368                                  /* get old and new cell lists */
369 <        ogcp = getviewcells(&ocnt, hdlist[voxel[voxi].hd], vold);
370 <        ngcp = getviewcells(&ncnt, hdlist[voxel[voxi].hd], vnew);
369 >        ogcp = ogcl = getviewcells(&ocnt, hdlist[voxel[voxi].hd], vold);
370 >        ngcp = ngcl = getviewcells(&ncnt, hdlist[voxel[voxi].hd], vnew);
371                                  /* set up actions */
372          oca.vi = nca.vi = voxi;
373          oca.rev = nca.rev = 0;
# Line 391 | Line 394 | VIEW   *vold, *vnew;
394          for ( ; ocnt > 0; ocnt--)
395                  netchange -= docell(ogcp++, &oca);
396                                  /* clean up */
397 <        if (ogcp != NULL) free((char *)ogcp);
398 <        if (ngcp != NULL) free((char *)ngcp);
397 >        if (ogcl != NULL) free((char *)ogcl);
398 >        if (ngcl != NULL) free((char *)ngcl);
399          return(netchange);
400   }
401  
# Line 403 | Line 406 | beam_sync()            /* synchronize beams on server */
406   }
407  
408  
409 < beam_view(vo, vn)       /* change beam view */
410 < VIEW    *vo, *vn;
409 > beam_view(vn)                   /* change beam view */
410 > VIEW    *vn;
411   {
412          struct cellact  ca;
413          VOXL    vlnew[8];
# Line 414 | Line 417 | VIEW   *vo, *vn;
417                  set_voxels(vlnew, 0);
418                  cbeamop(DR_DELSET, cbeam, ncbeams, NULL, 0, 0);
419                  ncbeams = 0;
420 +                copystruct(&dvw, vn);
421                  return;
422          }
423                                          /* find our new voxels */
424          n = get_voxels(vlnew, vn->vp);
425                                          /* set the new voxels */
426          comn = set_voxels(vlnew, n);
427 <        if (!vo->type)
427 >        if (!dvw.type)
428                  comn = 0;
429          ca.add = 1;                     /* update our beam list */
430          for (ca.vi = n; ca.vi--; )
431                  if (comn & 1<<ca.vi)    /* change which cells we see */
432 <                        mvview(ca.vi, vo, vn);
432 >                        mvview(ca.vi, &dvw, vn);
433                  else                    /* else add all new cells */
434                          doview(&ca, vn);
435                                          /* inform server of new beams */
# Line 435 | Line 439 | VIEW   *vo, *vn;
439                                          /* tell server to delete orphans */
440          cbeamop(DR_DELSET, cbeam+ncbeams, xcbeams, NULL, 0, 0);
441          xcbeams = 0;                    /* truncate our list */
442 +        copystruct(&dvw, vn);           /* record new view */
443   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines