--- ray/src/util/ranimove1.c 2005/07/24 21:11:53 3.11 +++ ray/src/util/ranimove1.c 2008/04/17 14:49:59 3.14 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: ranimove1.c,v 3.11 2005/07/24 21:11:53 greg Exp $"; +static const char RCSid[] = "$Id: ranimove1.c,v 3.14 2008/04/17 14:49:59 greg Exp $"; #endif /* * ranimove1.c @@ -54,6 +54,7 @@ static void setmotion(int n, FVECT wpos); static void init_frame_sample(void); +#if 0 extern void write_map( /* write out float map (debugging) */ float *mp, @@ -79,6 +80,7 @@ write_map( /* write out float map (debugging) */ } fclose(fp); } +#endif static void @@ -658,19 +660,12 @@ extern void init_frame(void) /* render base (low quality) frame */ { int restart; - /* allocate/swap buffers */ next_frame(); /* check rendering status */ restart = (!nobjects || vdef(MOVE)); if (!restart && curparams != &lorendparams && nprocs > 1) restart = -1; - if (restart > 0) { - if (nprocs > 1) - ray_pdone(1); - else - ray_done(1); - } /* post low quality parameters */ if (curparams != &lorendparams) ray_restore(curparams = &lorendparams); @@ -702,7 +697,7 @@ init_frame(void) /* render base (low quality) frame init_frame_sample(); /* initialize frame error */ comp_frame_error(); -return; +#if 0 { float *ebuf = (float *)malloc(sizeof(float)*hres*vres); char fnm[256]; @@ -714,6 +709,7 @@ return; write_map(ebuf, fnm); free((void *)ebuf); } +#endif } @@ -762,6 +758,16 @@ filter_frame(void) /* interpolation, motion-blur, an continue; nc = getclosest(neigh, NPINTERP, x, y); setcolor(cbuffer[n], 0., 0., 0.); + if (nc <= 0) { /* no acceptable neighbors */ + if (y < vres-1) + nc = fndx(x, y+1); + else if (x < hres-1) + nc = fndx(x+1, y); + else + continue; + copycolor(cbuffer[n], cbuffer[nc]); + continue; + } wsum = 0.; while (nc-- > 0) { copycolor(cval, cbuffer[neigh[nc]]); @@ -771,10 +777,8 @@ filter_frame(void) /* interpolation, motion-blur, an addcolor(cbuffer[n], cval); wsum += w; } - if (wsum > FTINY) { - w = 1.0/wsum; - scalecolor(cbuffer[n], w); - } + w = 1.0/wsum; + scalecolor(cbuffer[n], w); } /* motion blur if requested */ if (mblur > .02) {