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

Comparing ray/src/util/glareval.c (file contents):
Revision 2.6 by greg, Sat Feb 22 02:07:30 2003 UTC vs.
Revision 2.7 by schorsch, Thu Jun 26 00:58:11 2003 UTC

# Line 5 | Line 5 | static const char      RCSid[] = "$Id$";
5   * Compute pixels for glare calculation
6   */
7  
8 + #include "rtprocess.h" /* Windows: must come first because of conflicts */
9   #include "glare.h"
10 +
11                                          /* maximum rtrace buffer size */
12   #define MAXPIX          (4096/(6*sizeof(float)))
13  
# Line 13 | Line 15 | static const char      RCSid[] = "$Id$";
15   #define HSIZE           317     /* size of scanline hash table */
16   #define NRETIRE         16      /* number of scanlines to retire at once */
17  
18 < int     rt_pd[3] = {-1,-1,-1};  /* process id & descriptors for rtrace */
18 > static SUBPROC  rt_pd = SP_INACTIVE; /* process id & descriptors for rtrace */
19  
20   FILE    *pictfp = NULL;         /* picture file pointer */
21   double  exposure;               /* picture exposure */
# Line 182 | Line 184 | int    vh, vv;
184          npixinvw++;
185          if ((res = pict_val(dir)) >= 0.0)
186                  return(res);
187 <        if (rt_pd[0] == -1) {
187 >        if (rt_pd.r == -1) {
188                  npixmiss++;
189                  return(-1.0);
190          }
# Line 221 | Line 223 | float  *vb;
223                  npixinvw++;
224                  if ((vb[vh+hsize] = pict_val(dir)) >= 0.0)
225                          continue;
226 <                if (rt_pd[0] == -1) {           /* missing information */
226 >                if (rt_pd.r == -1) {            /* missing information */
227                          npixmiss++;
228                          continue;
229                  }
# Line 261 | Line 263 | int    np;
263                                  progname, np);
264   #endif
265          bzero(pb+6*np, 6*sizeof(float));
266 <        if (process(rt_pd, (char *)pb, (char *)pb, 3*sizeof(float)*(np+1),
266 >        if (process(&rt_pd, (char *)pb, (char *)pb, 3*sizeof(float)*(np+1),
267                          6*sizeof(float)*(np+1)) < 3*sizeof(float)*(np+1)) {
268                  fprintf(stderr, "%s: rtrace communication error\n",
269                                  progname);
# Line 318 | Line 320 | char   *av[];
320   {
321          int     rval;
322  
323 <        rval = open_process(rt_pd, av);
323 >        rval = open_process(&rt_pd, av);
324          if (rval < 0) {
325                  perror(progname);
326                  exit(1);
# Line 338 | Line 340 | done_rtrace()                  /* wait for rtrace to finish */
340   {
341          int     status;
342  
343 <        status = close_process(rt_pd);
343 >        status = close_process(&rt_pd);
344          if (status > 0) {
345                  fprintf(stderr, "%s: bad status (%d) from rtrace\n",
346                                  progname, status);
347                  exit(1);
348          }
349 <        rt_pd[0] = -1;
349 >        rt_pd.r = -1;
350   }
351  
352  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines