wined3d: Simplify the "transformed" check in state_lighting().
It doesn't really matter if lighting is enabled or not if we don't have position data.
This commit is contained in:
parent
a7d6128547
commit
663e5a6a4c
|
@ -81,8 +81,6 @@ static void state_fillmode(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_lighting(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_lighting(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
||||||
BOOL transformed;
|
|
||||||
|
|
||||||
/* Lighting is not enabled if transformed vertices are drawn
|
/* Lighting is not enabled if transformed vertices are drawn
|
||||||
* but lighting does not affect the stream sources, so it is not grouped for performance reasons.
|
* but lighting does not affect the stream sources, so it is not grouped for performance reasons.
|
||||||
* This state reads the decoded vertex declaration, so if it is dirty don't do anything. The
|
* This state reads the decoded vertex declaration, so if it is dirty don't do anything. The
|
||||||
|
@ -93,11 +91,9 @@ static void state_lighting(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
transformed = ((stateblock->wineD3DDevice->strided_streams.u.s.position.lpData != NULL ||
|
if (stateblock->renderState[WINED3DRS_LIGHTING]
|
||||||
stateblock->wineD3DDevice->strided_streams.u.s.position.VBO != 0) &&
|
&& !stateblock->wineD3DDevice->strided_streams.position_transformed)
|
||||||
stateblock->wineD3DDevice->strided_streams.position_transformed) ? TRUE : FALSE;
|
{
|
||||||
|
|
||||||
if (stateblock->renderState[WINED3DRS_LIGHTING] && !transformed) {
|
|
||||||
glEnable(GL_LIGHTING);
|
glEnable(GL_LIGHTING);
|
||||||
checkGLcall("glEnable GL_LIGHTING");
|
checkGLcall("glEnable GL_LIGHTING");
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue