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

Comparing ray/src/common/bsdf_m.c (file contents):
Revision 3.18 by greg, Thu Jul 7 15:25:09 2011 UTC vs.
Revision 3.20 by greg, Sun Aug 21 22:38:12 2011 UTC

# Line 639 | Line 639 | SDgetMtxBSDF(float coef[SDmaxCh], const FVECT outVec,
639          i_ndx = mBSDF_incndx(dp, inVec);
640          o_ndx = mBSDF_outndx(dp, outVec);
641                                          /* try reciprocity if necessary */
642 <        if ((i_ndx < 0) & (o_ndx < 0) && dp->ninc == dp->nout) {
642 >        if ((i_ndx < 0) & (o_ndx < 0)) {
643                  i_ndx = mBSDF_incndx(dp, outVec);
644                  o_ndx = mBSDF_outndx(dp, inVec);
645          }
# Line 748 | Line 748 | SDgetMtxCDist(const FVECT inVec, SDComponent *sdc)
748                  myCD.ob_vec = dp->ob_vec;
749                  myCD.calen = dp->nout;
750                  reverse = 0;
751 <        } else if (dp->ninc == dp->nout) {      /* try reciprocity */
751 >        } else {                        /* try reciprocity */
752                  myCD.indx = mBSDF_outndx(dp, inVec);
753                  if (myCD.indx < 0)
754                          return NULL;
# Line 759 | Line 759 | SDgetMtxCDist(const FVECT inVec, SDComponent *sdc)
759          }
760          cdlast = NULL;                  /* check for it in cache list */
761          for (cd = (SDMatCDst *)sdc->cdList; cd != NULL;
762 <                                cdlast = cd, cd = (SDMatCDst *)cd->next)
762 >                                        cdlast = cd, cd = cd->next)
763                  if (cd->indx == myCD.indx && (cd->calen == myCD.calen) &
764                                          (cd->ob_priv == myCD.ob_priv) &
765                                          (cd->ob_vec == myCD.ob_vec))
# Line 778 | Line 778 | SDgetMtxCDist(const FVECT inVec, SDComponent *sdc)
778          }
779          if (cdlast != NULL) {           /* move entry to head of cache list */
780                  cdlast->next = cd->next;
781 <                cd->next = sdc->cdList;
781 >                cd->next = (SDMatCDst *)sdc->cdList;
782                  sdc->cdList = (SDCDst *)cd;
783          }
784          return (SDCDst *)cd;            /* ready to go */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines