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

Comparing ray/src/cv/bsdfrep.c (file contents):
Revision 2.2 by greg, Sat Oct 20 07:02:00 2012 UTC vs.
Revision 2.3 by greg, Sat Oct 20 17:01:26 2012 UTC

# Line 281 | Line 281 | get_dsf(int ord)
281          RBFNODE         *rbf;
282  
283          for (rbf = dsf_list; rbf != NULL; rbf = rbf->next)
284 <                if (rbf->ord == ord);
284 >                if (rbf->ord == ord)
285                          return(rbf);
286          return(NULL);
287   }
# Line 370 | Line 370 | save_bsdf_rep(FILE *ofp)
370                                          /* write out as sparse data */
371                  n = mtx_nrows(mig) * mtx_ncols(mig);
372                  for (i = 0; i < n; i++) {
373 <                        if (zerocnt >= 0xff) {
374 <                                putint(zerocnt, 1, ofp); zerocnt = 0;
373 >                        if (zerocnt == 0xff) {
374 >                                putint(0xff, 1, ofp); zerocnt = 0;
375                          }
376                          if (mig->mtx[i] != 0) {
377                                  putint(zerocnt, 1, ofp); zerocnt = 0;
# Line 441 | Line 441 | load_bsdf_rep(FILE *ifp)
441                  rbfh.invec[0] = getflt(ifp);
442                  rbfh.invec[1] = getflt(ifp);
443                  rbfh.invec[2] = getflt(ifp);
444 +                rbfh.vtotal = getflt(ifp);
445                  rbfh.nrbf = getint(4, ifp);
445                if (!new_input_vector(rbfh.invec))
446                        return(0);
446                  newrbf = (RBFNODE *)malloc(sizeof(RBFNODE) +
447                                          sizeof(RBFVAL)*(rbfh.nrbf-1));
448                  if (newrbf == NULL)
# Line 487 | Line 486 | load_bsdf_rep(FILE *ifp)
486                  memset(newmig->mtx, 0, sizeof(float)*n);
487                  for (i = 0; ; ) {       /* read sparse data */
488                          int     zc = getint(1, ifp) & 0xff;
490                        if (zc == 0xff) {
491                                i += 0xff;
492                                continue;
493                        }
489                          if ((i += zc) >= n)
490                                  break;
491 +                        if (zc == 0xff)
492 +                                continue;
493                          newmig->mtx[i++] = getflt(ifp);
494                  }
495                  if (feof(ifp))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines