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

Comparing ray/src/util/rpiece.c (file contents):
Revision 2.29 by greg, Mon Feb 28 09:22:32 1994 UTC vs.
Revision 2.33 by gregl, Tue May 20 11:54:55 1997 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1993 Regents of the University of California */
1 > /* Copyright (c) 1995 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 69 | Line 69 | int  nforked = 0;
69  
70   char  *progname;
71   int  verbose = 0;
72 + unsigned  timelim = 0;
73   int  rvrlim = -1;
74  
75   extern long  lseek(), ftell();
# Line 120 | Line 121 | char  *argv[];
121                                          break;
122                                  pixaspect = atof(argv[i+1]);
123                                  continue;
124 +                        case 'T':               /* time limit (hours) */
125 +                                if (argv[i][2])
126 +                                        break;
127 +                                timelim = atof(argv[++i])*3600. + .5;
128 +                                break;
129                          case 'x':               /* overall x resolution */
130                                  if (argv[i][2])
131                                          break;
# Line 280 | Line 286 | char  **av;
286                  exit(1);
287          }
288          signal(SIGALRM, onalrm);
289 +        if (timelim)
290 +                alarm(timelim);
291          return;
292   filerr:
293          fprintf(stderr, "%s: i/o error on file \"%s\"\n", progname, outfile);
# Line 345 | Line 353 | register int  *xp, *yp;
353                  return(0);              /* only check if asked */
354          if (pdone == NULL)              /* first call */
355                  pdone = calloc(hmult*vmult, sizeof(char));
356 +        if (pdone == NULL) {
357 +                fprintf(stderr, "%s: out of memory\n", progname);
358 +                exit(1);
359 +        }
360          if (readpos != -1)              /* mark what's been done */
361                  fseek(syncfp, readpos, 0);
362          while (fscanf(syncfp, "%d %d", xp, yp) == 2)
# Line 403 | Line 415 | rpiece()                       /* render picture piece by piece */
415                  pview.horiz = ourview.horiz / hmult;
416                  pview.vert = ourview.vert / vmult;
417                  break;
418 +        case VT_CYL:
419 +                pview.horiz = ourview.horiz / hmult;
420 +                pview.vert = 2.*180./PI*atan(
421 +                                tan(PI/180./2.*ourview.vert)/vmult );
422 +                break;
423          case VT_HEM:
424                  pview.horiz = 2.*180./PI*asin(
425                                  sin(PI/180./2.*ourview.horiz)/hmult );
# Line 416 | Line 433 | rpiece()                       /* render picture piece by piece */
433          }
434                                          /* render each piece */
435          while (nextpiece(&xorg, &yorg)) {
436 <                pview.hoff = ourview.hoff + xorg - 0.5*(hmult-1);
437 <                pview.voff = ourview.voff + yorg - 0.5*(vmult-1);
436 >                pview.hoff = ourview.hoff*hmult + xorg - 0.5*(hmult-1);
437 >                pview.voff = ourview.voff*vmult + yorg - 0.5*(vmult-1);
438                  fputs(VIEWSTR, torp);
439                  fprintview(&pview, torp);
440                  putc('\n', torp);
# Line 510 | Line 527 | int  xpos, ypos;
527          if (fcntl(outfd, F_SETLKW, &fls) < 0)
528                  filerr("lock");
529   #endif
530 +        if (verbose) {                          /* notify caller */
531 +                printf("%d %d done\n", xpos, ypos);
532 +                fflush(stdout);
533 +        }
534          if (syncfp != NULL) {                   /* record what's been done */
535                  sflock(F_WRLCK);
536                  fseek(syncfp, 0L, 2);           /* append index */
# Line 517 | Line 538 | int  xpos, ypos;
538                  fflush(syncfp);
539                                  /*** Unlock not necessary, since
540                  sflock(F_UNLCK);        _exit() or nextpiece() is next ***/
520        }
521        if (verbose) {                          /* notify caller */
522                printf("%d %d done\n", xpos, ypos);
523                fflush(stdout);
541          }
542          if (pid == -1)          /* didn't fork or fork failed */
543                  return(0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines