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

Comparing ray/src/util/rmtxop.c (file contents):
Revision 2.27 by greg, Sat Dec 2 00:42:21 2023 UTC vs.
Revision 2.29 by greg, Sun Dec 3 03:44:42 2023 UTC

# Line 103 | Line 103 | checkreffile(ROPMAT *rop)
103                  for (j = refm.ncomp; j-- > 0; )
104                          rop->preop.cmat[j*nc + i] = scresp[j];
105          }
106 +        memcpy(rop->mtx->wlpart, refm.wlpart, sizeof(rop->mtx->wlpart));
107          return(0);
108   }
109  
# Line 274 | Line 275 | loadop(ROPMAT *rop)
275                          if (rop->preop.nsf == 1) {
276                                  for (i = rop->preop.clen; i--; )
277                                          rop->preop.cmat[i] *= rop->preop.sca[0];
278 <                        } else if (rop->preop.nsf != rop->mtx->ncomp) {
278 >                        } else if (rop->preop.nsf*rop->mtx->ncomp != rop->preop.clen) {
279                                  fprintf(stderr, "%s: -s must have one or %d factors\n",
280 <                                                rop->inspec, rop->mtx->ncomp);
280 >                                                rop->inspec,
281 >                                                rop->preop.clen/rop->mtx->ncomp);
282                                  goto failure;
283                          } else {
284 <                                for (j = rop->preop.clen/rop->preop.nsf; j--; )
285 <                                        for (i = rop->preop.nsf; i--; )
286 <                                                rop->preop.cmat[j*rop->preop.nsf+i] *=
287 <                                                                rop->preop.sca[i];
284 >                                for (i = rop->preop.nsf; i--; )
285 >                                        for (j = rop->mtx->ncomp; j--; )
286 >                                                rop->preop.cmat[i*rop->mtx->ncomp+j]
287 >                                                                *= rop->preop.sca[i];
288                          }
289                  }
290                  mres = rmx_transform(rop->mtx, rop->preop.clen/rop->mtx->ncomp,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines