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.3 by schorsch, Thu Jun 5 19:29:34 2003 UTC vs.
Revision 2.7 by greg, Wed Apr 5 06:22:57 2006 UTC

# Line 8 | Line 8 | static const char      RCSid[] = "$Id$";
8   #include "copyright.h"
9  
10   #include  <signal.h>
11 + #include  <time.h>
12  
13   #include  "platform.h"
14   #include  "ray.h"
15   #include  "source.h"
16   #include  "ambient.h"
17 + #include  "rpaint.h"
18   #include  "random.h"
19   #include  "paths.h"
20   #include  "view.h"
# Line 41 | Line 43 | extern int  vresolu;                   /* vertical resolution */
43   extern int  psample;                    /* pixel sample size */
44   extern double  maxdiff;                 /* max. sample difference */
45  
46 < void    onsig();
47 < void    sigdie();
48 < void    printdefaults();
46 > static void onsig(int  signo);
47 > static void sigdie(int  signo, char  *msg);
48 > static void printdefaults(void);
49  
50  
51   int
52 < main(argc, argv)
51 < int  argc;
52 < char  *argv[];
52 > main(int  argc, char  *argv[])
53   {
54   #define  check(ol,al)           if (argv[i][ol] || \
55                                  badarg(argc-i-1,argv+i+1,al)) \
# Line 169 | Line 169 | char  *argv[];
169                                          /* initialize object types */
170          initotypes();
171                                          /* initialize urand */
172 <        initurand(2048);
172 >        if (rand_samp) {
173 >                srandom((long)time(0));
174 >                initurand(0);
175 >        } else {
176 >                srandom(0L);
177 >                initurand(2048);
178 >        }
179                                          /* set up signal handling */
180          sigdie(SIGINT, "Interrupt");
181          sigdie(SIGHUP, "Hangup");
# Line 220 | Line 226 | char  *argv[];
226   badopt:
227          sprintf(errmsg, "command line error at '%s'", argv[i]);
228          error(USER, errmsg);
229 +        return 1; /* pro forma return */
230  
231   #undef  check
232   #undef  bool
# Line 227 | Line 234 | badopt:
234  
235  
236   void
237 < wputs(s)                                /* warning output function */
238 < char    *s;
237 > wputs(                          /* warning output function */
238 >        char    *s
239 > )
240   {
241          int  lasterrno = errno;
242          eputs(s);
# Line 237 | Line 245 | char   *s;
245  
246  
247   void
248 < eputs(s)                                /* put string to stderr */
249 < register char  *s;
248 > eputs(                          /* put string to stderr */
249 >        register char  *s
250 > )
251   {
252          static int  midline = 0;
253  
# Line 256 | Line 265 | register char  *s;
265   }
266  
267  
268 < void
269 < onsig(signo)                            /* fatal signal */
270 < int  signo;
268 > static void
269 > onsig(                          /* fatal signal */
270 >        int  signo
271 > )
272   {
273          static int  gotsig = 0;
274  
# Line 274 | Line 284 | int  signo;
284   }
285  
286  
287 < void
288 < sigdie(signo, msg)                      /* set fatal signal */
289 < int  signo;
290 < char  *msg;
287 > static void
288 > sigdie(                 /* set fatal signal */
289 >        int  signo,
290 >        char  *msg
291 > )
292   {
293          if (signal(signo, onsig) == SIG_IGN)
294                  signal(signo, SIG_IGN);
# Line 285 | Line 296 | char  *msg;
296   }
297  
298  
299 < void
300 < printdefaults()                 /* print default values to stdout */
299 > static void
300 > printdefaults(void)                     /* print default values to stdout */
301   {
291        register char  *cp;
292
302          printf(greyscale ? "-b+\t\t\t\t# greyscale on\n" :
303                          "-b-\t\t\t\t# greyscale off\n");
304          printf("-vt%c\t\t\t\t# view type %s\n", ourview.type,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines