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

Comparing ray/src/rt/rc2.c (file contents):
Revision 2.18 by greg, Thu Aug 18 00:52:48 2016 UTC vs.
Revision 2.19 by greg, Mon Sep 12 20:31:34 2016 UTC

# Line 184 | Line 184 | getostream(const char *ospec, const char *mname, int b
184                  sop = (STREAMOUT *)malloc(sizeof(STREAMOUT));
185                  if (sop == NULL)
186                          error(SYSTEM, "out of memory in getostream");
187 <                sop->outpipe = oname[0] == '!';
187 >                sop->outpipe = (oname[0] == '!');
188                  sop->reclen = 0;
189                  sop->ofp = NULL;                /* open iff noopen==0 */
190                  sop->xr = xres; sop->yr = yres;
# Line 194 | Line 194 | getostream(const char *ospec, const char *mname, int b
194                          errno = EEXIST;         /* file exists */
195                          goto openerr;
196                  }
197 +        } else if (noopen && outfmt == 'c' &&   /* stream exists to picture? */
198 +                        (sop->xr > 0) & (sop->yr > 0)) {
199 +                if (ofl & OF_BIN)
200 +                        return(NULL);           /* let caller offset bins */
201 +                sprintf(errmsg, "output '%s' not a valid picture", oname);
202 +                error(WARNING, errmsg);
203          }
204          if (!noopen && sop->ofp == NULL) {      /* open output stream */
205                  if (oname[0] == '!')            /* output to command */
# Line 331 | Line 337 | put_contrib(const DCOLOR cnt, FILE *fout)
337   void
338   mod_output(MODCONT *mp)
339   {
340 <        STREAMOUT       *sop = getostream(mp->outspec, mp->modname, 0, 0);
340 >        STREAMOUT       *sop = getostream(mp->outspec, mp->modname, mp->bin0, 0);
341          int             j;
342  
343          put_contrib(mp->cbin[0], sop->ofp);
344          if (mp->nbins > 3 &&    /* minor optimization */
345 <                        sop == getostream(mp->outspec, mp->modname, 1, 0)) {
345 >                        sop == getostream(mp->outspec, mp->modname, mp->bin0+1, 0)) {
346                  for (j = 1; j < mp->nbins; j++)
347                          put_contrib(mp->cbin[j], sop->ofp);
348          } else {
349                  for (j = 1; j < mp->nbins; j++) {
350 <                        sop = getostream(mp->outspec, mp->modname, j, 0);
350 >                        sop = getostream(mp->outspec, mp->modname, mp->bin0+j, 0);
351                          put_contrib(mp->cbin[j], sop->ofp);
352                  }
353          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines