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.3 by greg, Tue Aug 13 16:31:35 2019 UTC vs.
Revision 2.4 by greg, Wed Aug 14 21:00:14 2019 UTC

# Line 65 | Line 65 | encode_normals(NORMCODEC *ncp)
65   #ifdef SMLFLT
66                  case 'f':
67                          ok = (getbinary(nrm, sizeof(*nrm), 3, ncp->finp) == 3);
68 +                        if (ncp->swapped)
69 +                                swap32((char *)nrm, 3);
70                          break;
71                  case 'd': {
72 <                                double  nrmd[3];
73 <                                ok = (getbinary(nrmd, sizeof(*nrmd),
74 <                                                3, ncp->finp) == 3);
75 <                                if (ok) VCOPY(nrm, nrmd);
76 <                        }
77 <                        break;
72 >                        double  nrmd[3];
73 >                        ok = (getbinary(nrmd, sizeof(*nrmd),
74 >                                        3, ncp->finp) == 3);
75 >                        if (ncp->swapped)
76 >                                swap64((char *)nrmd, 3);
77 >                        if (ok) VCOPY(nrm, nrmd);
78 >                        } break;
79   #else
80                  case 'f': {
81 <                                float   nrmf[3];
82 <                                ok = (getbinary(nrmf, sizeof(*nrmf),
83 <                                                3, ncp->finp) == 3);
84 <                                if (ok) VCOPY(nrm, nrmf);
85 <                        }
86 <                        break;
81 >                        float   nrmf[3];
82 >                        ok = (getbinary(nrmf, sizeof(*nrmf),
83 >                                        3, ncp->finp) == 3);
84 >                        if (ncp->swapped)
85 >                                swap32((char *)nrmf, 3);
86 >                        if (ok) VCOPY(nrm, nrmf);
87 >                        } break;
88                  case 'd':
89                          ok = (getbinary(nrm, sizeof(*nrm), 3, ncp->finp) == 3);
90 +                        if (ncp->swapped)
91 +                                swap64((char *)nrm, 3);
92                          break;
93   #endif
94                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines