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

Comparing ray/src/rt/pmapray.c (file contents):
Revision 2.2 by rschregle, Fri May 8 13:20:23 2015 UTC vs.
Revision 2.7 by greg, Wed Nov 2 22:09:14 2016 UTC

# Line 1 | Line 1
1 + #ifndef lint
2 + static const char RCSid[] = "$Id$";
3 + #endif
4 +
5   /*
6     ==================================================================
7     Photon map interface to RADIANCE raycalls
# Line 36 | Line 40 | void ray_save_pmap (RAYPARAMS *rp)
40     unsigned t;
41    
42     for (t = 0; t < NUM_PMAP_TYPES; t++) {
43 <      if (pmapParams [t].fileName) {
44 <         rp -> pmapParams [t].fileName =
45 <            (char*)malloc(strlen(pmapParams [t].fileName));          
42 <         strcpy(rp -> pmapParams [t].fileName, pmapParams [t].fileName);
43 <      }
43 >      if (pmapParams [t].fileName)
44 >         rp -> pmapParams [t].fileName = savqstr(pmapParams [t].fileName);
45 >        
46        else rp -> pmapParams [t].fileName = NULL;
47    
48        rp -> pmapParams [t].minGather = pmapParams [t].minGather;
49        rp -> pmapParams [t].maxGather = pmapParams [t].maxGather;
50 +      rp -> pmapParams [t].distribTarget = pmapParams [t].distribTarget;
51     }
52   }
53  
# Line 58 | Line 61 | void ray_restore_pmap (RAYPARAMS *rp)
61        pmapParams [t].fileName = rp -> pmapParams [t].fileName;
62        pmapParams [t].minGather = rp -> pmapParams [t].minGather;
63        pmapParams [t].maxGather = rp -> pmapParams [t].maxGather;
64 +      pmapParams [t].distribTarget = rp -> pmapParams [t].distribTarget;
65 +   }
66 + }
67 +
68 + void ray_defaults_pmap (RAYPARAMS *rp)
69 + /* Interface to ray_defaults(); set photon mapping defaults */
70 + {
71 +   unsigned t;
72 +  
73 +   for (t = 0; t < NUM_PMAP_TYPES; t++) {
74 +      rp -> pmapParams [t].fileName = NULL;
75 +      rp -> pmapParams [t].minGather = 0;
76 +      rp -> pmapParams [t].maxGather = 0;
77 +      rp -> pmapParams [t].distribTarget = 0;
78     }
79   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines