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

Comparing ray/src/rt/pmaprand.h (file contents):
Revision 2.1 by greg, Tue Feb 24 19:39:27 2015 UTC vs.
Revision 2.2 by greg, Tue Apr 21 19:16:51 2015 UTC

# Line 20 | Line 20
20     erand48() with separate states for photon emission, scattering, and
21     russian roulette. The pmapSeed() and pmapRandom() macros can be adapted
22     to other (better?) RNGs. */  
23 +
24 + #if defined(_WIN32) || defined(BSD)
25 +   /* Assume no erand48(), so use standard RNG without explicit multistate
26 +      control; the resulting sequences will be suboptimal */      
27 +   #include "random.h"
28    
29 < #define pmapSeed(seed, state) (state [0] += seed, state [1] += seed, \
30 <                               state [2] += seed)
31 < #define pmapRandom(state) erand48(state)
29 >   #define pmapSeed(seed, state) (srandom(seed))
30 >   #define pmapRandom(state)     (frandom())
31 > #else
32 >   #define pmapSeed(seed, state) (state [0] += seed, state [1] += seed, \
33 >                                  state [2] += seed)
34 >   #define pmapRandom(state) erand48(state)
35 > #endif
36  
28
37    
38   extern unsigned short partState [3], emitState [3], cntState [3],
39                        mediumState [3], scatterState [3], rouletteState [3],
40                        randSeed;
41  
42   #endif
43 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines