--- ray/src/rt/t_func.c 1991/11/25 09:50:59 2.2 +++ ray/src/rt/t_func.c 2004/03/30 16:13:01 2.7 @@ -1,18 +1,15 @@ -/* Copyright (c) 1991 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: t_func.c,v 2.7 2004/03/30 16:13:01 schorsch Exp $"; #endif - /* * t_func.c - routine for procedural textures. - * - * 4/8/86 */ -#include "ray.h" +#include "copyright.h" +#include "ray.h" #include "func.h" +#include "rtotypes.h" /* * A procedural texture perturbs the surface normal @@ -31,9 +28,11 @@ static char SCCSid[] = "$SunId$ LBL"; */ -t_func(m, r) /* compute texture for ray */ -register OBJREC *m; -register RAY *r; +extern int +t_func( /* compute texture for ray */ + register OBJREC *m, + register RAY *r +) { FVECT disp; double d; @@ -47,9 +46,9 @@ register RAY *r; errno = 0; for (i = 0; i < 3; i++) { disp[i] = evalue(mf->ep[i]); - if (errno) { + if (errno == EDOM || errno == ERANGE) { objerror(m, WARNING, "compute error"); - return; + return(0); } } if (mf->f != &unitxf) @@ -61,4 +60,5 @@ register RAY *r; d = 1.0 / mf->f->sca; for (i = 0; i < 3; i++) r->pert[i] += disp[i] * d; + return(0); }