Commit c58b2f22 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

ddraw: Materials in the execute buffer are handles.

parent c0cc4d42
...@@ -246,14 +246,19 @@ IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This, ...@@ -246,14 +246,19 @@ IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This,
if (!ci->u1.dlstLightStateType && (ci->u1.dlstLightStateType > D3DLIGHTSTATE_COLORVERTEX)) if (!ci->u1.dlstLightStateType && (ci->u1.dlstLightStateType > D3DLIGHTSTATE_COLORVERTEX))
ERR("Unexpected Light State Type\n"); ERR("Unexpected Light State Type\n");
else if (ci->u1.dlstLightStateType == D3DLIGHTSTATE_MATERIAL /* 1 */) { else if (ci->u1.dlstLightStateType == D3DLIGHTSTATE_MATERIAL /* 1 */) {
IDirect3DMaterialImpl *mat = (IDirect3DMaterialImpl *) ci->u2.dwArg[0]; DWORD matHandle = ci->u2.dwArg[0];
if (mat != NULL) { if(!matHandle) {
mat->activate(mat); FIXME(" D3DLIGHTSTATE_MATERIAL called with NULL material !!!\n");
} else { } else if(matHandle >= lpDevice->numHandles) {
FIXME(" D3DLIGHTSTATE_MATERIAL called with NULL material !!!\n"); WARN("Material handle %d is invalid\n", matHandle);
} } else if(lpDevice->Handles[matHandle - 1].type != DDrawHandle_Material) {
WARN("Handle %d is not a material handle\n", matHandle);
} else {
IDirect3DMaterialImpl *mat = (IDirect3DMaterialImpl *) lpDevice->Handles[matHandle - 1].ptr;
mat->activate(mat);
} }
}
else if (ci->u1.dlstLightStateType == D3DLIGHTSTATE_COLORMODEL /* 3 */) { else if (ci->u1.dlstLightStateType == D3DLIGHTSTATE_COLORMODEL /* 3 */) {
switch (ci->u2.dwArg[0]) { switch (ci->u2.dwArg[0]) {
case D3DCOLOR_MONO: case D3DCOLOR_MONO:
......
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