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.6 by greg, Mon Feb 21 22:50:37 2011 UTC vs.
Revision 3.7 by greg, Wed Feb 23 21:58:31 2011 UTC

# Line 362 | Line 362 | load_bsdf_data(SDData *sd, ezxml_t wdb, int rowinc)
362          SDSpectralDF    *df;
363          SDMat           *dp;
364          char            *sdata;
365 +        int             tback;
366          int             inbi, outbi;
367          int             i;
368                                          /* allocate BSDF component */
369          sdata = ezxml_txt(ezxml_child(wdb, "WavelengthDataDirection"));
370 <        if (!strcasecmp(sdata, "Transmission Back") || (sd->tf == NULL &&
371 <                        !strcasecmp(sdata, "Transmission Front"))) {
370 >        if ((tback = !strcasecmp(sdata, "Transmission Back")) ||
371 >                        (sd->tf == NULL &&
372 >                                !strcasecmp(sdata, "Transmission Front"))) {
373                  if (sd->tf != NULL)
374                          SDfreeSpectralDF(sd->tf);
375                  if ((sd->tf = SDnewSpectralDF(1)) == NULL)
# Line 422 | Line 424 | load_bsdf_data(SDData *sd, ezxml_t wdb, int rowinc)
424          dp->ib_priv = &abase_list[inbi];
425          dp->ob_priv = &abase_list[outbi];
426          if (df == sd->tf) {
427 <                dp->ib_vec = &ab_getvecR;
428 <                dp->ib_ndx = &ab_getndxR;
429 <                dp->ob_vec = &ab_getvec;
430 <                dp->ob_ndx = &ab_getndx;
427 >                if (tback) {
428 >                        dp->ib_vec = &ab_getvecR;
429 >                        dp->ib_ndx = &ab_getndxR;
430 >                        dp->ob_vec = &ab_getvec;
431 >                        dp->ob_ndx = &ab_getndx;
432 >                } else {
433 >                        dp->ib_vec = &ab_getvec;
434 >                        dp->ib_ndx = &ab_getndx;
435 >                        dp->ob_vec = &ab_getvecR;
436 >                        dp->ob_ndx = &ab_getndxR;
437 >                }
438          } else if (df == sd->rf) {
439                  dp->ib_vec = &ab_getvec;
440                  dp->ib_ndx = &ab_getndx;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines