protected override void ApplyLightChanges(List<CqLight> lightChanges)
{
foreach (var light in lightChanges)
{
if (light.Data.IsLinearLight)
{
uint lightmeshinstanceid = light.IdCrc;
var ld = light.Data;
switch (light.ChangeType)
{
case CqLight.Event.Deleted:
var cob = _objectDatabase.FindObjectRelation(lightmeshinstanceid);
var delob = new CyclesObject {cob = cob};
_objectDatabase.DeleteObject(delob);
_objectDatabase.DeleteMesh(ld.Id);
break;
default:
HandleLinearLightAddOrModify(lightmeshinstanceid, ld);
break;
}
}
else
{
// we don't necessarily get view changes prior to light changes, so
// the old _currentViewInfo could be null - at the end of a Flush
// it would be thrown away. Hence we now ask the ChangeQueue for the
// proper view info. It will be given if one constructed the ChangeQueue
// with a view to force it to be a single-view only ChangeQueue.
// See #RH-32345 and #RH-32356
var v = GetQueueView();
var cl = _shaderConverter.ConvertLight(this, light, v, PreProcessGamma);
_lightDatabase.AddLight(cl);
}
}
}