117 |
|
// Global pointer to simulation manager for trace call-back (only one) |
118 |
|
static const RtraceSimulManager * ourRTsimMan = NULL; |
119 |
|
|
120 |
< |
void // static call-back |
120 |
> |
// Call-back for trace output |
121 |
> |
void |
122 |
|
RtraceSimulManager::RTracer(RAY *r) |
123 |
|
{ |
124 |
|
(*ourRTsimMan->traceCall)(r, ourRTsimMan->tcData); |
217 |
|
return -1; |
218 |
|
|
219 |
|
if (castonly && !cookedCall) |
220 |
< |
error(CONSISTENCY, "EnqueueBundle() called in castonly mode without cookedCall"); |
220 |
> |
error(INTERNAL, "EnqueueBundle() called in castonly mode without cookedCall"); |
221 |
|
|
222 |
|
if (!UpdateMode()) // update rendering mode if requested |
223 |
|
return -1; |
227 |
|
VCOPY(res.rdir, orig_direc[1]); |
228 |
|
orig_direc += 2; |
229 |
|
rayorigin(&res, PRIMARY, NULL, NULL); |
230 |
< |
if (rID0) res.rno = rID0++; |
231 |
< |
else res.rno = ++lastRayID; |
230 |
> |
if (!rID0) |
231 |
> |
res.rno = ++lastRayID; |
232 |
> |
else if (curFlags & RTdoFIFO) |
233 |
> |
error(INTERNAL, "Ray number assignment unsupported with FIFO"); |
234 |
> |
else |
235 |
> |
res.rno = lastRayID = rID0++; |
236 |
|
if (curFlags & RTimmIrrad) |
237 |
|
res.revf = rayirrad; |
238 |
|
else if (castonly) |
242 |
|
if (d > 0) { // direction vector is valid? |
243 |
|
if (curFlags & RTlimDist) |
244 |
|
res.rmax = d; |
245 |
< |
if (curFlags & RTdoFIFO) { |
246 |
< |
ray_fifo_in(&res); |
245 |
> |
if (((curFlags&RTdoFIFO) != 0) & (ray_pnprocs > 0)) { |
246 |
> |
if (ray_fifo_in(&res) < 0) |
247 |
> |
return -1; |
248 |
|
sendRes = false; |
249 |
|
} else |
250 |
|
sendRes &= ProcessRay(&res); |
263 |
|
int |
264 |
|
RtraceSimulManager::FlushQueue() |
265 |
|
{ |
266 |
< |
if (curFlags & RTdoFIFO) |
267 |
< |
return ray_fifo_flush(); |
268 |
< |
|
266 |
> |
if (curFlags & RTdoFIFO) { |
267 |
> |
if (ray_pnprocs) |
268 |
> |
return ray_fifo_flush(); |
269 |
> |
return 0; |
270 |
> |
} |
271 |
|
int nsent = 0; |
272 |
|
RAY res; |
273 |
|
|