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

Comparing ray/src/rt/m_direct.c (file contents):
Revision 1.2 by greg, Tue Jul 16 15:56:54 1991 UTC vs.
Revision 1.3 by greg, Tue Jul 16 17:16:32 1991 UTC

# Line 18 | Line 18 | static char SCCSid[] = "$SunId$ LBL";
18   /*
19   * The arguments for MAT_DIRECT1 are:
20   *
21 < *      4+ coef1 dx1 dy1 dz1 transform..
21 > *      5+ coef1 dx1 dy1 dz1 funcfile transform..
22   *      0
23   *      n A1 A2 .. An
24   *
25   * The arguments for MAT_DIRECT2 are:
26   *
27 < *      8+ coef1 dx1 dy1 dz1 coef2 dx2 dy2 dz2 transform..
27 > *      9+ coef1 dx1 dy1 dz1 coef2 dx2 dy2 dz2 funcfile transform..
28   *      0
29   *      n A1 A2 .. An
30   */
# Line 44 | Line 44 | register RAY  *r;
44                                          /* check if source ray */
45          if (r->rsrc >= 0 && source[r->rsrc].so != r->ro)
46                  return;                         /* got the wrong guy */
47 +        dir_check(m);
48                                          /* compute first projection */
49          if (m->otype == MAT_DIRECT1 ||
50                          (r->rsrc < 0 || source[r->rsrc].sa.sv.pn == 0))
# Line 66 | Line 67 | int  n;
67          register int  j;
68                                          /* set up function */
69          setfunc(m, r);
69        if (m->oargs.nsargs < 4+4*n)
70                objerror(m, USER, "too few arguments");
70          sa = m->oargs.sarg + 4*n;
71                                          /* compute coefficient */
72          errno = 0;
# Line 109 | Line 108 | int  n;
108          register int  i, j;
109                                  /* get material arguments */
110          m = objptr(o->omod);
111 <        if (m->oargs.nsargs < 4+4*n)
113 <                objerror(m, USER, "too few arguments");
111 >        dir_check(m);
112          sa = m->oargs.sarg + 4*n;
113                                  /* initialize test ray */
114          getmaxdisk(cent, o);
# Line 167 | Line 165 | int  n;
165   computerr:
166          objerror(m, WARNING, "projection compute error");
167          return(0);
168 + }
169 +
170 +
171 + static
172 + dir_check(m)                    /* check arguments and load function file */
173 + register OBJREC  *m;
174 + {
175 +        register int  ff;
176 +
177 +        ff = m->otype == MAT_DIRECT1 ? 4 : 8;
178 +        if (ff >= m->oargs.nsargs)
179 +                objerror(m, USER, "too few arguments");
180 +        if (!vardefined(m->oargs.sarg[0]))
181 +                loadfunc(m->oargs.sarg[ff]);
182   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines