50 |
|
|
51 |
|
char *tralist[128]; /* list of modifers to trace (or no) */ |
52 |
|
int traincl = -1; /* include == 1, exclude == 0 */ |
53 |
< |
#define MAXTSET 511 /* maximum number in trace set */ |
53 |
> |
#ifndef MAXTSET |
54 |
> |
#define MAXTSET 1024 /* maximum number in trace set */ |
55 |
> |
#endif |
56 |
|
OBJECT traset[MAXTSET+1]={0}; /* trace include/exclude set */ |
57 |
|
|
58 |
|
int hresolu = 0; /* horizontal (scan) size */ |
76 |
|
|
77 |
|
int backvis = 1; /* back face visibility */ |
78 |
|
|
79 |
< |
int maxdepth = 8; /* maximum recursion depth */ |
79 |
> |
int maxdepth = -10; /* maximum recursion depth */ |
80 |
|
double minweight = 2e-3; /* minimum ray weight */ |
81 |
|
|
82 |
|
char *ambfile = NULL; /* ambient file name */ |
150 |
|
char *fname |
151 |
|
) |
152 |
|
{ |
153 |
< |
long vcount = hresolu>1 ? hresolu*vresolu : vresolu; |
153 |
> |
unsigned long vcount = (hresolu > 1) ? (unsigned long)hresolu*vresolu |
154 |
> |
: vresolu; |
155 |
|
long nextflush = hresolu; |
156 |
|
FILE *fp; |
157 |
|
double d; |
190 |
|
d = normalize(direc); |
191 |
|
if (d == 0.0) { /* zero ==> flush */ |
192 |
|
bogusray(); |
193 |
< |
if (--nextflush <= 0 || vcount <= 0) { |
193 |
> |
if (--nextflush <= 0 || !vcount) { |
194 |
|
fflush(stdout); |
195 |
|
nextflush = hresolu; |
196 |
|
} |
202 |
|
else |
203 |
|
rad(orig, direc, lim_dist ? d : 0.0); |
204 |
|
/* flush if time */ |
205 |
< |
if (--nextflush == 0) { |
205 |
> |
if (!--nextflush) { |
206 |
|
fflush(stdout); |
207 |
|
nextflush = hresolu; |
208 |
|
} |
209 |
|
} |
210 |
|
if (ferror(stdout)) |
211 |
|
error(SYSTEM, "write error"); |
212 |
< |
if (--vcount == 0) /* check for end */ |
212 |
> |
if (vcount && !--vcount) /* check for end */ |
213 |
|
break; |
214 |
|
} |
215 |
|
fflush(stdout); |
216 |
< |
if (vcount > 0) |
216 |
> |
if (vcount) |
217 |
|
error(USER, "unexpected EOF on input"); |
218 |
|
if (fname != NULL) |
219 |
|
fclose(fp); |