--- ray/src/util/glareval.c 2018/08/02 18:33:50 2.16 +++ ray/src/util/glareval.c 2022/11/29 20:45:21 2.19 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: glareval.c,v 2.16 2018/08/02 18:33:50 greg Exp $"; +static const char RCSid[] = "$Id: glareval.c,v 2.19 2022/11/29 20:45:21 greg Exp $"; #endif /* * Compute pixels for glare calculation @@ -70,7 +70,7 @@ claimscan( /* claim scanline from buffers */ { int hi = shash(y); SCAN *slast; - register SCAN *sl; + SCAN *sl; for (sl = hashtab[hi]; sl != NULL; sl = sl->next) if (sl->y == y) /* active scanline */ @@ -97,8 +97,8 @@ getpictscan( /* get picture scanline */ int y ) { - register SCAN *sl; - register int i; + SCAN *sl; + int i; /* first check our buffers */ sl = claimscan(y); if (sl == NULL) @@ -177,14 +177,14 @@ 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); } -extern double +double getviewpix( /* compute single view pixel */ int vh, int vv @@ -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); } @@ -214,17 +214,17 @@ getviewpix( /* compute single view pixel */ } -extern void +void getviewspan( /* compute a span of view pixels */ int vv, float *vb ) { float rt_buf[6*MAXPIX]; /* rtrace send/receive buffer */ - register int n; /* number of pixels in buffer */ + int n; /* number of pixels in buffer */ short buf_vh[MAXPIX]; /* pixel positions */ FVECT dir; - register int vh; + int vh; #ifdef DEBUG if (verbose) @@ -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; } @@ -311,7 +311,7 @@ getexpos( /* get exposure from header line */ } -extern void +void open_pict( /* open picture file */ char *fn ) @@ -331,7 +331,7 @@ open_pict( /* open picture file */ } -extern void +void close_pict(void) /* done with picture */ { if (pictfp == NULL) @@ -342,7 +342,7 @@ close_pict(void) /* done with picture */ } -extern void +void fork_rtrace( /* open pipe and start rtrace */ char *av[] ) @@ -365,7 +365,7 @@ fork_rtrace( /* open pipe and start rtrace */ } -extern void +void done_rtrace(void) /* wait for rtrace to finish */ { int status; @@ -376,7 +376,6 @@ done_rtrace(void) /* wait for rtrace to finish */ progname, status); exit(1); } - rt_pd.r = -1; } @@ -386,8 +385,8 @@ scanretire(void) /* retire old scanlines to free lis SCAN *sold[NRETIRE]; int n; int h; - register SCAN *sl; - register int i; + SCAN *sl; + int i; /* grab the NRETIRE oldest scanlines */ sold[n = 0] = NULL; for (h = 0; h < HSIZE; h++) @@ -428,8 +427,8 @@ static void initscans(void) /* initialize scanline buffers */ { int scansize; - register SCAN *ptr; - register int i; + SCAN *ptr; + int i; /* initialize positions */ scanpos = (long *)bmalloc(pysiz*sizeof(long)); if (scanpos == NULL)