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.17 by gregl, Sun Jan 4 18:37:11 1998 UTC vs.
Revision 3.19 by gwlarson, Wed Aug 12 17:55:11 1998 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1997 Silicon Graphics, Inc. */
1 > /* Copyright (c) 1998 Silicon Graphics, Inc. */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ SGI";
# Line 56 | Line 56 | char   *dname;
56                                  /* check if outside */
57          if (vdef(OBSTRUCTIONS) && vbool(OBSTRUCTIONS))
58                  disp_result(DS_OUTSECT, 0, NULL);
59 +                                /* send eye separation if specified */
60 +        if (vdef(EYESEP)) {
61 +                char    fbuf[32];
62 +                sprintf(fbuf, "%.9e", vflt(EYESEP));
63 +                disp_result(DS_EYESEP, strlen(fbuf)+1, fbuf);
64 +        }
65                                  /* write out hologram grids */
66          for (i = 0; hdlist[i] != NULL; i++)
67                  disp_result(DS_ADDHOLO, sizeof(HDGRID), (char *)hdlist[i]);
# Line 102 | Line 108 | int    block;
108                  buf = (char *)malloc(msg.nbytes);
109                  if (buf == NULL)
110                          error(SYSTEM, "out of memory in disp_check");
111 <                if (fcntl(dpd[0], F_SETFL, inp_flags=0) < 0)
111 >                if (inp_flags != 0 && fcntl(dpd[0], F_SETFL, inp_flags=0) < 0)
112                          goto fcntlerr;
113                  if (readbuf(dpd[0], buf, msg.nbytes) != msg.nbytes)
114                          goto readerr;
# Line 116 | Line 122 | int    block;
122          case DR_NEWSET:         /* new calculation set */
123                  if (msg.nbytes % sizeof(PACKHEAD))
124                          error(INTERNAL, "bad DR_NEWSET from display process");
125 <                disp_result(DS_STARTIMM, 0, NULL);
125 >                if (msg.nbytes)
126 >                        disp_result(DS_STARTIMM, 0, NULL);
127                  bundle_set(BS_NEW, (PACKHEAD *)buf, msg.nbytes/sizeof(PACKHEAD));
128 <                disp_result(DS_ENDIMM, 0, NULL);
129 <                disp_flush();
128 >                if (msg.nbytes) {
129 >                        disp_result(DS_ENDIMM, 0, NULL);
130 >                        disp_flush();
131 >                }
132                  break;
133          case DR_ADDSET:         /* add to calculation set */
134 +                if (!msg.nbytes)
135 +                        break;
136                  if (msg.nbytes % sizeof(PACKHEAD))
137                          error(INTERNAL, "bad DR_ADDSET from display process");
138                  disp_result(DS_STARTIMM, 0, NULL);
# Line 130 | Line 141 | int    block;
141                  disp_flush();
142                  break;
143          case DR_ADJSET:         /* adjust calculation set members */
144 +                if (!msg.nbytes)
145 +                        break;
146                  if (msg.nbytes % sizeof(PACKHEAD))
147                          error(INTERNAL, "bad DR_ADJSET from display process");
148                  disp_result(DS_STARTIMM, 0, NULL);
# Line 138 | Line 151 | int    block;
151                  disp_flush();
152                  break;
153          case DR_DELSET:         /* delete from calculation set */
154 +                if (!msg.nbytes)
155 +                        break;
156                  if (msg.nbytes % sizeof(PACKHEAD))
157                          error(INTERNAL, "bad DR_DELSET from display process");
158                  bundle_set(BS_DEL, (PACKHEAD *)buf, msg.nbytes/sizeof(PACKHEAD));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines