55 |
|
static void sigdie(int signo, char *msg); |
56 |
|
static void printdefaults(void); |
57 |
|
|
58 |
– |
|
58 |
|
int |
59 |
|
main(int argc, char *argv[]) |
60 |
|
{ |
61 |
|
#define check(ol,al) if (argv[i][ol] || \ |
62 |
|
badarg(argc-i-1,argv+i+1,al)) \ |
63 |
|
goto badopt |
64 |
< |
#define bool(olen,var) switch (argv[i][olen]) { \ |
64 |
> |
#define check_bool(olen,var) switch (argv[i][olen]) { \ |
65 |
|
case '\0': var = !var; break; \ |
66 |
|
case 'y': case 'Y': case 't': case 'T': \ |
67 |
|
case '+': case '1': var = 1; break; \ |
147 |
|
} |
148 |
|
break; |
149 |
|
case 'b': /* grayscale */ |
150 |
< |
bool(2,greyscale); |
150 |
> |
check_bool(2,greyscale); |
151 |
|
break; |
152 |
|
case 'p': /* pixel */ |
153 |
|
switch (argv[i][2]) { |
171 |
|
break; |
172 |
|
case 'w': /* warnings */ |
173 |
|
rval = erract[WARNING].pf != NULL; |
174 |
< |
bool(2,rval); |
174 |
> |
check_bool(2,rval); |
175 |
|
if (rval) erract[WARNING].pf = wputs; |
176 |
|
else erract[WARNING].pf = NULL; |
177 |
|
break; |
229 |
|
|
230 |
|
ray_init(octnm); /* also calls ray_init_pmap() */ |
231 |
|
|
232 |
+ |
/* temporary shortcut, until winrview is refactored into a "device" */ |
233 |
+ |
#ifndef WIN_RVIEW |
234 |
|
rview(); /* run interactive viewer */ |
235 |
|
|
236 |
+ |
|
237 |
|
devclose(); /* close output device */ |
238 |
+ |
#endif |
239 |
|
|
240 |
|
/* PMAP: free photon maps */ |
241 |
|
ray_done_pmap(); |
242 |
|
|
243 |
+ |
#ifdef WIN_RVIEW |
244 |
+ |
return 1; |
245 |
+ |
#endif |
246 |
|
quit(0); |
247 |
|
|
248 |
|
badopt: |
251 |
|
return 1; /* pro forma return */ |
252 |
|
|
253 |
|
#undef check |
254 |
< |
#undef bool |
254 |
> |
#undef check_bool |
255 |
|
} |
256 |
|
|
257 |
|
|