[D3D] Some small fixes
Lionel Ulmer
lionel.ulmer at free.fr
Wed May 21 15:52:41 CDT 2003
Hi all,
These are the two small fixes / improvements I had on Christian's patch +
one addition change.
Changelog:
- 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
--
Lionel Ulmer - http://www.bbrox.org/
-------------- next part --------------
--- dlls/ddraw_CVS/d3ddevice/main.c Wed May 21 22:42:08 2003
+++ dlls/ddraw/d3ddevice/main.c Wed May 21 22:46:58 2003
@@ -241,7 +241,7 @@
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);
--- dlls/ddraw_CVS/d3ddevice/mesa.c Wed May 21 22:42:58 2003
+++ dlls/ddraw/d3ddevice/mesa.c Wed May 21 22:39:12 2003
@@ -2835,7 +2835,7 @@
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;
@@ -2858,6 +2858,7 @@
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);
@@ -2912,6 +2913,7 @@
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);
@@ -2949,6 +2951,7 @@
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);
--- dlls/ddraw_CVS/dsurface/fakezbuffer.c Wed May 21 22:42:09 2003
+++ dlls/ddraw/dsurface/fakezbuffer.c Wed May 21 22:49:24 2003
@@ -132,10 +132,17 @@
}
/* 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,
More information about the wine-patches
mailing list