# | Line 28 | Line 28 | ray_pinit( /* initialize ray-tracing processes */ | |
---|---|---|
28 | int nproc | |
29 | ) | |
30 | { | |
31 | – | if (nproc > 1) |
32 | – | error(WARNING, "Only single process supported"); |
31 | ray_pdone(0); | |
32 | ray_init(otnm); | |
33 | ray_popen(nproc); | |
# | Line 57 | Line 55 | ray_pqueue( /* queue a ray for computation */ | |
55 | { | |
56 | if (r == NULL) | |
57 | return(0); | |
58 | < | ray_value(r); |
58 | > | if (ray_pnidle <= 0) { |
59 | > | RAY new_ray = *r; |
60 | > | *r = queued_ray; |
61 | > | queued_ray = new_ray; |
62 | > | } |
63 | > | samplendx++; |
64 | > | rayvalue(r); |
65 | return(1); | |
66 | } | |
67 | ||
# | Line 70 | Line 74 | ray_presult( /* check for a completed ray */ | |
74 | { | |
75 | if (r == NULL) | |
76 | return(0); | |
77 | < | if (!poll & (ray_pnidle <= 0)) { |
74 | < | ray_value(&queued_ray); |
77 | > | if (ray_pnidle <= 0) { |
78 | *r = queued_ray; | |
79 | + | samplendx++; |
80 | + | rayvalue(r); |
81 | ray_pnidle = 1; | |
82 | return(1); | |
83 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |