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

Comparing ray/src/rt/devcomm.c (file contents):
Revision 1.11 by greg, Tue Jan 30 11:37:36 1990 UTC vs.
Revision 1.12 by greg, Thu Feb 22 11:46:13 1990 UTC

# Line 26 | Line 26 | static char SCCSid[] = "$SunId$ LBL";
26   #define vfork           fork
27   #endif
28  
29 #ifndef WFLUSH
30 #define WFLUSH          30              /* flush after this many rays */
31 #endif
32
29   extern char     *getpath(), *getenv();
30  
31   int     onsigio();
32  
33   int     comm_close(), comm_clear(), comm_paintr(), comm_errout(),
34 <                comm_getcur(), comm_comout(), comm_comin();
34 >                comm_getcur(), comm_comout(), comm_comin(), comm_flush();
35  
36 < struct driver   comm_driver, comm_default = {
36 > struct driver   comm_driver = {
37          comm_close, comm_clear, comm_paintr, comm_getcur,
38 <        comm_comout, comm_comin
38 >        comm_comout, comm_comin, comm_flush
39   };
40  
41   FILE    *devin, *devout;
# Line 80 | Line 76 | char   *dname, *id;
76                  goto syserr;
77          if ((devin = fdopen(p2[0], "r")) == NULL)
78                  goto syserr;
83        copystruct(&comm_driver, &comm_default);
79                                                  /* verify & get resolution */
80          putw(COM_SENDM, devout);
81          fflush(devout);
# Line 135 | Line 130 | comm_paintr(col, xmin, ymin, xmax, ymax)       /* paint a re
130   COLOR   col;
131   int     xmin, ymin, xmax, ymax;
132   {
138        extern long     nrays;          /* number of rays traced */
139        static long     lastflush = 0;  /* ray count at last flush */
140
133          putc(COM_PAINTR, devout);
134          fwrite((char *)col, sizeof(COLOR), 1, devout);
135          putw(xmin, devout);
136          putw(ymin, devout);
137          putw(xmax, devout);
138          putw(ymax, devout);
139 <        if (nrays - lastflush >= WFLUSH) {
140 <                fflush(devout);
141 <                lastflush = nrays;
142 <        }
139 > }
140 >
141 >
142 > static
143 > comm_flush()                            /* flush output to driver */
144 > {
145 >        putc(COM_FLUSH, devout);
146 >        fflush(devout);
147   }
148  
149  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines