disable spot light if the extent is zero

This commit is contained in:
Ian Curtis 2016-06-29 20:53:19 +00:00
parent 1c39956568
commit 732bff2769

View file

@ -704,6 +704,11 @@ void CNew3D::RenderViewport(UINT32 addr)
vp->spotRange[0] = 1.0f / (*(float *)&vpnode[0x21]); // spotlight start
vp->spotRange[1] = *(float *)&vpnode[0x1F]; // spotlight extent
if (vp->spotRange[1] == 0) { // if light extent = 0 light is effectively disabled
spotColorIdx = 0;
}
vp->spotColor[0] = color[spotColorIdx][0]; // spotlight color
vp->spotColor[1] = color[spotColorIdx][1];
vp->spotColor[2] = color[spotColorIdx][2];