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

Comparing ray/src/rt/rxpiece.cpp (file contents):
Revision 2.9 by greg, Thu Jan 2 20:19:48 2025 UTC vs.
Revision 2.13 by greg, Thu Jun 5 18:26:46 2025 UTC

# Line 10 | Line 10 | static const char      RCSid[] = "$Id$";
10   #include  <time.h>
11   #include  <signal.h>
12   #include  <sys/mman.h>
13 + #include  <sys/wait.h>
14   #include  <unistd.h>
15  
16   #include  "platform.h"
17   #include  "RpictSimulManager.h"
18 + #include  "func.h"
19   #include  "ambient.h"
20   #include  "pmapray.h"
21   #include  "random.h"
22  
21 extern char  *progname;                 /* argv[0] */
23   const char  *sigerr[NSIG];              /* signal error messages */
24  
25   VIEW  ourview = STDVIEW;                /* global view parameters */
# Line 60 | Line 61 | static RenderDataType rpiece(char *pout, RenderDataTyp
61   void
62   quit(int code)                          /* quit program */
63   {
63        if (nproc < 0) {
64                ray_pnprocs = -1;       // hack to avoid cleanup in child
65                _exit(code);
66        }
64          exit(code);                     // don't bother to free data structs
65   }
66  
# Line 102 | Line 99 | main(int  argc, char  *argv[])
99          int  outfmt = 'c';
100          int  rval;
101          int  i;
102 <                                        /* global program name */
103 <        progname = argv[0];
102 >                                        /* set global program name */
103 >        fixargv0(argv[0]);
104                                          /* feature check only? */
105          strcat(RFeatureList, RXPIECE_FEATURES);
106          if (argc > 1 && !strcmp(argv[1], "-features"))
107                  return feature_status(argc-2, argv+2);
108 +                                        /* initialize calcomp routines */
109 +        initfunc();
110                                          /* set defaults */
111          default_options();
112                                          /* option city */
# Line 639 | Line 638 | rpiece(char *pout, RenderDataType dt, char *zout)
638                  pixaspect = .0;                 // need to leave this as is
639                  myRPmanager.NewHeader(pout);    // get prev. header info
640                  const char *    tval = myRPmanager.GetHeadStr("TILED=");
641 <                if (tval) sscanf(tval, "%d %d", &tileGrid[0], &tileGrid[1]);
641 >                if (!tval || sscanf(tval, "%d %d", &tileGrid[0], &tileGrid[1]) != 2)
642 >                        error(USER, "existing picture must be tiled");
643                  CHECK(myRPmanager.GetView()==NULL,
644                                  USER, "missing view in picture file");
645                  ourview = *myRPmanager.GetView();
# Line 748 | Line 748 | rpiece(char *pout, RenderDataType dt, char *zout)
748                  ndone++;
749          }
750          if (!ndone)
751 <                error(WARNING, "no tiles need rendering, exit");
751 >                error(WARNING, "no tiles to render, exiting");
752          /*
753          munmap(pixMap, pmlen);                  // technically unnecessary...
754          if (zdMap) munmap(zdMap, zmlen);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines