1 |
– |
/* Copyright (c) 1991 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* p_data.c - routine for stored patterns. |
9 |
– |
* |
10 |
– |
* 6/4/86 |
6 |
|
*/ |
7 |
|
|
8 |
+ |
#include "copyright.h" |
9 |
+ |
|
10 |
|
#include "ray.h" |
11 |
|
|
12 |
|
#include "data.h" |
75 |
|
if (errno) |
76 |
|
goto computerr; |
77 |
|
scalecolor(r->pcol, bval); |
78 |
< |
return; |
78 |
> |
return(0); |
79 |
|
computerr: |
80 |
|
objerror(m, WARNING, "compute error"); |
81 |
< |
return; |
81 |
> |
return(0); |
82 |
|
} |
83 |
|
|
84 |
|
|
114 |
|
col[i] = datavalue(dp, pt); |
115 |
|
} |
116 |
|
errno = 0; |
117 |
< |
setcolor(cval, funvalue(m->oargs.sarg[0], 3, col), |
118 |
< |
funvalue(m->oargs.sarg[1], 3, col), |
119 |
< |
funvalue(m->oargs.sarg[2], 3, col)); |
117 |
> |
for (i = 0; i < 3; i++) |
118 |
> |
if (fundefined(m->oargs.sarg[i]) < 3) |
119 |
> |
colval(cval,i) = funvalue(m->oargs.sarg[i], 1, col+i); |
120 |
> |
else |
121 |
> |
colval(cval,i) = funvalue(m->oargs.sarg[i], 3, col); |
122 |
|
if (errno) |
123 |
|
goto computerr; |
124 |
|
multcolor(r->pcol, cval); |
125 |
< |
return; |
125 |
> |
return(0); |
126 |
|
computerr: |
127 |
|
objerror(m, WARNING, "compute error"); |
128 |
< |
return; |
128 |
> |
return(0); |
129 |
|
} |
130 |
|
|
131 |
|
|
153 |
|
for (i = 0; i < 3; i++) |
154 |
|
col[i] = datavalue(dp+i, pt); |
155 |
|
errno = 0; |
156 |
< |
setcolor(cval, funvalue(m->oargs.sarg[0], 3, col), |
157 |
< |
funvalue(m->oargs.sarg[1], 3, col), |
158 |
< |
funvalue(m->oargs.sarg[2], 3, col)); |
156 |
> |
for (i = 0; i < 3; i++) |
157 |
> |
if (fundefined(m->oargs.sarg[i]) < 3) |
158 |
> |
colval(cval,i) = funvalue(m->oargs.sarg[i], 1, col+i); |
159 |
> |
else |
160 |
> |
colval(cval,i) = funvalue(m->oargs.sarg[i], 3, col); |
161 |
|
if (errno) |
162 |
|
goto computerr; |
163 |
|
multcolor(r->pcol, cval); |
164 |
< |
return; |
164 |
> |
return(0); |
165 |
|
|
166 |
|
computerr: |
167 |
|
objerror(m, WARNING, "compute error"); |
168 |
< |
return; |
168 |
> |
return(0); |
169 |
|
} |