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

Comparing ray/src/gen/genrev.c (file contents):
Revision 2.10 by greg, Sat Oct 11 04:39:34 2008 UTC vs.
Revision 2.14 by greg, Sat Dec 28 18:05:14 2019 UTC

# Line 12 | Line 12 | static const char      RCSid[] = "$Id$";
12   */
13  
14   #include  <stdlib.h>
15 #include  <stdio.h>
16 #include  <string.h>
15   #include  <math.h>
16  
17 + #include  "rtio.h"
18   #include  "rterror.h"
19   #include  "resolu.h"
20   #include  "calcomp.h"
# Line 99 | Line 98 | char  *argv[];
98          int  i, nseg;
99          int  orient;
100  
101 +        esupport |= E_VARIABLE|E_FUNCTION|E_RCONST;
102 +        esupport &= ~(E_OUTCHAN|E_INCHAN);
103          varset("PI", ':', PI);
104          funset("hermite", 5, ':', l_hermite);
105          funset("bezier", 5, ':', l_bezier);
# Line 110 | Line 111 | char  *argv[];
111          for (i = 6; i < argc; i++)
112                  if (!strcmp(argv[i], "-e"))
113                          scompile(argv[++i], NULL, 0);
114 <                else if (!strcmp(argv[i], "-f"))
115 <                        fcompile(argv[++i]);
116 <                else if (!strcmp(argv[i], "-s"))
114 >                else if (!strcmp(argv[i], "-f")) {
115 >                        char  *fpath = getpath(argv[++i], getrlibpath(), 0);
116 >                        if (fpath == NULL) {
117 >                                fprintf(stderr, "%s: cannot find file '%s'\n",
118 >                                                argv[0], argv[i]);
119 >                                quit(1);
120 >                        }
121 >                        fcompile(fpath);
122 >                } else if (!strcmp(argv[i], "-s"))
123                          smooth = 1;
124                  else
125                          goto userror;
# Line 121 | Line 128 | char  *argv[];
128          scompile(stmp, NULL, 0);
129          sprintf(stmp, "%s(t)=%s;", RNAME, argv[4]);
130          scompile(stmp, NULL, 0);
131 <        nseg = atoi(argv[5]);
131 >        nseg = eval(argv[5]) + .5;
132          if (nseg <= 0)
133                  goto userror;
134          modname = smooth ? "Phong" : argv[1];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines