--- ray/src/rt/p_func.c 2003/02/25 02:47:23 2.5 +++ ray/src/rt/p_func.c 2004/03/30 16:13:01 2.7 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: p_func.c,v 2.5 2003/02/25 02:47:23 greg Exp $"; +static const char RCSid[] = "$Id: p_func.c,v 2.7 2004/03/30 16:13:01 schorsch Exp $"; #endif /* * p_func.c - routine for procedural patterns. @@ -8,8 +8,8 @@ static const char RCSid[] = "$Id: p_func.c,v 2.5 2003/ #include "copyright.h" #include "ray.h" - #include "func.h" +#include "rtotypes.h" /* * A procedural pattern can either be a brightness or a @@ -34,9 +34,11 @@ static const char RCSid[] = "$Id: p_func.c,v 2.5 2003/ */ -p_bfunc(m, r) /* compute brightness pattern */ -OBJREC *m; -RAY *r; +extern int +p_bfunc( /* compute brightness pattern */ + OBJREC *m, + RAY *r +) { double bval; register MFUNC *mf; @@ -47,7 +49,7 @@ RAY *r; setfunc(m, r); errno = 0; bval = evalue(mf->ep[0]); - if (errno) { + if (errno == EDOM || errno == ERANGE) { objerror(m, WARNING, "compute error"); return(0); } @@ -56,9 +58,11 @@ RAY *r; } -p_cfunc(m, r) /* compute color pattern */ -OBJREC *m; -RAY *r; +extern int +p_cfunc( /* compute color pattern */ + OBJREC *m, + RAY *r +) { COLOR cval; register MFUNC *mf; @@ -71,7 +75,7 @@ RAY *r; setcolor(cval, evalue(mf->ep[0]), evalue(mf->ep[1]), evalue(mf->ep[2])); - if (errno) { + if (errno == EDOM || errno == ERANGE) { objerror(m, WARNING, "compute error"); return(0); }