diff --git a/dlls/ddraw/d3ddevice/main.c b/dlls/ddraw/d3ddevice/main.c index 28a9934b330..46c81aedaf4 100644 --- a/dlls/ddraw/d3ddevice/main.c +++ b/dlls/ddraw/d3ddevice/main.c @@ -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); diff --git a/dlls/ddraw/d3ddevice/mesa.c b/dlls/ddraw/d3ddevice/mesa.c index 473c4ce2a69..d28902ef95a 100644 --- a/dlls/ddraw/d3ddevice/mesa.c +++ b/dlls/ddraw/d3ddevice/mesa.c @@ -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); diff --git a/dlls/ddraw/dsurface/fakezbuffer.c b/dlls/ddraw/dsurface/fakezbuffer.c index 5d423002ed7..63d4b600942 100644 --- a/dlls/ddraw/dsurface/fakezbuffer.c +++ b/dlls/ddraw/dsurface/fakezbuffer.c @@ -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,