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

Comparing ray/src/hd/rhdisp.c (file contents):
Revision 3.37 by gwlarson, Fri Dec 18 11:56:10 1998 UTC vs.
Revision 3.38 by gwlarson, Sun Dec 20 20:39:31 1998 UTC

# Line 24 | Line 24 | static char SCCSid[] = "$SunId$ SGI";
24  
25   HOLO    *hdlist[HDMAX+1];       /* global holodeck list */
26  
27 < char    *hdofn[HDMAX+1];        /* holodeck section octree list */
27 > char    *hdgfn[HDMAX];          /* holodeck section geometry list */
28 > char    *hdpfn[HDMAX];          /* section portal list */
29  
30   char    cmdlist[DC_NCMDS][8] = DC_INIT;
31  
# Line 195 | Line 196 | disp_wait()                    /* wait for more input */
196   }
197  
198  
199 < add_holo(hdg, ofn)              /* register a new holodeck section */
199 > add_holo(hdg, gfn, pfn)         /* register a new holodeck section */
200   HDGRID  *hdg;
201 < char    *ofn;
201 > char    *gfn, *pfn;
202   {
203          VIEW    nv;
204          double  d;
# Line 212 | Line 213 | char   *ofn;
213                  error(SYSTEM, "out of memory in add_holo");
214          bcopy((char *)hdg, (char *)hdlist[hd], sizeof(HDGRID));
215          hdcompgrid(hdlist[hd]);
216 <        hdofn[hd] = savestr(ofn);
216 >        hdgfn[hd] = savestr(gfn);
217 >        hdpfn[hd] = pfn && *pfn ? savestr(pfn) : (char *)NULL;
218          if (hd)
219                  return;
220                                          /* set initial viewpoint */
# Line 300 | Line 302 | again:
302                          goto again;     /* poss. overloading dev_section()? */
303                  }
304                  DCHECK(*slist < 0, WARNING, "no visible sections in new_view");
305 <                while (*slist >= 0)
306 <                        dev_section(hdofn[*slist++]);
305 >                for ( ; *slist >= 0; slist++)
306 >                        dev_section(hdgfn[*slist], hdpfn[*slist]);
307          }
308 <        dev_section(NULL);      /* end section list */
308 >        dev_section(NULL,NULL); /* end section list */
309          dev_flush();            /* update display */
310                                  /* update server */
311          imm_mode = beam_sync(odev.firstuse) > 0;
# Line 486 | Line 488 | serv_result()                  /* get next server result and process
488                  disp_bundle((PACKHEAD *)buf);
489                  break;
490          case DS_ADDHOLO:
491 <                if (msg.nbytes <= sizeof(HDGRID))
491 >                if (msg.nbytes < sizeof(HDGRID)+2)
492                          error(INTERNAL, "bad holodeck record from server");
493 <                add_holo((HDGRID *)buf, buf+sizeof(HDGRID));
493 >                add_holo((HDGRID *)buf, buf+sizeof(HDGRID),
494 >                        buf+sizeof(HDGRID)+strlen(buf+sizeof(HDGRID))+1);
495                  break;
496          case DS_OUTSECT:
497                  do_outside = 1;
# Line 579 | Line 582 | register char  *s;
582   quit(code)                      /* clean up and exit */
583   int     code;
584   {
585 +        if (code)
586 +                exit(code);
587          if (odev.v.type)
588                  dev_close();
589 <        exit(code);
589 >        exit(0);
590   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines