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.22 by gwlarson, Tue Nov 24 17:05:36 1998 UTC vs.
Revision 3.23 by gwlarson, Fri Dec 18 11:56:11 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], *ofn;
32 >        int     i, n;
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 >                n = vdef(OSECTION);
72 >                ofn = i<n ? nvalue(OSECTION,i) :
73 >                                n ? nvalue(OSECTION,n-1) : vval(OCTREE);
74 >                strcpy(buf+sizeof(HDGRID), ofn);
75 >                disp_result(DS_ADDHOLO, sizeof(HDGRID)+1+strlen(ofn), buf);
76 >        }
77          disp_flush();
78   }
79  
# Line 228 | Line 233 | disp_close()                   /* close our display process */
233  
234          if (dpout == NULL)
235                  return(-1);
236 +        myeye.rng = 0;
237          disp_result(DS_SHUTDOWN, 0, NULL);
238          fclose(dpout);
239          dpout = NULL;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines