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

Comparing ray/src/hd/rholo2l.c (file contents):
Revision 3.1 by gregl, Fri Oct 31 10:23:29 1997 UTC vs.
Revision 3.5 by gregl, Mon Nov 24 15:18:47 1997 UTC

# Line 10 | Line 10 | static char SCCSid[] = "$SunId$ SGI";
10  
11   #include "rholo.h"
12   #include "random.h"
13 + #include "selcall.h"
14   #include <signal.h>
15   #include <sys/time.h>
16  
# Line 53 | Line 54 | start_rtrace()                 /* start rtrace process */
54          rtargv[rtargc++] = "-x"; rtargv[rtargc++] = buf1;
55          rtargv[rtargc++] = "-y"; rtargv[rtargc++] = "0";
56          rtargv[rtargc++] = "-fff";
57 <        rtargv[rtargc++] = "-ovl";
57 >        rtargv[rtargc++] = "-ovL";
58          rtargv[rtargc++] = nowarn ? "-w-" : "-w+";
59          if (npt > 1) {
60                  rtargv[rtargc++] = "-PP"; rtargv[rtargc++] = PFILE;
# Line 207 | Line 208 | int    poll;
208                  if (n)                                  /* read past end? */
209                          error(INTERNAL, "packet sync error in get_packets");
210                                                          /* take from queue */
211 <                if (pldone = NULL)
211 >                if (pldone == NULL)
212                          pldone = plend = pqueue[pn];
213                  else
214                          plend->next = pqueue[pn];
# Line 218 | Line 219 | int    poll;
219          }
220          return(pldone);                         /* return finished packets */
221   eoferr:
222 <        error(USER, "unexpected EOF from rtrace process");
222 >        error(USER, "rtrace process died");
223   }
224  
225  
# Line 252 | Line 253 | flush_queue()                  /* empty all rtrace queues */
253                  if (pqlen[i]) {
254                          if (rpdone == NULL) {           /* tack on queue */
255                                  rpdone = rpl = pqueue[i];
256 <                                n = rpl->nr;
256 >                                if ((nr = rpl->nr) < RPACKSIZ) nr++;
257                          } else {
258                                  rpl->next = pqueue[i];
259 <                                n = 0;
259 >                                nr = 0;
260                          }
261 <                        while (rpl->next != NULL)
262 <                                n += (rpl = rpl->next)->nr;
261 >                        while (rpl->next != NULL) {
262 >                                nr += (rpl = rpl->next)->nr;
263 >                                if (rpl->nr < RPACKSIZ)
264 >                                        nr++;           /* add flush block */
265 >                        }
266                          n = readbuf(rtpd[i][0], (char *)rtbuf,
267 <                                        4*sizeof(float)*n);
267 >                                        4*sizeof(float)*nr);
268                          if (n < 0)
269                                  error(SYSTEM, "read failure in flush_queue");
270                          bp = rtbuf;                     /* process packets */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines