Commit f5c8153e authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Handle stateblock capture for default lights created while recording.

For non-recorded stateblocks a light always exists in the device stateblock as well, since that's where it's copied from. However, when SetLightEnable() is called for a light that didn't a exist yet while recording a stateblock, the light is only created on the recorded stateblock.
parent 5bac33d3
......@@ -573,8 +573,17 @@ static void record_lights(IWineD3DStateBlockImpl *This, const IWineD3DStateBlock
if (!updated)
{
ERR("Light %u in stateblock %p does not exist in device stateblock %p.\n",
/* This can happen if the light was originally created as a
* default light for SetLightEnable() while recording. */
WARN("Light %u in stateblock %p does not exist in device stateblock %p.\n",
src->OriginalIndex, This, targetStateBlock);
src->OriginalParms = WINED3D_default_light;
if (src->glIndex != -1)
{
This->activeLights[src->glIndex] = NULL;
src->glIndex = -1;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment