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

Comparing ray/src/util/rmatrix.c (file contents):
Revision 2.62 by greg, Tue Nov 28 00:39:56 2023 UTC vs.
Revision 2.63 by greg, Tue Nov 28 00:46:23 2023 UTC

# Line 307 | Line 307 | int
307   rmx_load_header(RMATRIX *rm, FILE *fp)
308   {
309          if (!rm | !fp)
310 <                return(-1);
310 >                return(0);
311          if (rm->info) {                         /* clear state */
312                  free(rm->info);
313                  rm->info = NULL;
# Line 327 | Line 327 | rmx_load_header(RMATRIX *rm, FILE *fp)
327                  rm->ncomp = 3;
328                  setcolor(rm->cexp, 1.f, 1.f, 1.f);
329                  memcpy(rm->wlpart, WLPART, sizeof(rm->wlpart));
330 +                rm->swapin = 0;
331          }
332          SET_FILE_BINARY(fp);
333          rm->dtype = DTascii;                    /* assumed w/o FORMAT */
334          if (getheader(fp, get_dminfo, rm) < 0) {
335                  fputs("Unrecognized matrix format\n", stderr);
336 <                return(-1);
336 >                return(0);
337          }
338                                                  /* resolution string? */
339          if ((rm->nrows <= 0) | (rm->ncols <= 0)) {
340                  if (!fscnresolu(&rm->ncols, &rm->nrows, fp))
341 <                        return(-1);
341 >                        return(0);
342                  if ((rm->dtype == DTrgbe) | (rm->dtype == DTxyze) &&
343                                  rm->ncomp != 3)
344 <                        return(-1);
344 >                        return(0);
345          }
346 <        return(rm->dtype);
346 >        return(1);
347   }
348  
349   /* Allocate & load post-header data from stream given type set in rm->dtype */
# Line 408 | Line 409 | rmx_load(const char *inspec, RMPref rmp)
409          flockfile(fp);
410   #endif
411                                                  /* load header info */
412 <        if (rmx_load_header(dnew = rmx_new(0,0,3), fp) < 0) {
412 >        if (!rmx_load_header(dnew = rmx_new(0,0,3), fp)) {
413                  fprintf(stderr, "Bad header in: %s\n", inspec);
414                  if (inspec[0] == '!') pclose(fp);
415                  else fclose(fp);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines