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

Comparing ray/src/common/testBSDF.c (file contents):
Revision 1.2 by greg, Fri Jun 5 18:58:37 2015 UTC vs.
Revision 1.3 by greg, Sat Jun 6 16:30:26 2015 UTC

# Line 45 | Line 45 | vec_from_deg(FVECT v, double theta, double phi)
45   int
46   main(int argc, char *argv[])
47   {
48 <        const char      *directory = "";
48 >        const char      *directory = NULL;
49          char            inp[512], path[512];
50          const SDData    *bsdf = NULL;
51  
# Line 56 | Line 56 | main(int argc, char *argv[])
56          if (argc == 2)
57                  directory = argv[1];
58          
59 <        SDretainSet = SDretainBSDFs;            /* keep BSDFs loaded */
59 >        SDretainSet = SDretainBSDFs;            /* keep BSDFs in memory */
60  
61                                                  /* loop on command */
62          while (fgets(inp, sizeof(inp), stdin) != NULL) {
# Line 78 | Line 78 | main(int argc, char *argv[])
78                                  break;
79                          while (*cp) cp++;
80                          while (isspace(*--cp)) *cp = '\0';
81 <                        if (directory[0])
81 >                        if (directory)
82                                  sprintf(path, "%s/%s", directory, cp2);
83                          else
84                                  strcpy(path, cp2);
85 <                        if (bsdf != NULL)
85 >                        if (bsdf)
86                                  SDfreeCache(bsdf);
87                          bsdf = SDcacheFile(path);
88                          continue;
# Line 124 | Line 124 | main(int argc, char *argv[])
124                          if (!*sskip2(cp,2))
125                                  break;
126                          if (tolower(*cp) == 'r')
127 <                                sflags ^= SDsampT;
127 >                                sflags &= ~SDsampT;
128                          else if (tolower(*cp) == 't')
129 <                                sflags ^= SDsampR;
129 >                                sflags &= ~SDsampR;
130                          vec_from_deg(vin, atof(sskip2(cp,1)), atof(sskip2(cp,2)));
131                          printf("%.4e\n", SDdirectHemi(vin, sflags, bsdf));
132                          continue;
133                  case 'a':
134 <                case 'A':                       /* resolution in degrees */
134 >                case 'A':                       /* resolution in proj. steradians */
135                          if (bsdf == NULL)
136                                  goto noBSDFerr;
137                          if (!*sskip2(cp,2))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines