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.28 by greg, Sun Dec 3 02:28:33 2023 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines