- fix Twist demo
- some clean-ups / traces
diff --git a/dlls/ddraw/d3ddevice/mesa.c b/dlls/ddraw/d3ddevice/mesa.c
index a2b9c36..546022d 100644
--- a/dlls/ddraw/d3ddevice/mesa.c
+++ b/dlls/ddraw/d3ddevice/mesa.c
@@ -45,12 +45,6 @@
{ 0x82,0x2d,0xa8,0xd5,0x31,0x87,0xca,0xfa }
};
-/* Define this variable if you have an unpatched Mesa 3.0 (patches are available
- on Mesa's home page) or version 3.1b.
-
- Version 3.1b2 should correct this bug */
-#undef HAVE_BUGGY_MESAGL
-
#ifndef HAVE_GLEXT_PROTOTYPES
/* This is for non-OpenGL ABI compliant glext.h headers :-) */
typedef void (* PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat,
@@ -358,9 +352,6 @@
if (cb_1) if (cb_1(&sdesc , context) == 0) return DD_OK;
if (cb_2) if (cb_2(pformat, context) == 0) return DD_OK;
-#ifndef HAVE_BUGGY_MESAGL
- /* The packed texture format are buggy in Mesa. The bug was reported and corrected,
- so that future version will work great. */
TRACE("Enumerating GL_RGB packed GL_UNSIGNED_SHORT_5_6_5 (16)\n");
pformat->dwFlags = DDPF_RGB;
pformat->u1.dwRGBBitCount = 16;
@@ -400,7 +391,6 @@
pformat->u5.dwRGBAlphaBitMask = 0x00000000;
if (cb_1) if (cb_1(&sdesc , context) == 0) return DD_OK;
if (cb_2) if (cb_2(pformat, context) == 0) return DD_OK;
-#endif
TRACE("Enumerating GL_ARGB (no direct OpenGL equivalent - conversion needed)\n");
pformat->dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
diff --git a/dlls/ddraw/d3dtexture.c b/dlls/ddraw/d3dtexture.c
index 16ed1fd..07c5143 100644
--- a/dlls/ddraw/d3dtexture.c
+++ b/dlls/ddraw/d3dtexture.c
@@ -606,8 +606,6 @@
return D3D_OK;
}
-/* NOTE : if you experience crashes in this function, you must have a buggy
- version of Mesa. See the file d3dtexture.c for a cure */
HRESULT WINAPI
GL_IDirect3DTextureImpl_2_1T_Load(LPDIRECT3DTEXTURE2 iface,
LPDIRECT3DTEXTURE2 lpD3DTexture2)
@@ -637,10 +635,8 @@
if ( This->surface_desc.ddsCaps.dwCaps & DDSCAPS_ALLOCONLOAD )
/* If the surface is not allocated and its location is not yet specified,
force it to video memory */
- if ( !(This->surface_desc.ddsCaps.dwCaps & (DDSCAPS_SYSTEMMEMORY|DDSCAPS_VIDEOMEMORY)) ) {
+ if ( !(This->surface_desc.ddsCaps.dwCaps & (DDSCAPS_SYSTEMMEMORY|DDSCAPS_VIDEOMEMORY)) )
This->surface_desc.ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY;
- WARN("This case is not properly handled yet.. Expect errors !\n");
- }
/* Suppress the ALLOCONLOAD flag */
This->surface_desc.ddsCaps.dwCaps &= ~DDSCAPS_ALLOCONLOAD;
@@ -783,6 +779,17 @@
XCAST(Load) GL_IDirect3DTextureImpl_2_1T_Load,
};
+ICOM_VTABLE(IDirect3DTexture2) STUB_VTABLE_IDirect3DTexture2 =
+{
+ ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
+ XCAST(QueryInterface) Thunk_IDirect3DTextureImpl_2_QueryInterface,
+ XCAST(AddRef) Thunk_IDirect3DTextureImpl_2_AddRef,
+ XCAST(Release) Thunk_IDirect3DTextureImpl_2_Release,
+ XCAST(GetHandle) Main_IDirect3DTextureImpl_2_1T_GetHandle,
+ XCAST(PaletteChanged) Main_IDirect3DTextureImpl_2_1T_PaletteChanged,
+ XCAST(Load) Main_IDirect3DTextureImpl_2_1T_Load,
+};
+
#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
#undef XCAST
#endif
@@ -816,6 +823,14 @@
{
IDirect3DTextureGLImpl *private;
+ if ((surf->surface_desc.ddsCaps.dwCaps & (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY)) != 0) {
+ /* If it is an offscreen texture, only create stub implementations.
+ Only the IUnknown interfaces should be used anyway. */
+ ICOM_INIT_INTERFACE(surf, IDirect3DTexture, VTABLE_IDirect3DTexture); /* No special STUB one here as all functions are stubs */
+ ICOM_INIT_INTERFACE(surf, IDirect3DTexture2, STUB_VTABLE_IDirect3DTexture2);
+ return DD_OK;
+ }
+
private = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DTextureGLImpl));
if (private == NULL) return DDERR_OUTOFMEMORY;
diff --git a/dlls/ddraw/dsurface/main.c b/dlls/ddraw/dsurface/main.c
index 29b9a30..5d997b0 100644
--- a/dlls/ddraw/dsurface/main.c
+++ b/dlls/ddraw/dsurface/main.c
@@ -81,6 +81,7 @@
DDRAW_IDDS3_Thunk_VTable);
ICOM_INIT_INTERFACE(This, IDirectDrawGammaControl,
DDRAW_IDDGC_VTable);
+
/* There is no generic implementation of IDDS7 or texture */
Main_DirectDraw_AddSurface(pDD, This);
@@ -195,8 +196,7 @@
/* In case the texture surface was created before the D3D creation */
if ((This->surface_desc.ddsCaps.dwCaps & DDSCAPS_TEXTURE) == 0) return E_NOINTERFACE;
/* Create a 'delayed' private field only if it is not an offscreen texture... */
- if ((This->tex_private == NULL) &&
- ((This->surface_desc.ddsCaps.dwCaps & (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY)) == 0)) {
+ if (This->tex_private == NULL) {
if (This->ddraw_owner->d3d == NULL) {
ERR("Texture created with no D3D object yet.. Not supported !\n");
return E_NOINTERFACE;
diff --git a/dlls/ddraw/mesa.c b/dlls/ddraw/mesa.c
index 86fcdd5..1149e74 100644
--- a/dlls/ddraw/mesa.c
+++ b/dlls/ddraw/mesa.c
@@ -41,10 +41,9 @@
case D3DCMP_NOTEQUAL: return GL_NOTEQUAL;
case D3DCMP_GREATEREQUAL: return GL_GEQUAL;
case D3DCMP_ALWAYS: return GL_ALWAYS;
- default:
- ERR("Unexpected compare type !!!\n");
- return GL_NEVER;
+ default: ERR("Unexpected compare type %d !\n", dwRenderState);
}
+ return GL_ALWAYS;
}
@@ -92,7 +91,7 @@
case D3DTADDRESS_WRAP: arg = GL_REPEAT; break;
case D3DTADDRESS_CLAMP: arg = GL_CLAMP; break;
case D3DTADDRESS_BORDER: arg = GL_CLAMP_TO_EDGE; break;
- default: ERR("Unhandled TEXTUREADDRESS mode !\n");
+ default: ERR("Unhandled TEXTUREADDRESS mode %ld !\n", dwRenderState);
}
if ((dwRenderStateType == D3DRENDERSTATE_TEXTUREADDRESSU) ||
(dwRenderStateType == D3DRENDERSTATE_TEXTUREADDRESS))