ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/func.c
(Generate patch)

Comparing ray/src/rt/func.c (file contents):
Revision 1.13 by greg, Sat Jan 12 18:01:19 1991 UTC vs.
Revision 1.17 by greg, Mon Jun 17 08:51:33 1991 UTC

# Line 33 | Line 33 | OBJREC  *m;
33   register RAY  *r;
34   XF  *bx;
35   {
36 <        extern double  l_noise3(), l_noise3a(), l_noise3b(), l_noise3c();
37 <        extern double  l_hermite(), l_fnoise3(), l_arg();
36 >        extern double  l_arg();
37          extern long  eclock;
38          static char  *initfile = "rayinit.cal";
39 +        static long  lastrno = -1;
40 +                                        /* check to see if already set */
41 +        if (m == fobj && r->rno == lastrno)
42 +                return(0);
43                                          /* initialize if first call */
44          if (initfile != NULL) {
45                  loadfunc(initfile);
# Line 48 | Line 51 | XF  *bx;
51                  scompile("Ix=$16;Iy=$17;Iz=$18;", NULL, 0);
52                  scompile("Jx=$19;Jy=$20;Jz=$21;", NULL, 0);
53                  scompile("Kx=$22;Ky=$23;Kz=$24;", NULL, 0);
54 <                funset("arg", 1, l_arg);
55 <                funset("noise3", 3, l_noise3);
53 <                funset("noise3a", 3, l_noise3a);
54 <                funset("noise3b", 3, l_noise3b);
55 <                funset("noise3c", 3, l_noise3c);
56 <                funset("hermite", 5, l_hermite);
57 <                funset("fnoise3", 3, l_fnoise3);
54 >                funset("arg", 1, '=', l_arg);
55 >                setnoisefuncs();
56                  initfile = NULL;
57          }
58          fobj = m;
# Line 67 | Line 65 | XF  *bx;
65                          copystruct(&funcxf, &r->rox->b);
66          else
67                  copystruct(&funcxf, bx);
68 +        lastrno = r->rno;
69          eclock++;               /* notify expression evaluator */
70 +        return(1);
71   }
72  
73  
# Line 97 | Line 97 | RAY  *r;
97                  }
98                  m->os = (char *)mxf;
99          }
100 <        setmap(m, r, mxf);
101 <        return;
100 >        return(setmap(m, r, mxf));
101   memerr:
102          error(SYSTEM, "out of memory in setfunc");
103   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines