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

Comparing ray/src/hd/rholo4.c (file contents):
Revision 3.21 by gwlarson, Thu Oct 22 08:47:40 1998 UTC vs.
Revision 3.24 by gwlarson, Sun Dec 20 20:39:31 1998 UTC

# Line 28 | Line 28 | static FILE    *dpout;
28   disp_open(dname)                /* open the named display driver */
29   char    *dname;
30   {
31 <        char    dpath[128], fd0[8], fd1[8], *cmd[5];
32 <        int     i;
31 >        char    buf[128], fd0[8], fd1[8], *cmd[5], *sfn;
32 >        int     i, n, len;
33                                  /* get full display program name */
34   #ifdef DEVPATH
35 <        sprintf(dpath, "%s/%s%s", DEVPATH, dname, HDSUF);
35 >        sprintf(buf, "%s/%s%s", DEVPATH, dname, HDSUF);
36   #else
37 <        sprintf(dpath, "dev/%s%s", dname, HDSUF);
37 >        sprintf(buf, "dev/%s%s", dname, HDSUF);
38   #endif
39                                  /* dup stdin and stdout */
40          if (readinp)
# Line 43 | Line 43 | char   *dname;
43                  strcpy(fd0, "-1");
44          sprintf(fd1, "%d", dup(1));
45                                  /* start the display process */
46 <        cmd[0] = dpath;
46 >        cmd[0] = buf;
47          cmd[1] = froot; cmd[2] = fd1; cmd[3] = fd0;
48          cmd[4] = NULL;
49          i = open_process(dpd, cmd);
# Line 62 | Line 62 | char   *dname;
62                  disp_result(DS_OUTSECT, 0, NULL);
63                                  /* send eye separation if specified */
64          if (vdef(EYESEP)) {
65 <                char    fbuf[32];
66 <                sprintf(fbuf, "%.9e", vflt(EYESEP));
67 <                disp_result(DS_EYESEP, strlen(fbuf)+1, fbuf);
65 >                sprintf(buf, "%.9e", vflt(EYESEP));
66 >                disp_result(DS_EYESEP, strlen(buf)+1, buf);
67          }
68 <                                /* write out hologram grids */
69 <        for (i = 0; hdlist[i] != NULL; i++)
70 <                disp_result(DS_ADDHOLO, sizeof(HDGRID), (char *)hdlist[i]);
68 >                                /* write out hologram grids & octrees */
69 >        for (i = 0; hdlist[i] != NULL; i++) {
70 >                bcopy((char *)hdlist[i], buf, sizeof(HDGRID));
71 >                len = sizeof(HDGRID);
72 >                n = vdef(GEOMETRY);
73 >                sfn = i<n ? nvalue(GEOMETRY,i) :
74 >                                n ? nvalue(GEOMETRY,n-1) : vval(OCTREE);
75 >                strcpy(buf+len, sfn);
76 >                len += strlen(sfn) + 1;
77 >                n = vdef(PORTS);
78 >                sfn = i<n ? nvalue(PORTS,i) : n ? nvalue(PORTS,n-1) : "";
79 >                strcpy(buf+len, sfn);
80 >                len += strlen(sfn) + 1;
81 >                disp_result(DS_ADDHOLO, len, buf);
82 >        }
83          disp_flush();
84   }
85  
# Line 163 | Line 174 | int    block;
174                          error(INTERNAL, "bad DR_DELSET from display process");
175                  bundle_set(BS_DEL, (PACKHEAD *)buf, msg.nbytes/sizeof(PACKHEAD));
176                  break;
177 +        case DR_VIEWPOINT:      /* set target eye position */
178 +                if (msg.nbytes != sizeof(VIEWPOINT))
179 +                        error(INTERNAL, "bad DR_VIEWPOINT from display process");
180 +                copystruct(&myeye, (VIEWPOINT *)buf);
181 +                break;
182          case DR_ATTEN:          /* block for priority request */
183                  if (msg.nbytes)
184                          error(INTERNAL, "bad DR_ATTEN from display process");
# Line 223 | Line 239 | disp_close()                   /* close our display process */
239  
240          if (dpout == NULL)
241                  return(-1);
242 +        myeye.rng = 0;
243          disp_result(DS_SHUTDOWN, 0, NULL);
244          fclose(dpout);
245          dpout = NULL;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines