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

- separate geometry tracing in a new debug channel (ddraw_geom)

- added handling for some new texturing ops - prepare for addition of multi-texturing - another way to fix the device enumeration for the reference device - fix compilation with some glext.h files - fix a bug in one texture conversion function - added new texture format (but still texturing problems in 3DMark2000)
parent 836ce4b3
......@@ -149,7 +149,7 @@ DWORD InitTextureStageStateTab[] = {
D3DTSS_MIPFILTER, D3DTFP_NONE,
D3DTSS_MIPMAPLODBIAS, 0x00000000, /* 0.0f */
D3DTSS_MAXMIPLEVEL, 0,
D3DTSS_MAXANISOTROPY, 1,
/* D3DTSS_MAXANISOTROPY, 1, */ /* This is to prevent warnings :-) */
/* FIXME: D3DTSS_BUMPENVLSCALE */
/* FIXME: D3DTSS_NUMPENVLOFFSET */
/* FIXME: D3DTSS_TEXTURETRANSFORMFLAGS */
......
......@@ -359,6 +359,36 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *This) {
format = GL_RGBA;
pixel_format = GL_UNSIGNED_SHORT_5_5_5_1;
} else if ((src_d->ddpfPixelFormat.u2.dwRBitMask == 0x7C00) &&
(src_d->ddpfPixelFormat.u3.dwGBitMask == 0x03E0) &&
(src_d->ddpfPixelFormat.u4.dwBBitMask == 0x001F) &&
(src_d->ddpfPixelFormat.u5.dwRGBAlphaBitMask == 0x0000)) {
/* Converting the 0555 format in 5551 packed */
DWORD i;
WORD *src = (WORD *) src_d->lpSurface, *dst;
surface = (WORD *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
src_d->dwWidth * src_d->dwHeight * sizeof(WORD));
dst = (WORD *) surface;
if (src_d->dwFlags & DDSD_CKSRCBLT) {
for (i = 0; i < src_d->dwHeight * src_d->dwWidth; i++) {
WORD color = *src++;
*dst = (color & 0x7FFF) << 1;
if ((color < src_d->ddckCKSrcBlt.dwColorSpaceLowValue) ||
(color > src_d->ddckCKSrcBlt.dwColorSpaceHighValue))
*dst |= 0x0001;
dst++;
}
} else {
for (i = 0; i < src_d->dwHeight * src_d->dwWidth; i++) {
WORD color = *src++;
*dst++ = ((color & 0x7FFF) << 1) | 0x0001;
}
}
format = GL_RGBA;
pixel_format = GL_UNSIGNED_SHORT_5_5_5_1;
} else {
error = TRUE;
}
......@@ -443,6 +473,7 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *This) {
DWORD color = *src++;
*dst = (color & 0x00FFFFFF) << 8;
*dst |= (color & 0xFF000000) >> 24;
dst++;
}
}
format = GL_RGBA;
......@@ -470,8 +501,8 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *This) {
} else {
for (i = 0; i < src_d->dwHeight * src_d->dwWidth; i++) {
*dst++ = (*src++ << 8) | 0xFF;
}
}
}
}
format = GL_RGBA;
pixel_format = GL_UNSIGNED_INT_8_8_8_8;
} else {
......
......@@ -360,17 +360,6 @@ Thunk_IDirect3DImpl_2_EnumDevices(LPDIRECT3D2 iface,
}
HRESULT WINAPI
Thunk_IDirect3DImpl_1_EnumDevices(LPDIRECT3D iface,
LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback,
LPVOID lpUserArg)
{
TRACE("(%p)->(%p,%p) thunking to IDirect3D3 interface.\n", iface, lpEnumDevicesCallback, lpUserArg);
return IDirect3D3_EnumDevices(COM_INTERFACE_CAST(IDirect3DImpl, IDirect3D, IDirect3D3, iface),
lpEnumDevicesCallback,
lpUserArg);
}
HRESULT WINAPI
Thunk_IDirect3DImpl_2_CreateLight(LPDIRECT3D2 iface,
LPDIRECT3DLIGHT* lplpDirect3DLight,
IUnknown* pUnkOuter)
......
......@@ -43,15 +43,30 @@
WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
HRESULT WINAPI
GL_IDirect3DImpl_3_2T_1T_EnumDevices(LPDIRECT3D3 iface,
LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback,
LPVOID lpUserArg)
GL_IDirect3DImpl_1_EnumDevices(LPDIRECT3D iface,
LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback,
LPVOID lpUserArg)
{
ICOM_THIS_FROM(IDirect3DImpl, IDirect3D, iface);
TRACE("(%p/%p)->(%p,%p)\n", This, iface, lpEnumDevicesCallback, lpUserArg);
/* Call functions defined in d3ddevices.c */
if (d3ddevice_enumerate(lpEnumDevicesCallback, lpUserArg, 1) != D3DENUMRET_OK)
return D3D_OK;
return D3D_OK;
}
HRESULT WINAPI
GL_IDirect3DImpl_3_2T_EnumDevices(LPDIRECT3D3 iface,
LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback,
LPVOID lpUserArg)
{
ICOM_THIS_FROM(IDirect3DImpl, IDirect3D3, iface);
TRACE("(%p/%p)->(%p,%p)\n", This, iface, lpEnumDevicesCallback, lpUserArg);
/* Call functions defined in d3ddevices.c */
if (d3ddevice_enumerate(lpEnumDevicesCallback, lpUserArg) != D3DENUMRET_OK)
if (d3ddevice_enumerate(lpEnumDevicesCallback, lpUserArg, 3) != D3DENUMRET_OK)
return D3D_OK;
return D3D_OK;
......@@ -313,7 +328,7 @@ ICOM_VTABLE(IDirect3D3) VTABLE_IDirect3D3 =
XCAST(QueryInterface) Thunk_IDirect3DImpl_3_QueryInterface,
XCAST(AddRef) Thunk_IDirect3DImpl_3_AddRef,
XCAST(Release) Thunk_IDirect3DImpl_3_Release,
XCAST(EnumDevices) GL_IDirect3DImpl_3_2T_1T_EnumDevices,
XCAST(EnumDevices) GL_IDirect3DImpl_3_2T_EnumDevices,
XCAST(CreateLight) GL_IDirect3DImpl_3_2T_1T_CreateLight,
XCAST(CreateMaterial) GL_IDirect3DImpl_3_2T_1T_CreateMaterial,
XCAST(CreateViewport) GL_IDirect3DImpl_3_2T_1T_CreateViewport,
......@@ -367,7 +382,7 @@ ICOM_VTABLE(IDirect3D) VTABLE_IDirect3D =
XCAST(AddRef) Thunk_IDirect3DImpl_1_AddRef,
XCAST(Release) Thunk_IDirect3DImpl_1_Release,
XCAST(Initialize) Main_IDirect3DImpl_1_Initialize,
XCAST(EnumDevices) Thunk_IDirect3DImpl_1_EnumDevices,
XCAST(EnumDevices) GL_IDirect3DImpl_1_EnumDevices,
XCAST(CreateLight) Thunk_IDirect3DImpl_1_CreateLight,
XCAST(CreateMaterial) Thunk_IDirect3DImpl_1_CreateMaterial,
XCAST(CreateViewport) Thunk_IDirect3DImpl_1_CreateViewport,
......
......@@ -461,7 +461,8 @@ void set_render_state(IDirect3DDeviceImpl* This,
break;
default:
ERR("Unhandled dwRenderStateType %s (%08x) !\n", _get_renderstate(dwRenderStateType), dwRenderStateType);
ERR("Unhandled dwRenderStateType %s (%08x) value : %08lx !\n",
_get_renderstate(dwRenderStateType), dwRenderStateType, dwRenderState);
}
LEAVE_GL();
}
......
......@@ -133,7 +133,7 @@ extern HRESULT d3dvertexbuffer_create(IDirect3DVertexBufferImpl **obj, IDirect3D
extern HRESULT d3ddevice_create(IDirect3DDeviceImpl **obj, IDirect3DImpl *d3d, IDirectDrawSurfaceImpl *surface);
/* Used for Direct3D to request the device to enumerate itself */
extern HRESULT d3ddevice_enumerate(LPD3DENUMDEVICESCALLBACK cb, LPVOID context) ;
extern HRESULT d3ddevice_enumerate(LPD3DENUMDEVICESCALLBACK cb, LPVOID context, DWORD version) ;
extern HRESULT d3ddevice_enumerate7(LPD3DENUMDEVICESCALLBACK7 cb, LPVOID context) ;
extern HRESULT d3ddevice_find(IDirect3DImpl *d3d, LPD3DFINDDEVICESEARCH lpD3DDFS, LPD3DFINDDEVICERESULT lplpD3DDevice);
......
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