--- ray/src/util/glareval.c 2018/01/24 04:39:52 2.15 +++ ray/src/util/glareval.c 2020/05/14 20:58:03 2.18 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: glareval.c,v 2.15 2018/01/24 04:39:52 greg Exp $"; +static const char RCSid[] = "$Id: glareval.c,v 2.18 2020/05/14 20:58:03 greg Exp $"; #endif /* * Compute pixels for glare calculation @@ -177,7 +177,7 @@ pict_val( /* find picture value for view direction * pp[0] = pictview.vp[0] + vd[0]; pp[1] = pictview.vp[1] + vd[1]; pp[2] = pictview.vp[2] + vd[2]; - if (viewloc(ip, &pictview, pp) != 1) + if (viewloc(ip, &pictview, pp) != VL_GOOD) return(-1.0); colr_color(res, getpictscan((int)(ip[1]*pysiz))[(int)(ip[0]*pxsiz)]); return(luminance(res)/exposure); @@ -199,7 +199,7 @@ getviewpix( /* compute single view pixel */ npixinvw++; if ((res = pict_val(dir)) >= 0.0) return(res); - if (rt_pd.r == -1) { + if (!(rt_pd.flags & PF_RUNNING)) { npixmiss++; return(-1.0); } @@ -240,7 +240,7 @@ getviewspan( /* compute a span of view pixels */ npixinvw++; if ((vb[vh+hsize] = pict_val(dir)) >= 0.0) continue; - if (rt_pd.r == -1) { /* missing information */ + if (!(rt_pd.flags & PF_RUNNING)) { /* missing information */ npixmiss++; continue; } @@ -299,7 +299,7 @@ getexpos( /* get exposure from header line */ void *p ) { - char fmt[32]; + char fmt[MAXFMTLEN]; if (isexpos(s)) exposure *= exposval(s); @@ -376,7 +376,6 @@ done_rtrace(void) /* wait for rtrace to finish */ progname, status); exit(1); } - rt_pd.r = -1; }