Author: greatlrd Date: Sun Nov 25 14:16:27 2007 New Revision: 30730
URL: http://svn.reactos.org/svn/reactos?rev=30730&view=rev Log: update d3d8 to wine 0.9.49
Modified: trunk/reactos/dll/directx/wine/d3d8/d3d8_main.c trunk/reactos/dll/directx/wine/d3d8/device.c trunk/reactos/dll/directx/wine/d3d8/directx.c trunk/reactos/dll/directx/wine/d3d8/stateblock.c trunk/reactos/dll/directx/wine/d3d8/vertexdeclaration.c trunk/reactos/dll/directx/wine/d3d8/volume.c
Modified: trunk/reactos/dll/directx/wine/d3d8/d3d8_main.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/d3d8_... ============================================================================== --- trunk/reactos/dll/directx/wine/d3d8/d3d8_main.c (original) +++ trunk/reactos/dll/directx/wine/d3d8/d3d8_main.c Sun Nov 25 14:16:27 2007 @@ -75,11 +75,11 @@ * ValidateVertexShader (D3D8.@) * * I've seen reserved1 and reserved2 always passed as 0's - * bool seems always passed as 0 or 1, but other values work as well.... + * bool seems always passed as 0 or 1, but other values work as well.... * toto result? */ HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL bool, DWORD* toto) -{ +{ HRESULT ret; FIXME("(%p %p %p %d %p): stub\n", vertexshader, reserved1, reserved2, bool, toto);
@@ -91,7 +91,7 @@
switch(*vertexshader) { case 0xFFFE0101: - case 0xFFFE0100: + case 0xFFFE0100: ret=S_OK; break; default: @@ -112,12 +112,12 @@ { HRESULT ret; FIXME("(%p %p %d %p): stub\n", pixelshader, reserved1, bool, toto); - + if (!pixelshader) return E_FAIL;
if (reserved1) - return E_FAIL; + return E_FAIL;
switch(*pixelshader) { case 0xFFFF0100:
Modified: trunk/reactos/dll/directx/wine/d3d8/device.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/devic... ============================================================================== --- trunk/reactos/dll/directx/wine/d3d8/device.c (original) +++ trunk/reactos/dll/directx/wine/d3d8/device.c Sun Nov 25 14:16:27 2007 @@ -463,7 +463,7 @@ LeaveCriticalSection(&d3d8_cs);
if (FAILED(hrc)) { - /* free up object */ + /* free up object */ FIXME("(%p) call to IWineD3DDevice_CreateTexture failed\n", This); HeapFree(GetProcessHeap(), 0, object); /* *ppTexture = NULL; */ @@ -477,8 +477,8 @@ return hrc; }
-static HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(LPDIRECT3DDEVICE8 iface, - UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, +static HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(LPDIRECT3DDEVICE8 iface, + UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture8** ppVolumeTexture) {
IDirect3DVolumeTexture8Impl *object; @@ -518,7 +518,7 @@ return hrc; }
-static HRESULT WINAPI IDirect3DDevice8Impl_CreateCubeTexture(LPDIRECT3DDEVICE8 iface, UINT EdgeLength, UINT Levels, DWORD Usage, +static HRESULT WINAPI IDirect3DDevice8Impl_CreateCubeTexture(LPDIRECT3DDEVICE8 iface, UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture8** ppCubeTexture) {
IDirect3DCubeTexture8Impl *object; @@ -634,7 +634,7 @@ IDirect3DSurface8Impl *object; IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; TRACE("(%p) Relay\n", This); - if(MultisampleQuality < 0) { + if(MultisampleQuality < 0) { FIXME("MultisampleQuality out of range %d, substituting 0\n", MultisampleQuality); /*FIXME: Find out what windows does with a MultisampleQuality < 0 */ MultisampleQuality=0; @@ -989,7 +989,7 @@ IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; HRESULT hr; TRACE("(%p) Relay\n" , This); - + /* Note: D3DLIGHT8 is compatible with WINED3DLIGHT */ EnterCriticalSection(&d3d8_cs); hr = IWineD3DDevice_SetLight(This->WineD3DDevice, Index, (const WINED3DLIGHT *)pLight); @@ -1413,7 +1413,7 @@ }
static HRESULT WINAPI IDirect3DDevice8Impl_DrawPrimitive(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) { - IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; + IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; HRESULT hr; TRACE("(%p) Relay\n" , This);
@@ -1803,6 +1803,12 @@ TRACE("(%p) Relay\n", This);
EnterCriticalSection(&d3d8_cs); + /* WineD3D takes an INT(due to d3d9), but d3d8 uses UINTs. Do I have to add a check here that + * the UINT doesn't cause an overflow in the INT? It seems rather unlikely because such large + * vertex buffers can't be created to address them with an index that requires the 32nd bit + * (4 Byte minimum vertex size * 2^31-1 -> 8 gb buffer. The index sign would be the least + * problem) + */ IWineD3DDevice_SetBaseVertexIndex(This->WineD3DDevice, baseVertexIndex); hr = IWineD3DDevice_SetIndices(This->WineD3DDevice, pIndexData ? ((IDirect3DIndexBuffer8Impl *)pIndexData)->wineD3DIndexBuffer : NULL); @@ -1822,7 +1828,8 @@ }
EnterCriticalSection(&d3d8_cs); - IWineD3DDevice_GetBaseVertexIndex(This->WineD3DDevice, pBaseVertexIndex); + /* The case from UINT to INT is safe because d3d8 will never set negative values */ + IWineD3DDevice_GetBaseVertexIndex(This->WineD3DDevice, (INT *) pBaseVertexIndex); rc = IWineD3DDevice_GetIndices(This->WineD3DDevice, &retIndexData); if (SUCCEEDED(rc) && retIndexData) { IWineD3DIndexBuffer_GetParent(retIndexData, (IUnknown **)ppIndexData);
Modified: trunk/reactos/dll/directx/wine/d3d8/directx.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/direc... ============================================================================== --- trunk/reactos/dll/directx/wine/d3d8/directx.c (original) +++ trunk/reactos/dll/directx/wine/d3d8/directx.c Sun Nov 25 14:16:27 2007 @@ -109,8 +109,8 @@
TRACE("(%p)->(%d,%08x, %p\n", This, Adapter, Flags, pIdentifier); EnterCriticalSection(&d3d8_cs); - /* dx8 and dx9 have different structures to be filled in, with incompatible - layouts so pass in pointers to the places to be filled via an internal + /* dx8 and dx9 have different structures to be filled in, with incompatible + layouts so pass in pointers to the places to be filled via an internal structure */ adapter_id.Driver = pIdentifier->Driver; adapter_id.Description = pIdentifier->Description; @@ -203,7 +203,7 @@ return hr; }
-static HRESULT WINAPI IDirect3D8Impl_CheckDepthStencilMatch(LPDIRECT3D8 iface, +static HRESULT WINAPI IDirect3D8Impl_CheckDepthStencilMatch(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) { IDirect3D8Impl *This = (IDirect3D8Impl *)iface; @@ -269,8 +269,8 @@ IDirect3DSurface8Impl *d3dSurface = NULL;
TRACE("(%p) call back\n", device); - res = IDirect3DDevice8_CreateRenderTarget((IDirect3DDevice8 *)device, Width, Height, - (D3DFORMAT)Format, MultiSample, Lockable, + res = IDirect3DDevice8_CreateRenderTarget((IDirect3DDevice8 *)device, Width, Height, + (D3DFORMAT)Format, MultiSample, Lockable, (IDirect3DSurface8 **)&d3dSurface);
if (SUCCEEDED(res)) { @@ -365,7 +365,7 @@ IDirect3DSurface8Impl *d3dSurface = NULL; TRACE("(%p) call back\n", device);
- res = IDirect3DDevice8_CreateDepthStencilSurface((IDirect3DDevice8 *)device, Width, Height, + res = IDirect3DDevice8_CreateDepthStencilSurface((IDirect3DDevice8 *)device, Width, Height, (D3DFORMAT)Format, MultiSample, (IDirect3DSurface8 **)&d3dSurface); if (SUCCEEDED(res)) { *ppSurface = d3dSurface->wineD3DSurface;
Modified: trunk/reactos/dll/directx/wine/d3d8/stateblock.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/state... ============================================================================== --- trunk/reactos/dll/directx/wine/d3d8/stateblock.c (original) +++ trunk/reactos/dll/directx/wine/d3d8/stateblock.c Sun Nov 25 14:16:27 2007 @@ -67,19 +67,19 @@ /* IDirect3DStateBlock8 Interface follow: */ static HRESULT WINAPI IDirect3DStateBlock8Impl_GetDevice(IDirect3DStateBlock8 *iface, IDirect3DDevice8 **ppDevice) { IDirect3DStateBlock8Impl *This = (IDirect3DStateBlock8Impl *)iface; - TRACE("(%p) Relay\n", This); + TRACE("(%p) Relay\n", This); return IDirect3DResource8Impl_GetDevice((LPDIRECT3DRESOURCE8) This, ppDevice); }
static HRESULT WINAPI IDirect3DStateBlock8Impl_Capture(IDirect3DStateBlock8 *iface) { IDirect3DStateBlock8Impl *This = (IDirect3DStateBlock8Impl *)iface; - TRACE("(%p) Relay\n", This); + TRACE("(%p) Relay\n", This); return IWineD3DStateBlock_Capture(This->wineD3DStateBlock); }
static HRESULT WINAPI IDirect3DStateBlock8Impl_Apply(IDirect3DStateBlock8 *iface) { IDirect3DStateBlock8Impl *This = (IDirect3DStateBlock8Impl *)iface; - TRACE("(%p) Relay\n", This); + TRACE("(%p) Relay\n", This); return IWineD3DStateBlock_Apply(This->wineD3DStateBlock); }
Modified: trunk/reactos/dll/directx/wine/d3d8/vertexdeclaration.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/verte... ============================================================================== --- trunk/reactos/dll/directx/wine/d3d8/vertexdeclaration.c (original) +++ trunk/reactos/dll/directx/wine/d3d8/vertexdeclaration.c Sun Nov 25 14:16:27 2007 @@ -284,7 +284,7 @@ TRACE("d3d8_elements %p, wined3d_elements %p\n", d3d8_elements, wined3d_elements);
/* 128 should be enough for anyone... */ - *wined3d_elements = HeapAlloc(GetProcessHeap(), 0, 128 * sizeof(WINED3DVERTEXELEMENT)); + *wined3d_elements = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 128 * sizeof(WINED3DVERTEXELEMENT)); while (D3DVSD_END() != *token) { token_type = ((*token & D3DVSD_TOKENTYPEMASK) >> D3DVSD_TOKENTYPESHIFT);
Modified: trunk/reactos/dll/directx/wine/d3d8/volume.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/volum... ============================================================================== --- trunk/reactos/dll/directx/wine/d3d8/volume.c (original) +++ trunk/reactos/dll/directx/wine/d3d8/volume.c Sun Nov 25 14:16:27 2007 @@ -229,10 +229,10 @@
object->lpVtbl = &Direct3DVolume8_Vtbl; object->ref = 1; - hrc = IWineD3DDevice_CreateVolume(This->WineD3DDevice, Width, Height, Depth, Usage, Format, + hrc = IWineD3DDevice_CreateVolume(This->WineD3DDevice, Width, Height, Depth, Usage, Format, Pool, &object->wineD3DVolume, pSharedHandle, (IUnknown *)object); if (hrc != D3D_OK) { - /* free up object */ + /* free up object */ FIXME("(%p) call to IWineD3DDevice_CreateVolume failed\n", This); HeapFree(GetProcessHeap(), 0, object); *ppVolume = NULL;