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" |
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; |
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]; |
135 |
|
|
136 |
|
fputs("# ", stdout); |
137 |
|
printargs(argc, argv, stdout); |
138 |
< |
eclock = 0; |
138 |
> |
doptimize(1); |
139 |
> |
eclock++; |
140 |
|
|
141 |
|
lastnz = lastnr = 0.0; |
142 |
|
t = 0.0; |