| 228 | // -------------------------------------------------------------------------------------------------------------------- |
| 229 | |
| 230 | CSource::CSource(CSimulator* simulator, |
| 231 | IPLSourceSettings* settings) |
| 232 | { |
| 233 | auto _context = simulator->mHandle.context(); |
| 234 | if (!_context) |
| 235 | throw Exception(Status::Failure); |
| 236 | |
| 237 | auto _simulator = simulator->mHandle.get(); |
| 238 | if (!_simulator) |
| 239 | throw Exception(Status::Failure); |
| 240 | |
| 241 | auto _enableIndirect = (settings->flags & IPL_SIMULATIONFLAGS_REFLECTIONS); |
| 242 | auto _enablePathing = (settings->flags & IPL_SIMULATIONFLAGS_PATHING); |
| 243 | auto _sceneType = static_cast<SceneType>(_simulator->sceneType()); |
| 244 | auto _indirectType = static_cast<IndirectEffectType>(_simulator->indirectType()); |
| 245 | auto _maxNumOcclusionSamples = _simulator->maxNumOcclusionSamples(); |
| 246 | auto _maxDuration = _simulator->maxDuration(); |
| 247 | auto _maxOrder = _simulator->maxOrder(); |
| 248 | auto _samplingRate = _simulator->samplingRate(); |
| 249 | auto _frameSize = _simulator->frameSize(); |
| 250 | auto _openCL = _simulator->openCLDevice(); |
| 251 | auto _tan = _simulator->tanDevice(); |
| 252 | |
| 253 | new (&mHandle) Handle<SimulationData>(ipl::make_shared<SimulationData>(_enableIndirect, _enablePathing, _sceneType, _indirectType, |
| 254 | _maxNumOcclusionSamples, _maxDuration, _maxOrder, |
| 255 | _samplingRate, _frameSize, _openCL, _tan), _context); |
| 256 | } |
| 257 | |
| 258 | ISource* CSource::retain() |
| 259 | { |
nothing calls this directly
no test coverage detected