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

Comparing ray/src/rt/rvmain.c (file contents):
Revision 2.12 by greg, Tue Feb 24 19:39:27 2015 UTC vs.
Revision 2.16 by schorsch, Sat Mar 19 12:51:36 2016 UTC

# Line 55 | Line 55 | static void onsig(int  signo);
55   static void sigdie(int  signo, char  *msg);
56   static void printdefaults(void);
57  
58
59 int
58   main(int argc, char *argv[])
59   {
60   #define  check(ol,al)           if (argv[i][ol] || \
61                                  badarg(argc-i-1,argv+i+1,al)) \
62                                  goto badopt
63 < #define  bool(olen,var)         switch (argv[i][olen]) { \
63 > #define  check_bool(olen,var)           switch (argv[i][olen]) { \
64                                  case '\0': var = !var; break; \
65                                  case 'y': case 'Y': case 't': case 'T': \
66                                  case '+': case '1': var = 1; break; \
# Line 148 | Line 146 | main(int argc, char *argv[])
146                          }
147                          break;
148                  case 'b':                               /* grayscale */
149 <                        bool(2,greyscale);
149 >                        check_bool(2,greyscale);
150                          break;
151                  case 'p':                               /* pixel */
152                          switch (argv[i][2]) {
# Line 172 | Line 170 | main(int argc, char *argv[])
170                          break;
171                  case 'w':                               /* warnings */
172                          rval = erract[WARNING].pf != NULL;
173 <                        bool(2,rval);
173 >                        check_bool(2,rval);
174                          if (rval) erract[WARNING].pf = wputs;
175                          else erract[WARNING].pf = NULL;
176                          break;
# Line 198 | Line 196 | main(int argc, char *argv[])
196                                                  /* set up signal handling */
197          sigdie(SIGINT, "Interrupt");
198          sigdie(SIGTERM, "Terminate");
199 < #ifndef _WIN32
199 > #if !defined(_WIN32) && !defined(_WIN64)
200          sigdie(SIGHUP, "Hangup");
201          sigdie(SIGPIPE, "Broken pipe");
202          sigdie(SIGALRM, "Alarm clock");
# Line 228 | Line 226 | main(int argc, char *argv[])
226                                          /* set up output & start process(es) */
227          SET_FILE_BINARY(stdout);
228          
229 <        ray_init(octnm);
229 >        ray_init(octnm);                /* also calls ray_init_pmap() */
230          
231 <        /* PMAP: set up & load photon maps */
232 <        ray_init_pmap();
235 <
231 > /* temporary shortcut, until winrview is refactored into a "device" */
232 > #ifndef WIN_RVIEW
233          rview();                        /* run interactive viewer */
234  
235 +
236          devclose();                     /* close output device */
237 + #endif
238  
239          /* PMAP: free photon maps */
240          ray_done_pmap();
241          
242 + #ifdef WIN_RVIEW
243 +        return 1;
244 + #endif
245          quit(0);
246  
247   badopt:
# Line 248 | Line 250 | badopt:
250          return 1; /* pro forma return */
251  
252   #undef  check
253 < #undef  bool
253 > #undef  check_bool
254   }
255  
256  
# Line 294 | Line 296 | onsig(                         /* fatal signal */
296          if (gotsig++)                   /* two signals and we're gone! */
297                  _exit(signo);
298  
299 < #ifndef _WIN32
299 > #if !defined(_WIN32) && !defined(_WIN64)
300          alarm(15);                      /* allow 15 seconds to clean up */
301          signal(SIGALRM, SIG_DFL);       /* make certain we do die */
302   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines