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.9 by greg, Sat Mar 23 16:40:52 2024 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 12 | Line 16
16   */
17  
18  
19 + #include "ray.h"
20   #include "pmapray.h"
21   #include "pmap.h"
22  
# Line 20 | Line 25 | void ray_init_pmap ()
25   /* Interface to ray_init(); init & load photon maps */
26   {
27     loadPmaps(photonMaps, pmapParams);
28 +
29 +   if (NCSAMP > 3 && photonMapping)
30 +        error(USER, "hyperspectral photon-mapping currently unsupported");
31   }
32  
33  
# Line 36 | Line 44 | void ray_save_pmap (RAYPARAMS *rp)
44     unsigned t;
45    
46     for (t = 0; t < NUM_PMAP_TYPES; t++) {
47 <      if (pmapParams [t].fileName) {
48 <         rp -> pmapParams [t].fileName =
49 <            (char*)malloc(strlen(pmapParams [t].fileName));          
42 <         strcpy(rp -> pmapParams [t].fileName, pmapParams [t].fileName);
43 <      }
47 >      if (pmapParams [t].fileName)
48 >         rp -> pmapParams [t].fileName = savqstr(pmapParams [t].fileName);
49 >        
50        else rp -> pmapParams [t].fileName = NULL;
51    
52        rp -> pmapParams [t].minGather = pmapParams [t].minGather;
53        rp -> pmapParams [t].maxGather = pmapParams [t].maxGather;
54 +      rp -> pmapParams [t].distribTarget = pmapParams [t].distribTarget;
55     }
56   }
57  
# Line 58 | Line 65 | void ray_restore_pmap (RAYPARAMS *rp)
65        pmapParams [t].fileName = rp -> pmapParams [t].fileName;
66        pmapParams [t].minGather = rp -> pmapParams [t].minGather;
67        pmapParams [t].maxGather = rp -> pmapParams [t].maxGather;
68 +      pmapParams [t].distribTarget = rp -> pmapParams [t].distribTarget;
69 +   }
70 + }
71 +
72 + void ray_defaults_pmap (RAYPARAMS *rp)
73 + /* Interface to ray_defaults(); set photon mapping defaults */
74 + {
75 +   unsigned t;
76 +  
77 +   for (t = 0; t < NUM_PMAP_TYPES; t++) {
78 +      rp -> pmapParams [t].fileName = NULL;
79 +      rp -> pmapParams [t].minGather = 0;
80 +      rp -> pmapParams [t].maxGather = 0;
81 +      rp -> pmapParams [t].distribTarget = 0;
82     }
83   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines