From eb620386dd93b48381032ddc27febb895c646a62 Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Thu, 2 Jan 2003 19:56:08 +0000 Subject: [PATCH] Handle more blend states. --- dlls/ddraw/mesa.c | 48 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/dlls/ddraw/mesa.c b/dlls/ddraw/mesa.c index a138e5f65bc..4c4d4436aac 100644 --- a/dlls/ddraw/mesa.c +++ b/dlls/ddraw/mesa.c @@ -197,28 +197,72 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType, case D3DRENDERSTATE_SRCBLEND: /* 19 */ switch ((D3DBLEND) dwRenderState) { + case D3DBLEND_ZERO: + rs->src = GL_ZERO; + break; case D3DBLEND_ONE: rs->src = GL_ONE; break; case D3DBLEND_SRCALPHA: rs->src = GL_SRC_ALPHA; break; + case D3DBLEND_INVSRCALPHA: + rs->src = GL_ONE_MINUS_SRC_ALPHA; + break; + case D3DBLEND_DESTALPHA: + rs->src = GL_DST_ALPHA; + break; + case D3DBLEND_INVDESTALPHA: + rs->src = GL_ONE_MINUS_DST_ALPHA; + break; + case D3DBLEND_DESTCOLOR: + rs->src = GL_DST_COLOR; + break; + case D3DBLEND_INVDESTCOLOR: + rs->src = GL_ONE_MINUS_DST_COLOR; + break; + case D3DBLEND_SRCCOLOR: + case D3DBLEND_INVSRCCOLOR: + /* Cannot be supported with OpenGL */ + break; default: - ERR("Unhandled blend mode %ld !\n",dwRenderState); + ERR("Unhandled src blend mode %ld !\n",dwRenderState); } glBlendFunc(rs->src, rs->dst); break; case D3DRENDERSTATE_DESTBLEND: /* 20 */ switch ((D3DBLEND) dwRenderState) { + case D3DBLEND_ZERO: + rs->dst = GL_ZERO; + break; case D3DBLEND_ONE: rs->dst = GL_ONE; break; + case D3DBLEND_SRCCOLOR: + rs->dst = GL_SRC_COLOR; + break; + case D3DBLEND_INVSRCCOLOR: + rs->dst = GL_ONE_MINUS_SRC_COLOR; + break; + case D3DBLEND_SRCALPHA: + rs->dst = GL_SRC_ALPHA; + break; case D3DBLEND_INVSRCALPHA: rs->dst = GL_ONE_MINUS_SRC_ALPHA; break; + case D3DBLEND_DESTALPHA: + rs->dst = GL_DST_ALPHA; + break; + case D3DBLEND_INVDESTALPHA: + rs->dst = GL_ONE_MINUS_DST_ALPHA; + break; + case D3DBLEND_DESTCOLOR: + case D3DBLEND_INVDESTCOLOR: + /* Cannot be supported with OpenGL */ + break; default: - ERR("Unhandled blend mode %ld !\n",dwRenderState); + ERR("Unhandled dest blend mode %ld !\n",dwRenderState); } glBlendFunc(rs->src, rs->dst); break;