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 |
|
* t_func.c - routine for procedural textures. |
9 |
– |
* |
10 |
– |
* 4/8/86 |
6 |
|
*/ |
7 |
|
|
8 |
< |
#include "ray.h" |
8 |
> |
#include "copyright.h" |
9 |
|
|
10 |
+ |
#include "ray.h" |
11 |
|
#include "func.h" |
12 |
+ |
#include "rtotypes.h" |
13 |
|
|
14 |
|
/* |
15 |
|
* A procedural texture perturbs the surface normal |
28 |
|
*/ |
29 |
|
|
30 |
|
|
31 |
< |
t_func(m, r) /* compute texture for ray */ |
32 |
< |
register OBJREC *m; |
33 |
< |
register RAY *r; |
31 |
> |
extern int |
32 |
> |
t_func( /* compute texture for ray */ |
33 |
> |
register OBJREC *m, |
34 |
> |
register RAY *r |
35 |
> |
) |
36 |
|
{ |
37 |
|
FVECT disp; |
38 |
|
double d; |
46 |
|
errno = 0; |
47 |
|
for (i = 0; i < 3; i++) { |
48 |
|
disp[i] = evalue(mf->ep[i]); |
49 |
< |
if (errno) { |
49 |
> |
if (errno == EDOM || errno == ERANGE) { |
50 |
|
objerror(m, WARNING, "compute error"); |
51 |
|
return(0); |
52 |
|
} |