update d3d8 to wine 0.9.49

svn path=/trunk/; revision=30730
This commit is contained in:
Magnus Olsen 2007-11-25 11:16:27 +00:00
parent 3d237b54ad
commit c6102fb959
6 changed files with 32 additions and 25 deletions

View file

@ -75,11 +75,11 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
* ValidateVertexShader (D3D8.@) * ValidateVertexShader (D3D8.@)
* *
* I've seen reserved1 and reserved2 always passed as 0's * 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? * toto result?
*/ */
HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL bool, DWORD* toto) HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL bool, DWORD* toto)
{ {
HRESULT ret; HRESULT ret;
FIXME("(%p %p %p %d %p): stub\n", vertexshader, reserved1, reserved2, bool, toto); FIXME("(%p %p %p %d %p): stub\n", vertexshader, reserved1, reserved2, bool, toto);
@ -91,7 +91,7 @@ HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD
switch(*vertexshader) { switch(*vertexshader) {
case 0xFFFE0101: case 0xFFFE0101:
case 0xFFFE0100: case 0xFFFE0100:
ret=S_OK; ret=S_OK;
break; break;
default: default:
@ -112,12 +112,12 @@ HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, BOOL bo
{ {
HRESULT ret; HRESULT ret;
FIXME("(%p %p %d %p): stub\n", pixelshader, reserved1, bool, toto); FIXME("(%p %p %d %p): stub\n", pixelshader, reserved1, bool, toto);
if (!pixelshader) if (!pixelshader)
return E_FAIL; return E_FAIL;
if (reserved1) if (reserved1)
return E_FAIL; return E_FAIL;
switch(*pixelshader) { switch(*pixelshader) {
case 0xFFFF0100: case 0xFFFF0100:

View file

@ -463,7 +463,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateTexture(LPDIRECT3DDEVICE8 iface
LeaveCriticalSection(&d3d8_cs); LeaveCriticalSection(&d3d8_cs);
if (FAILED(hrc)) { if (FAILED(hrc)) {
/* free up object */ /* free up object */
FIXME("(%p) call to IWineD3DDevice_CreateTexture failed\n", This); FIXME("(%p) call to IWineD3DDevice_CreateTexture failed\n", This);
HeapFree(GetProcessHeap(), 0, object); HeapFree(GetProcessHeap(), 0, object);
/* *ppTexture = NULL; */ /* *ppTexture = NULL; */
@ -477,8 +477,8 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateTexture(LPDIRECT3DDEVICE8 iface
return hrc; return hrc;
} }
static HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(LPDIRECT3DDEVICE8 iface, static HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(LPDIRECT3DDEVICE8 iface,
UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage,
D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture8** ppVolumeTexture) { D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture8** ppVolumeTexture) {
IDirect3DVolumeTexture8Impl *object; IDirect3DVolumeTexture8Impl *object;
@ -518,7 +518,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(LPDIRECT3DDEVICE8
return hrc; 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) { D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture8** ppCubeTexture) {
IDirect3DCubeTexture8Impl *object; IDirect3DCubeTexture8Impl *object;
@ -634,7 +634,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateSurface(LPDIRECT3DDEVICE8 iface
IDirect3DSurface8Impl *object; IDirect3DSurface8Impl *object;
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
TRACE("(%p) Relay\n", This); TRACE("(%p) Relay\n", This);
if(MultisampleQuality < 0) { if(MultisampleQuality < 0) {
FIXME("MultisampleQuality out of range %d, substituting 0\n", MultisampleQuality); FIXME("MultisampleQuality out of range %d, substituting 0\n", MultisampleQuality);
/*FIXME: Find out what windows does with a MultisampleQuality < 0 */ /*FIXME: Find out what windows does with a MultisampleQuality < 0 */
MultisampleQuality=0; MultisampleQuality=0;
@ -989,7 +989,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetLight(LPDIRECT3DDEVICE8 iface, DWO
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
HRESULT hr; HRESULT hr;
TRACE("(%p) Relay\n" , This); TRACE("(%p) Relay\n" , This);
/* Note: D3DLIGHT8 is compatible with WINED3DLIGHT */ /* Note: D3DLIGHT8 is compatible with WINED3DLIGHT */
EnterCriticalSection(&d3d8_cs); EnterCriticalSection(&d3d8_cs);
hr = IWineD3DDevice_SetLight(This->WineD3DDevice, Index, (const WINED3DLIGHT *)pLight); hr = IWineD3DDevice_SetLight(This->WineD3DDevice, Index, (const WINED3DLIGHT *)pLight);
@ -1413,7 +1413,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetCurrentTexturePalette(LPDIRECT3D
} }
static HRESULT WINAPI IDirect3DDevice8Impl_DrawPrimitive(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) { static HRESULT WINAPI IDirect3DDevice8Impl_DrawPrimitive(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) {
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
HRESULT hr; HRESULT hr;
TRACE("(%p) Relay\n" , This); TRACE("(%p) Relay\n" , This);
@ -1803,6 +1803,12 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetIndices(LPDIRECT3DDEVICE8 iface, I
TRACE("(%p) Relay\n", This); TRACE("(%p) Relay\n", This);
EnterCriticalSection(&d3d8_cs); 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); IWineD3DDevice_SetBaseVertexIndex(This->WineD3DDevice, baseVertexIndex);
hr = IWineD3DDevice_SetIndices(This->WineD3DDevice, hr = IWineD3DDevice_SetIndices(This->WineD3DDevice,
pIndexData ? ((IDirect3DIndexBuffer8Impl *)pIndexData)->wineD3DIndexBuffer : NULL); pIndexData ? ((IDirect3DIndexBuffer8Impl *)pIndexData)->wineD3DIndexBuffer : NULL);
@ -1822,7 +1828,8 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(LPDIRECT3DDEVICE8 iface, I
} }
EnterCriticalSection(&d3d8_cs); 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); rc = IWineD3DDevice_GetIndices(This->WineD3DDevice, &retIndexData);
if (SUCCEEDED(rc) && retIndexData) { if (SUCCEEDED(rc) && retIndexData) {
IWineD3DIndexBuffer_GetParent(retIndexData, (IUnknown **)ppIndexData); IWineD3DIndexBuffer_GetParent(retIndexData, (IUnknown **)ppIndexData);

View file

@ -109,8 +109,8 @@ static HRESULT WINAPI IDirect3D8Impl_GetAdapterIdentifier (LPDIRECT3D8 i
TRACE("(%p)->(%d,%08x, %p\n", This, Adapter, Flags, pIdentifier); TRACE("(%p)->(%d,%08x, %p\n", This, Adapter, Flags, pIdentifier);
EnterCriticalSection(&d3d8_cs); EnterCriticalSection(&d3d8_cs);
/* dx8 and dx9 have different structures to be filled in, with incompatible /* 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 layouts so pass in pointers to the places to be filled via an internal
structure */ structure */
adapter_id.Driver = pIdentifier->Driver; adapter_id.Driver = pIdentifier->Driver;
adapter_id.Description = pIdentifier->Description; adapter_id.Description = pIdentifier->Description;
@ -203,7 +203,7 @@ static HRESULT WINAPI IDirect3D8Impl_CheckDeviceMultiSampleType(LPDIRECT3D8 if
return hr; return hr;
} }
static HRESULT WINAPI IDirect3D8Impl_CheckDepthStencilMatch(LPDIRECT3D8 iface, static HRESULT WINAPI IDirect3D8Impl_CheckDepthStencilMatch(LPDIRECT3D8 iface,
UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) { D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) {
IDirect3D8Impl *This = (IDirect3D8Impl *)iface; IDirect3D8Impl *This = (IDirect3D8Impl *)iface;
@ -269,8 +269,8 @@ HRESULT WINAPI D3D8CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior,
IDirect3DSurface8Impl *d3dSurface = NULL; IDirect3DSurface8Impl *d3dSurface = NULL;
TRACE("(%p) call back\n", device); TRACE("(%p) call back\n", device);
res = IDirect3DDevice8_CreateRenderTarget((IDirect3DDevice8 *)device, Width, Height, res = IDirect3DDevice8_CreateRenderTarget((IDirect3DDevice8 *)device, Width, Height,
(D3DFORMAT)Format, MultiSample, Lockable, (D3DFORMAT)Format, MultiSample, Lockable,
(IDirect3DSurface8 **)&d3dSurface); (IDirect3DSurface8 **)&d3dSurface);
if (SUCCEEDED(res)) { if (SUCCEEDED(res)) {
@ -365,7 +365,7 @@ HRESULT WINAPI D3D8CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSup
IDirect3DSurface8Impl *d3dSurface = NULL; IDirect3DSurface8Impl *d3dSurface = NULL;
TRACE("(%p) call back\n", device); 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); (D3DFORMAT)Format, MultiSample, (IDirect3DSurface8 **)&d3dSurface);
if (SUCCEEDED(res)) { if (SUCCEEDED(res)) {
*ppSurface = d3dSurface->wineD3DSurface; *ppSurface = d3dSurface->wineD3DSurface;

View file

@ -67,19 +67,19 @@ static ULONG WINAPI IDirect3DStateBlock8Impl_Release(IDirect3DStateBlock8 *iface
/* IDirect3DStateBlock8 Interface follow: */ /* IDirect3DStateBlock8 Interface follow: */
static HRESULT WINAPI IDirect3DStateBlock8Impl_GetDevice(IDirect3DStateBlock8 *iface, IDirect3DDevice8 **ppDevice) { static HRESULT WINAPI IDirect3DStateBlock8Impl_GetDevice(IDirect3DStateBlock8 *iface, IDirect3DDevice8 **ppDevice) {
IDirect3DStateBlock8Impl *This = (IDirect3DStateBlock8Impl *)iface; IDirect3DStateBlock8Impl *This = (IDirect3DStateBlock8Impl *)iface;
TRACE("(%p) Relay\n", This); TRACE("(%p) Relay\n", This);
return IDirect3DResource8Impl_GetDevice((LPDIRECT3DRESOURCE8) This, ppDevice); return IDirect3DResource8Impl_GetDevice((LPDIRECT3DRESOURCE8) This, ppDevice);
} }
static HRESULT WINAPI IDirect3DStateBlock8Impl_Capture(IDirect3DStateBlock8 *iface) { static HRESULT WINAPI IDirect3DStateBlock8Impl_Capture(IDirect3DStateBlock8 *iface) {
IDirect3DStateBlock8Impl *This = (IDirect3DStateBlock8Impl *)iface; IDirect3DStateBlock8Impl *This = (IDirect3DStateBlock8Impl *)iface;
TRACE("(%p) Relay\n", This); TRACE("(%p) Relay\n", This);
return IWineD3DStateBlock_Capture(This->wineD3DStateBlock); return IWineD3DStateBlock_Capture(This->wineD3DStateBlock);
} }
static HRESULT WINAPI IDirect3DStateBlock8Impl_Apply(IDirect3DStateBlock8 *iface) { static HRESULT WINAPI IDirect3DStateBlock8Impl_Apply(IDirect3DStateBlock8 *iface) {
IDirect3DStateBlock8Impl *This = (IDirect3DStateBlock8Impl *)iface; IDirect3DStateBlock8Impl *This = (IDirect3DStateBlock8Impl *)iface;
TRACE("(%p) Relay\n", This); TRACE("(%p) Relay\n", This);
return IWineD3DStateBlock_Apply(This->wineD3DStateBlock); return IWineD3DStateBlock_Apply(This->wineD3DStateBlock);
} }

View file

@ -284,7 +284,7 @@ size_t convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3d8_el
TRACE("d3d8_elements %p, wined3d_elements %p\n", d3d8_elements, wined3d_elements); TRACE("d3d8_elements %p, wined3d_elements %p\n", d3d8_elements, wined3d_elements);
/* 128 should be enough for anyone... */ /* 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) while (D3DVSD_END() != *token)
{ {
token_type = ((*token & D3DVSD_TOKENTYPEMASK) >> D3DVSD_TOKENTYPESHIFT); token_type = ((*token & D3DVSD_TOKENTYPEMASK) >> D3DVSD_TOKENTYPESHIFT);

View file

@ -229,10 +229,10 @@ HRESULT WINAPI D3D8CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT
object->lpVtbl = &Direct3DVolume8_Vtbl; object->lpVtbl = &Direct3DVolume8_Vtbl;
object->ref = 1; 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); Pool, &object->wineD3DVolume, pSharedHandle, (IUnknown *)object);
if (hrc != D3D_OK) { if (hrc != D3D_OK) {
/* free up object */ /* free up object */
FIXME("(%p) call to IWineD3DDevice_CreateVolume failed\n", This); FIXME("(%p) call to IWineD3DDevice_CreateVolume failed\n", This);
HeapFree(GetProcessHeap(), 0, object); HeapFree(GetProcessHeap(), 0, object);
*ppVolume = NULL; *ppVolume = NULL;