| 140 |
|
} |
| 141 |
|
/// Set/change trace callback |
| 142 |
|
void SetTraceCall(RayReportCall *cb, void *cd = NULL) { |
| 143 |
< |
if (cb == traceCall) { |
| 144 |
< |
if (cb) tcData = cd; |
| 145 |
< |
return; |
| 146 |
< |
} |
| 143 |
> |
if ((cb == traceCall) & (cd == tcData)) return; |
| 144 |
|
int nt = NThreads(); |
| 145 |
|
if (nt > 1) SetThreadCount(1); |
| 146 |
|
traceCall = cb; |
| 147 |
|
tcData = cb ? cd : NULL; |
| 148 |
+ |
UpdateMode(); |
| 149 |
|
if (nt > 1) SetThreadCount(nt); |
| 152 |
– |
} |
| 153 |
– |
/// Are we ready? |
| 154 |
– |
bool Ready() const { |
| 155 |
– |
return (cookedCall != NULL) | (traceCall != NULL) && |
| 156 |
– |
RadSimulManager::Ready(); |
| 150 |
|
} |
| 151 |
|
/// Finish pending rays and complete callbacks (return #sent) |
| 152 |
|
int FlushQueue(); |