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

Comparing ray/src/util/rtcontrib.c (file contents):
Revision 1.47 by greg, Sat Nov 17 15:57:28 2007 UTC vs.
Revision 1.48 by greg, Sat Nov 17 16:27:14 2007 UTC

# Line 1293 | Line 1293 | reload_output(void)
1293                                          error(USER, errmsg);
1294                                  }
1295                          }
1296                        if (oent->key == NULL)  /* new file entry */
1297                                oent->key = strcpy((char *)
1298                                                malloc(strlen(oname)+1), oname);
1299                        if (oent->data == NULL)
1300                                oent->data = (char *)malloc(sizeof(STREAMOUT));
1301                        *(STREAMOUT *)oent->data = sout;
1296                                                          /* read in RGB value */
1297                          if (!get_contrib(rgbv, sout.ofp)) {
1298 <                                if (!j)
1298 >                                if (!j) {
1299 >                                        fclose(sout.ofp);
1300                                          break;          /* ignore empty file */
1301 +                                }
1302                                  if (j < mp->nbins) {
1303                                          sprintf(errmsg, "missing data in '%s'",
1304                                                          oname);
# Line 1313 | Line 1309 | reload_output(void)
1309                          if (j >= mp->nbins)             /* grow modifier size */
1310                                  ment->data = (char *)(mp = growmodifier(mp, j+1));
1311                          copycolor(mp->cbin[j], rgbv);
1312 +                        if (oent->key == NULL)          /* new file entry */
1313 +                                oent->key = strcpy((char *)
1314 +                                                malloc(strlen(oname)+1), oname);
1315 +                        if (oent->data == NULL)
1316 +                                oent->data = (char *)malloc(sizeof(STREAMOUT));
1317 +                        *(STREAMOUT *)oent->data = sout;
1318                  }
1319          }
1320          lu_doall(&ofiletab, myclose, NULL);     /* close all files */
# Line 1388 | Line 1390 | recover_output(FILE *fin)
1390                          } else {
1391                                  sout.reclen = 0;
1392                                  sout.outpipe = 0;
1391                                sout.xr = xres; sout.yr = yres;
1393                                  sout.ofp = NULL;
1394                          }
1395                          if (sout.ofp != NULL) { /* already open? */
# Line 1429 | Line 1430 | recover_output(FILE *fin)
1430                                                  oname);
1431                                  error(USER, errmsg);
1432                          }
1433 <                        if ((xres > 0) & (yres > 0) &&
1433 >                        sout.xr = xres; sout.yr = yres;
1434 >                        if ((sout.xr > 0) & (sout.yr > 0) &&
1435                                          (!fscnresolu(&xr, &yr, sout.ofp) ||
1436 <                                                (xr != xres) |
1437 <                                                (yr != yres))) {
1436 >                                                (xr != sout.xr) |
1437 >                                                (yr != sout.yr))) {
1438                                  sprintf(errmsg, "resolution mismatch for '%s'",
1439                                                  oname);
1440                                  error(USER, errmsg);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines