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

Comparing ray/src/px/pcomb.c (file contents):
Revision 2.49 by greg, Mon Feb 5 20:07:17 2018 UTC vs.
Revision 2.52 by greg, Wed Apr 3 20:16:31 2019 UTC

# Line 31 | Line 31 | struct {
31  
32   int     nfiles;                         /* number of input files */
33  
34 < VIEW    commvw;                         /* common view parameters */
34 > VIEW    *commvp = NULL;                 /* common view parameters */
35  
36   char    ourfmt[LPICFMT+1] = PICFMT;     /* input picture format */
37  
# Line 193 | Line 193 | main(
193          init();                         /* set constants */
194                                          /* go back and get expressions */
195          for (a = 1; a < argc; a++) {
196 +                char    *fpath;
197                  if (argv[a][0] == '-')
198                          switch (argv[a][1]) {
199                          case 'x':
# Line 206 | Line 207 | main(
207                          case 'h':
208                                  continue;
209                          case 'f':
210 <                                fcompile(argv[++a]);
210 >                                fpath = getpath(argv[++a], getrlibpath(), 0);
211 >                                if (fpath == NULL) {
212 >                                        eputs(argv[0]);
213 >                                        eputs(": cannot find file '");
214 >                                        eputs(argv[a]);
215 >                                        eputs("'\n");
216 >                                        quit(1);
217 >                                }
218 >                                fcompile(fpath);
219                                  continue;
220                          case 'e':
221                                  scompile(argv[++a], NULL, 0);
# Line 224 | Line 233 | main(
233          }
234                                                  /* complete header */
235          printargs(argc, argv, stdout);
236 <        if (commvw.type) {
236 >        if (commvp != NULL) {
237                  fputs(VIEWSTR, stdout);
238 <                fprintview(&commvw, stdout);
238 >                fprintview(commvp, stdout);
239                  fputc('\n', stdout);
240          }
241          if (strcmp(ourfmt, PICFMT))
# Line 252 | Line 261 | headline(                      /* check header line & echo if requested *
261          void    *p
262   )
263   {
264 <        char    fmt[32];
264 >        char    fmt[MAXFMTLEN];
265          double  d;
266          COLOR   ctmp;
267  
# Line 307 | Line 316 | checkfile(void)                        /* ready a file */
316          }
317          if (!gotview || setview(&input[nfiles].vw) != NULL)
318                  input[nfiles].vw.type = 0;
319 <        else if (!commvw.type)
320 <                commvw = input[nfiles].vw;
319 >        else if (commvp == NULL)
320 >                commvp = &input[nfiles].vw;
321          if (!fgetsresolu(&input[nfiles].rs, input[nfiles].fp)) {
322                  eputs(input[nfiles].name);
323                  eputs(": bad picture size\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines