--- ray/src/rt/p_data.c 1991/11/25 09:50:53 2.2 +++ ray/src/rt/p_data.c 2003/02/25 02:47:23 2.6 @@ -1,15 +1,12 @@ -/* Copyright (c) 1991 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: p_data.c,v 2.6 2003/02/25 02:47:23 greg Exp $"; #endif - /* * p_data.c - routine for stored patterns. - * - * 6/4/86 */ +#include "copyright.h" + #include "ray.h" #include "data.h" @@ -78,10 +75,10 @@ RAY *r; if (errno) goto computerr; scalecolor(r->pcol, bval); - return; + return(0); computerr: objerror(m, WARNING, "compute error"); - return; + return(0); } @@ -117,16 +114,18 @@ RAY *r; col[i] = datavalue(dp, pt); } errno = 0; - setcolor(cval, funvalue(m->oargs.sarg[0], 3, col), - funvalue(m->oargs.sarg[1], 3, col), - funvalue(m->oargs.sarg[2], 3, col)); + for (i = 0; i < 3; i++) + if (fundefined(m->oargs.sarg[i]) < 3) + colval(cval,i) = funvalue(m->oargs.sarg[i], 1, col+i); + else + colval(cval,i) = funvalue(m->oargs.sarg[i], 3, col); if (errno) goto computerr; multcolor(r->pcol, cval); - return; + return(0); computerr: objerror(m, WARNING, "compute error"); - return; + return(0); } @@ -154,15 +153,17 @@ RAY *r; for (i = 0; i < 3; i++) col[i] = datavalue(dp+i, pt); errno = 0; - setcolor(cval, funvalue(m->oargs.sarg[0], 3, col), - funvalue(m->oargs.sarg[1], 3, col), - funvalue(m->oargs.sarg[2], 3, col)); + for (i = 0; i < 3; i++) + if (fundefined(m->oargs.sarg[i]) < 3) + colval(cval,i) = funvalue(m->oargs.sarg[i], 1, col+i); + else + colval(cval,i) = funvalue(m->oargs.sarg[i], 3, col); if (errno) goto computerr; multcolor(r->pcol, cval); - return; + return(0); computerr: objerror(m, WARNING, "compute error"); - return; + return(0); }