45 |
|
extern int hresolu; /* horizontal resolution */ |
46 |
|
extern int vresolu; /* vertical resolution */ |
47 |
|
|
48 |
< |
int castonly = 0; /* only doing ray-casting? */ |
48 |
> |
extern int castonly; /* only doing ray-casting? */ |
49 |
|
|
50 |
|
#ifndef MAXTSET |
51 |
|
#define MAXTSET 8191 /* maximum number in trace set */ |
106 |
|
} |
107 |
|
|
108 |
|
|
109 |
< |
char * |
109 |
> |
const char * |
110 |
|
formstr( /* return format identifier */ |
111 |
|
int f |
112 |
|
) |
160 |
|
/* set up output */ |
161 |
|
if (castonly || every_out[0] != NULL) |
162 |
|
nproc = 1; /* don't bother multiprocessing */ |
163 |
< |
if (Tflag && every_out[0] != NULL) |
164 |
< |
trace_sources(); /* asking to trace light sources */ |
163 |
> |
if (every_out[0] != NULL) { |
164 |
> |
trace = ourtrace; /* enable full tree tracing */ |
165 |
> |
if (Tflag) /* light sources, too? */ |
166 |
> |
trace_sources(); |
167 |
> |
} |
168 |
|
if ((nextflush > 0) & (nproc > nextflush)) { |
169 |
|
error(WARNING, "reducing number of processes to match flush interval"); |
170 |
|
nproc = nextflush; |
171 |
|
} |
169 |
– |
switch (outform) { |
170 |
– |
case 'a': putreal = puta; break; |
171 |
– |
case 'f': putreal = putf; break; |
172 |
– |
case 'd': putreal = putd; break; |
173 |
– |
case 'c': |
174 |
– |
if (outvals[1] || !strchr("vrx", outvals[0])) |
175 |
– |
error(USER, "color format only with -ov, -or, -ox"); |
176 |
– |
putreal = putrgbe; break; |
177 |
– |
default: |
178 |
– |
error(CONSISTENCY, "botched output format"); |
179 |
– |
} |
172 |
|
if (nproc > 1) { /* start multiprocessing */ |
173 |
|
ray_popen(nproc); |
174 |
|
ray_fifo_out = printvals; |
233 |
|
if (!*vs) |
234 |
|
error(USER, "empty output specification"); |
235 |
|
|
236 |
+ |
switch (outform) { /* make sure (*putreal)() calls someone! */ |
237 |
+ |
case 'a': putreal = puta; break; |
238 |
+ |
case 'f': putreal = putf; break; |
239 |
+ |
case 'd': putreal = putd; break; |
240 |
+ |
case 'c': |
241 |
+ |
if (outvals[1] || !strchr("vrx", outvals[0])) |
242 |
+ |
error(USER, "color format only with -ov, -or, -ox"); |
243 |
+ |
putreal = putrgbe; break; |
244 |
+ |
default: |
245 |
+ |
error(CONSISTENCY, "botched output format"); |
246 |
+ |
} |
247 |
|
castonly = 1; /* sets castonly as side-effect */ |
248 |
|
do |
249 |
|
switch (*vs) { |
254 |
|
if (!vs[1]) break; |
255 |
|
*table = NULL; |
256 |
|
table = every_out; |
254 |
– |
trace = ourtrace; |
257 |
|
castonly = 0; |
258 |
|
break; |
259 |
|
case 'o': /* origin */ |