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

Comparing ray/src/rt/rpict.c (file contents):
Revision 2.21 by greg, Wed Jan 20 15:19:47 1993 UTC vs.
Revision 2.25 by greg, Fri May 28 18:59:50 1993 UTC

# Line 29 | Line 29 | static char SCCSid[] = "$SunId$ LBL";
29  
30   #define  RFTEMPLATE     "rfXXXXXX"
31  
32 + #ifndef SIGCONT
33 + #define SIGCONT         SIGIO
34 + #endif
35 +
36   int  dimlist[MAXDIM];                   /* sampling dimensions */
37   int  ndims = 0;                         /* number of sampling dimensions */
38   int  samplendx;                         /* sample index number */
# Line 78 | Line 82 | long  tlastrept = 0L;                  /* time at last report */
82   extern long  time();
83   extern long  tstart;                    /* starting time */
84  
85 < extern long  nrays;                     /* number of rays traced */
85 > extern unsigned long  nrays;            /* number of rays traced */
86  
87   #define  MAXDIV         16              /* maximum sample size */
88  
# Line 115 | Line 119 | report()               /* report progress */
119          t += (rubuf.ru_utime.tv_usec + rubuf.ru_stime.tv_usec) / 1e6;
120          t += rubuf.ru_utime.tv_sec + rubuf.ru_stime.tv_sec;
121  
122 <        sprintf(errmsg, "%ld rays, %4.2f%% done after %5.4f CPU hours\n",
122 >        sprintf(errmsg, "%lu rays, %4.2f%% done after %5.4f CPU hours\n",
123                          nrays, pctdone, t/3600.0);
124          eputs(errmsg);
125          tlastrept = time((long *)0);
# Line 124 | Line 128 | report()               /* report progress */
128   report()                /* report progress */
129   {
130          tlastrept = time((long *)0);
131 <        sprintf(errmsg, "%ld rays, %4.2f%% done after %5.4f hours\n",
131 >        sprintf(errmsg, "%lu rays, %4.2f%% done after %5.4f hours\n",
132                          nrays, pctdone, (tlastrept-tstart)/3600.0);
133          eputs(errmsg);
134 <        signal(SIGALRM, report);
134 >        signal(SIGCONT, report);
135   }
136   #endif
137  
# Line 197 | Line 201 | char  *pout, *zout, *prvr;
201          do {
202                  if (seq && nextview(stdin) == EOF)
203                          break;
204 +                pctdone = 0.0;
205                  if (pout != NULL) {
206                          sprintf(fbuf, pout, seq);
207                          if (freopen(fbuf, "w", stdout) == NULL) {
# Line 324 | Line 329 | char  *zfile, *oldfile;
329   #ifndef  BSD
330          else
331   #endif
332 <        signal(SIGALRM, report);
332 >        signal(SIGCONT, report);
333          ypos = vres-1 - i;
334          fillscanline(scanbar[0], zbar[0], sampdens, hres, ypos, hstep);
335                                                  /* compute scanlines */
# Line 347 | Line 352 | char  *zfile, *oldfile;
352                  fillscanbar(scanbar, zbar, hres, ypos, ystep);
353                                                          /* write it out */
354   #ifndef  BSD
355 <                signal(SIGALRM, SIG_IGN);       /* don't interrupt writes */
355 >                signal(SIGCONT, SIG_IGN);       /* don't interrupt writes */
356   #endif
357                  for (i = ystep; i > 0; i--) {
358                          if (zfd != -1 && write(zfd, (char *)zbar[i],
# Line 365 | Line 370 | char  *zfile, *oldfile;
370                          report();
371   #ifndef  BSD
372                  else
373 <                        signal(SIGALRM, report);
373 >                        signal(SIGCONT, report);
374   #endif
375          }
376                                                  /* clean up */
377 <        signal(SIGALRM, SIG_IGN);
377 >        signal(SIGCONT, SIG_IGN);
378          if (zfd != -1) {
379                  if (write(zfd, (char *)zbar[0], hres*sizeof(float))
380                                  < hres*sizeof(float))
# Line 389 | Line 394 | char  *zfile, *oldfile;
394          pctdone = 100.0;
395          if (ralrm > 0)
396                  report();
397 +        signal(SIGCONT, SIG_DFL);
398          return;
399   writerr:
400          error(SYSTEM, "write error in render");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines