Commit a4d733ae authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

- remove fogging too when doing the flush of the frame buffer

- handle dest rect in the Blt DEPTH_FILL case - fix QueryInterface on the D3D Device
parent 66855d4a
......@@ -241,7 +241,7 @@ Main_IDirect3DDeviceImpl_7_3T_2T_1T_QueryInterface(LPDIRECT3DDEVICE7 iface,
TRACE(" Return IDirectDrawSurface3 interface %p\n", *obp);
return S_OK;
}
if ( IsEqualGUID( &IID_IDirectDrawSurface3, riid ) ||
if ( IsEqualGUID( &IID_IDirectDrawSurface4, riid ) ||
IsEqualGUID( &IID_IDirectDrawSurface7, riid ) ) {
IDirectDrawSurface7_AddRef(ICOM_INTERFACE(This->surface, IDirectDrawSurface7));
*obp = ICOM_INTERFACE(This->surface, IDirectDrawSurface7);
......
......@@ -2862,7 +2862,7 @@ static void d3ddevice_flush_to_frame_buffer(IDirect3DDeviceImpl *d3d_dev, LPCREC
GLenum buffer_type, buffer_color;
RECT loc_rect;
IDirect3DDeviceGLImpl* gl_d3d_dev = (IDirect3DDeviceGLImpl*) d3d_dev;
GLint depth_test, alpha_test, cull_face, lighting, min_tex, max_tex, tex_env, blend, stencil_test;
GLint depth_test, alpha_test, cull_face, lighting, min_tex, max_tex, tex_env, blend, stencil_test, fog;
GLuint initial_texture;
GLint tex_state;
int x, y;
......@@ -2885,6 +2885,7 @@ static void d3ddevice_flush_to_frame_buffer(IDirect3DDeviceImpl *d3d_dev, LPCREC
glGetIntegerv(GL_BLEND, &blend);
glGetIntegerv(GL_TEXTURE_BINDING_2D, &initial_texture);
glGetIntegerv(GL_TEXTURE_2D, &tex_state);
glGetIntegerv(GL_FOG, &fog);
glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &max_tex);
glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, &min_tex);
glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &tex_env);
......@@ -2939,6 +2940,7 @@ static void d3ddevice_flush_to_frame_buffer(IDirect3DDeviceImpl *d3d_dev, LPCREC
glDisable(GL_ALPHA_TEST);
glDisable(GL_STENCIL_TEST);
glDisable(GL_BLEND);
glDisable(GL_FOG);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
......@@ -2976,6 +2978,7 @@ static void d3ddevice_flush_to_frame_buffer(IDirect3DDeviceImpl *d3d_dev, LPCREC
if (stencil_test != 0) glEnable(GL_STENCIL_TEST);
if (cull_face != 0) glEnable(GL_CULL_FACE);
if (blend != 0) glEnable(GL_BLEND);
if (fog != 0) glEnable(GL_FOG);
glBindTexture(GL_TEXTURE_2D, initial_texture);
if (tex_state == 0) glDisable(GL_TEXTURE_2D);
glDisable(GL_SCISSOR_TEST);
......
......@@ -132,10 +132,17 @@ FakeZBuffer_DirectDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst,
}
/* We only support the BLT with DEPTH_FILL for now */
if ((dwFlags & DDBLT_DEPTHFILL) && This->ddraw_owner->d3d != NULL) {
if ((dwFlags & DDBLT_DEPTHFILL) && (This->ddraw_owner->d3d != NULL)) {
if (This->ddraw_owner->d3d->current_device != NULL) {
D3DRECT rect;
if (rdst) {
rect.u1.x1 = rdst->left;
rect.u2.y1 = rdst->top;
rect.u3.x2 = rdst->right;
rect.u4.y2 = rdst->bottom;
}
This->ddraw_owner->d3d->current_device->clear(This->ddraw_owner->d3d->current_device,
0, NULL, /* Clear the whole screen */
(rdst == NULL ? 0 : 1), &rect,
D3DCLEAR_ZBUFFER,
0x00000000,
((double) lpbltfx->u5.dwFillDepth) / 4294967295.0,
......
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