Handle more light states.

This commit is contained in:
Christian Costa 2003-01-20 23:27:08 +00:00 committed by Alexandre Julliard
parent 2a56437f72
commit 820b8ca0e8
1 changed files with 53 additions and 30 deletions

View File

@ -575,8 +575,11 @@ GL_IDirect3DDeviceImpl_3_2T_SetLightState(LPDIRECT3DDEVICE3 iface,
TRACE("(%p/%p)->(%08x,%08lx)\n", This, iface, dwLightStateType, dwLightState); TRACE("(%p/%p)->(%08x,%08lx)\n", This, iface, dwLightStateType, dwLightState);
switch (dwLightStateType) { if (!dwLightStateType && (dwLightStateType > D3DLIGHTSTATE_COLORVERTEX))
case D3DLIGHTSTATE_MATERIAL: { /* 1 */ TRACE("Unexpected Light State Type\n");
return DDERR_INVALIDPARAMS;
if (dwLightStateType == D3DLIGHTSTATE_MATERIAL /* 1 */) {
IDirect3DMaterialImpl *mat = (IDirect3DMaterialImpl *) dwLightState; IDirect3DMaterialImpl *mat = (IDirect3DMaterialImpl *) dwLightState;
if (mat != NULL) { if (mat != NULL) {
@ -586,26 +589,46 @@ GL_IDirect3DDeviceImpl_3_2T_SetLightState(LPDIRECT3DDEVICE3 iface,
} else { } else {
ERR(" D3DLIGHTSTATE_MATERIAL called with NULL material !!!\n"); ERR(" D3DLIGHTSTATE_MATERIAL called with NULL material !!!\n");
} }
} break; } else if (dwLightStateType == D3DLIGHTSTATE_COLORMODEL /* 3 */) {
switch (dwLightState) {
case D3DCOLOR_MONO:
ERR("DDCOLOR_MONO should not happend!\n");
break;
case D3DCOLOR_RGB:
/* We are already in this mode */
break;
default:
ERR("Unknown color model!\n");
break;
}
} else {
D3DRENDERSTATETYPE rs;
switch (dwLightStateType) {
case D3DLIGHTSTATE_AMBIENT: /* 2 */ case D3DLIGHTSTATE_AMBIENT: /* 2 */
IDirect3DDevice7_SetRenderState(ICOM_INTERFACE(This, IDirect3DDevice7), rs = D3DRENDERSTATE_AMBIENT;
D3DRENDERSTATE_AMBIENT, break;
dwLightState); case D3DLIGHTSTATE_FOGMODE: /* 4 */
rs = D3DRENDERSTATE_FOGVERTEXMODE;
break;
case D3DLIGHTSTATE_FOGSTART: /* 5 */
rs = D3DRENDERSTATE_FOGSTART;
break;
case D3DLIGHTSTATE_FOGEND: /* 6 */
rs = D3DRENDERSTATE_FOGEND;
break;
case D3DLIGHTSTATE_FOGDENSITY: /* 7 */
rs = D3DRENDERSTATE_FOGDENSITY;
break;
case D3DLIGHTSTATE_COLORVERTEX: /* 8 */
rs = D3DRENDERSTATE_COLORVERTEX;
break; break;
#define UNSUP(x) case D3DLIGHTSTATE_##x: FIXME("unsupported D3DLIGHTSTATE_" #x "!\n");break;
UNSUP(COLORMODEL);
UNSUP(FOGMODE);
UNSUP(FOGSTART);
UNSUP(FOGEND);
UNSUP(FOGDENSITY);
UNSUP(COLORVERTEX);
#undef UNSUP
default: default:
TRACE("Unexpected Light State Type\n"); break;
return DDERR_INVALIDPARAMS; }
IDirect3DDevice7_SetRenderState(ICOM_INTERFACE(This, IDirect3DDevice7),
rs,dwLightState);
} }
return DD_OK; return DD_OK;