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

Comparing ray/src/util/rcode_norm.c (file contents):
Revision 2.7 by greg, Wed Feb 12 01:13:01 2020 UTC vs.
Revision 2.8 by greg, Mon Jul 20 15:53:30 2020 UTC

# Line 52 | Line 52 | encode_normals(NORMCODEC *ncp)
52                          return 0;
53                  }
54          }
55 +        if (ncp->format == 'a')
56 +                SET_FILE_TEXT(ncp->finp);
57  
58          do {
59                  int     ok = 0;
# Line 189 | Line 191 | pixel_normals(NORMCODEC *ncp, int unbuf)
191                  fputs(": can only handle standard pixel ordering\n", stderr);
192                  return 0;
193          }
194 +
195          while (scanf("%d %d", &x, &y) == 2) {
196  
197                  y = ncp->res.yr-1 - y;
# Line 339 | Line 342 | main(int argc, char *argv[])
342                  fputs(": cannot open for writing\n", stderr);
343                  return 1;
344          }
345 <        SET_FILE_BINARY(nc.finp);
346 <        if (reverse || nc.format != 'a')
344 <                SET_FILE_BINARY(stdout);
345 >        SET_FILE_BINARY(dc.finp);       /* starting assumption */
346 >        SET_FILE_BINARY(stdout);
347   #ifdef getc_unlocked                    /* avoid stupid semaphores */
348          flockfile(nc.finp);
349          flockfile(stdout);
# Line 349 | Line 351 | main(int argc, char *argv[])
351                                          /* read/copy header */
352          if (!process_nc_header(&nc, a, argv))
353                  return 1;
354 +
355 +        if (reverse && nc.format == 'a')
356 +                SET_FILE_TEXT(stdout);
357                                          /* process data */
358          if (!reverse) {
359                  if (!encode_normals(&nc))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines