Author: khornicek
Date: Sun Jan 18 15:11:53 2009
New Revision: 38916
URL:
http://svn.reactos.org/svn/reactos?rev=38916&view=rev
Log:
- sync d3d9 with wine HEAD
Modified:
trunk/reactos/dll/directx/wine/d3d9/cubetexture.c
trunk/reactos/dll/directx/wine/d3d9/d3d9_private.h
trunk/reactos/dll/directx/wine/d3d9/device.c
trunk/reactos/dll/directx/wine/d3d9/directx.c
trunk/reactos/dll/directx/wine/d3d9/pixelshader.c
trunk/reactos/dll/directx/wine/d3d9/query.c
trunk/reactos/dll/directx/wine/d3d9/stateblock.c
trunk/reactos/dll/directx/wine/d3d9/surface.c
trunk/reactos/dll/directx/wine/d3d9/swapchain.c
trunk/reactos/dll/directx/wine/d3d9/texture.c
trunk/reactos/dll/directx/wine/d3d9/vertexdeclaration.c
trunk/reactos/dll/directx/wine/d3d9/vertexshader.c
trunk/reactos/dll/directx/wine/d3d9/volume.c
trunk/reactos/dll/directx/wine/d3d9/volumetexture.c
Modified: trunk/reactos/dll/directx/wine/d3d9/cubetexture.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/cube…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d9/cubetexture.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d9/cubetexture.c [iso-8859-1] Sun Jan 18 15:11:53
2009
@@ -348,21 +348,20 @@
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (NULL == object) {
- FIXME("(%p) allocation of CubeTexture failed\n", This);
+ ERR("(%p) allocation of CubeTexture failed\n", This);
return D3DERR_OUTOFVIDEOMEMORY;
}
object->lpVtbl = &Direct3DCubeTexture9_Vtbl;
object->ref = 1;
EnterCriticalSection(&d3d9_cs);
hr = IWineD3DDevice_CreateCubeTexture(This->WineD3DDevice, EdgeLength, Levels,
Usage,
- (WINED3DFORMAT)Format, (WINED3DPOOL) Pool,
&object->wineD3DCubeTexture, pSharedHandle, (IUnknown*)object,
- D3D9CB_CreateSurface);
+ Format, Pool, &object->wineD3DCubeTexture, pSharedHandle,
(IUnknown*)object);
LeaveCriticalSection(&d3d9_cs);
if (hr != D3D_OK){
/* free up object */
- FIXME("(%p) call to IWineD3DDevice_CreateCubeTexture failed\n", This);
+ WARN("(%p) call to IWineD3DDevice_CreateCubeTexture failed\n", This);
HeapFree(GetProcessHeap(), 0, object);
} else {
IDirect3DDevice9Ex_AddRef(iface);
Modified: trunk/reactos/dll/directx/wine/d3d9/d3d9_private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/d3d9…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d9/d3d9_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d9/d3d9_private.h [iso-8859-1] Sun Jan 18 15:11:53
2009
@@ -167,6 +167,7 @@
* Predeclare the interface implementation structures
*/
extern const IDirect3DDevice9ExVtbl Direct3DDevice9_Vtbl;
+extern const IWineD3DDeviceParentVtbl d3d9_wined3d_device_parent_vtbl;
/*****************************************************************************
* IDirect3DDevice9 implementation structure
@@ -175,6 +176,7 @@
{
/* IUnknown fields */
const IDirect3DDevice9ExVtbl *lpVtbl;
+ const IWineD3DDeviceParentVtbl *device_parent_vtbl;
LONG ref;
/* IDirect3DDevice9 fields */
@@ -233,6 +235,7 @@
/*****************************************************************************
* IDirect3DVolume9 implementation structure
*/
+extern const IDirect3DVolume9Vtbl Direct3DVolume9_Vtbl;
typedef struct IDirect3DVolume9Impl
{
/* IUnknown fields */
@@ -551,34 +554,10 @@
/* Callbacks */
-extern HRESULT WINAPI D3D9CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT
Width, UINT Height,
- WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL
Pool, UINT Level,
- WINED3DCUBEMAP_FACES Face, IWineD3DSurface**
ppSurface,
- HANDLE* pSharedHandle);
-
-extern HRESULT WINAPI D3D9CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT
Width, UINT Height, UINT Depth,
- WINED3DFORMAT Format, WINED3DPOOL Pool, DWORD
Usage,
- IWineD3DVolume **ppVolume,
- HANDLE * pSharedHandle);
-
-extern HRESULT WINAPI D3D9CB_CreateDepthStencilSurface(IUnknown *device, IUnknown
*pSuperior, UINT Width, UINT Height,
- WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE
MultiSample,
- DWORD MultisampleQuality, BOOL Discard,
- IWineD3DSurface** ppSurface, HANDLE*
pSharedHandle);
-
-extern HRESULT WINAPI D3D9CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior,
UINT Width, UINT Height,
- WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE
MultiSample,
- DWORD MultisampleQuality, BOOL Lockable,
- IWineD3DSurface** ppSurface, HANDLE*
pSharedHandle);
-
extern ULONG WINAPI D3D9CB_DestroySwapChain (IWineD3DSwapChain *pSwapChain);
-
extern ULONG WINAPI D3D9CB_DestroyDepthStencilSurface (IWineD3DSurface *pSurface);
-
extern ULONG WINAPI D3D9CB_DestroyRenderTarget (IWineD3DSurface *pSurface);
-
extern ULONG WINAPI D3D9CB_DestroySurface(IWineD3DSurface *pSurface);
-
extern ULONG WINAPI D3D9CB_DestroyVolume(IWineD3DVolume *pVolume);
#endif /* __WINE_D3D9_PRIVATE_H */
Modified: trunk/reactos/dll/directx/wine/d3d9/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/devi…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d9/device.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d9/device.c [iso-8859-1] Sun Jan 18 15:11:53 2009
@@ -59,6 +59,13 @@
}
}
+ if (IsEqualGUID(riid, &IID_IWineD3DDeviceParent))
+ {
+ IUnknown_AddRef((IUnknown *)&This->device_parent_vtbl);
+ *ppobj = &This->device_parent_vtbl;
+ return S_OK;
+ }
+
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
*ppobj = NULL;
return E_NOINTERFACE;
@@ -1008,13 +1015,50 @@
return hr;
}
+static const WINED3DTEXTURESTAGESTATETYPE tss_lookup[] =
+{
+ WINED3DTSS_FORCE_DWORD, /* 0, unused */
+ WINED3DTSS_COLOROP, /* 1, D3DTSS_COLOROP */
+ WINED3DTSS_COLORARG1, /* 2, D3DTSS_COLORARG1 */
+ WINED3DTSS_COLORARG2, /* 3, D3DTSS_COLORARG2 */
+ WINED3DTSS_ALPHAOP, /* 4, D3DTSS_ALPHAOP */
+ WINED3DTSS_ALPHAARG1, /* 5, D3DTSS_ALPHAARG1 */
+ WINED3DTSS_ALPHAARG2, /* 6, D3DTSS_ALPHAARG2 */
+ WINED3DTSS_BUMPENVMAT00, /* 7, D3DTSS_BUMPENVMAT00 */
+ WINED3DTSS_BUMPENVMAT01, /* 8, D3DTSS_BUMPENVMAT01 */
+ WINED3DTSS_BUMPENVMAT10, /* 9, D3DTSS_BUMPENVMAT10 */
+ WINED3DTSS_BUMPENVMAT11, /* 10, D3DTSS_BUMPENVMAT11 */
+ WINED3DTSS_TEXCOORDINDEX, /* 11, D3DTSS_TEXCOORDINDEX */
+ WINED3DTSS_FORCE_DWORD, /* 12, unused */
+ WINED3DTSS_FORCE_DWORD, /* 13, unused */
+ WINED3DTSS_FORCE_DWORD, /* 14, unused */
+ WINED3DTSS_FORCE_DWORD, /* 15, unused */
+ WINED3DTSS_FORCE_DWORD, /* 16, unused */
+ WINED3DTSS_FORCE_DWORD, /* 17, unused */
+ WINED3DTSS_FORCE_DWORD, /* 18, unused */
+ WINED3DTSS_FORCE_DWORD, /* 19, unused */
+ WINED3DTSS_FORCE_DWORD, /* 20, unused */
+ WINED3DTSS_FORCE_DWORD, /* 21, unused */
+ WINED3DTSS_BUMPENVLSCALE, /* 22, D3DTSS_BUMPENVLSCALE */
+ WINED3DTSS_BUMPENVLOFFSET, /* 23, D3DTSS_BUMPENVLOFFSET */
+ WINED3DTSS_TEXTURETRANSFORMFLAGS, /* 24, D3DTSS_TEXTURETRANSFORMFLAGS */
+ WINED3DTSS_FORCE_DWORD, /* 25, unused */
+ WINED3DTSS_COLORARG0, /* 26, D3DTSS_COLORARG0 */
+ WINED3DTSS_ALPHAARG0, /* 27, D3DTSS_ALPHAARG0 */
+ WINED3DTSS_RESULTARG, /* 28, D3DTSS_RESULTARG */
+ WINED3DTSS_FORCE_DWORD, /* 29, unused */
+ WINED3DTSS_FORCE_DWORD, /* 30, unused */
+ WINED3DTSS_FORCE_DWORD, /* 31, unused */
+ WINED3DTSS_CONSTANT, /* 32, D3DTSS_CONSTANT */
+};
+
static HRESULT WINAPI IDirect3DDevice9Impl_GetTextureStageState(LPDIRECT3DDEVICE9EX
iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hr;
TRACE("(%p) Relay\n" , This);
EnterCriticalSection(&d3d9_cs);
- hr = IWineD3DDevice_GetTextureStageState(This->WineD3DDevice, Stage, Type,
pValue);
+ hr = IWineD3DDevice_GetTextureStageState(This->WineD3DDevice, Stage,
tss_lookup[Type], pValue);
LeaveCriticalSection(&d3d9_cs);
return hr;
}
@@ -1025,7 +1069,7 @@
TRACE("(%p) Relay\n" , This);
EnterCriticalSection(&d3d9_cs);
- hr = IWineD3DDevice_SetTextureStageState(This->WineD3DDevice, Stage, Type,
Value);
+ hr = IWineD3DDevice_SetTextureStageState(This->WineD3DDevice, Stage,
tss_lookup[Type], Value);
LeaveCriticalSection(&d3d9_cs);
return hr;
}
@@ -1314,7 +1358,6 @@
return hr;
}
}
- hr = IWineD3DDevice_SetFVF(This->WineD3DDevice, FVF);
LeaveCriticalSection(&d3d9_cs);
return hr;
@@ -1322,12 +1365,30 @@
static HRESULT WINAPI IDirect3DDevice9Impl_GetFVF(LPDIRECT3DDEVICE9EX iface, DWORD* pFVF)
{
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
- HRESULT hr;
- TRACE("(%p) Relay\n" , This);
-
- EnterCriticalSection(&d3d9_cs);
- hr = IWineD3DDevice_GetFVF(This->WineD3DDevice, pFVF);
- LeaveCriticalSection(&d3d9_cs);
+ IDirect3DVertexDeclaration9 *decl;
+ HRESULT hr;
+ TRACE("(%p) Relay\n" , This);
+
+ hr = IDirect3DDevice9_GetVertexDeclaration(iface, &decl);
+ if (FAILED(hr))
+ {
+ WARN("Failed to get vertex declaration, %#x\n", hr);
+ *pFVF = 0;
+ return hr;
+ }
+
+ if (decl)
+ {
+ *pFVF = ((IDirect3DVertexDeclaration9Impl *)decl)->convFVF;
+ IDirect3DVertexDeclaration9_Release(decl);
+ }
+ else
+ {
+ *pFVF = 0;
+ }
+
+ TRACE("Returning FVF %#x\n", *pFVF);
+
return hr;
}
@@ -1694,37 +1755,6 @@
IDirect3DDevice9ExImpl_GetDisplayModeEx
};
-
-/* Internal function called back during the CreateDevice to create a render target */
-HRESULT WINAPI D3D9CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width,
UINT Height,
- WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL
Pool, UINT Level,
- WINED3DCUBEMAP_FACES Face,IWineD3DSurface**
ppSurface,
- HANDLE* pSharedHandle) {
-
- HRESULT res = D3D_OK;
- IDirect3DSurface9Impl *d3dSurface = NULL;
- BOOL Lockable = TRUE;
-
- if((Pool == D3DPOOL_DEFAULT && Usage != D3DUSAGE_DYNAMIC))
- Lockable = FALSE;
-
- TRACE("relay\n");
- res = IDirect3DDevice9Impl_CreateSurface((IDirect3DDevice9Ex *)device, Width, Height,
(D3DFORMAT)Format,
- Lockable, FALSE/*Discard*/, Level, (IDirect3DSurface9
**)&d3dSurface, D3DRTYPE_SURFACE,
- Usage, (D3DPOOL) Pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */,
pSharedHandle);
-
- if (SUCCEEDED(res)) {
- *ppSurface = d3dSurface->wineD3DSurface;
- d3dSurface->container = pSuperior;
- IDirect3DDevice9Ex_Release(d3dSurface->parentDevice);
- d3dSurface->parentDevice = NULL;
- d3dSurface->forwardReference = pSuperior;
- } else {
- FIXME("(%p) IDirect3DDevice9_CreateSurface failed\n", device);
- }
- return res;
-}
-
ULONG WINAPI D3D9CB_DestroySurface(IWineD3DSurface *pSurface) {
IDirect3DSurface9Impl* surfaceParent;
TRACE("(%p) call back\n", pSurface);
@@ -1735,3 +1765,236 @@
surfaceParent->forwardReference = NULL;
return IDirect3DSurface9_Release((IDirect3DSurface9*) surfaceParent);
}
+
+/* IWineD3DDeviceParent IUnknown methods */
+
+static inline struct IDirect3DDevice9Impl *device_from_device_parent(IWineD3DDeviceParent
*iface)
+{
+ return (struct IDirect3DDevice9Impl *)((char*)iface
+ - FIELD_OFFSET(struct IDirect3DDevice9Impl, device_parent_vtbl));
+}
+
+static HRESULT STDMETHODCALLTYPE device_parent_QueryInterface(IWineD3DDeviceParent
*iface, REFIID riid, void **object)
+{
+ struct IDirect3DDevice9Impl *This = device_from_device_parent(iface);
+ return IDirect3DDevice9Impl_QueryInterface((IDirect3DDevice9Ex *)This, riid,
object);
+}
+
+static ULONG STDMETHODCALLTYPE device_parent_AddRef(IWineD3DDeviceParent *iface)
+{
+ struct IDirect3DDevice9Impl *This = device_from_device_parent(iface);
+ return IDirect3DDevice9Impl_AddRef((IDirect3DDevice9Ex *)This);
+}
+
+static ULONG STDMETHODCALLTYPE device_parent_Release(IWineD3DDeviceParent *iface)
+{
+ struct IDirect3DDevice9Impl *This = device_from_device_parent(iface);
+ return IDirect3DDevice9Impl_Release((IDirect3DDevice9Ex *)This);
+}
+
+/* IWineD3DDeviceParent methods */
+
+static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParent
*iface,
+ IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, DWORD usage,
+ WINED3DPOOL pool, UINT level, WINED3DCUBEMAP_FACES face, IWineD3DSurface
**surface)
+{
+ struct IDirect3DDevice9Impl *This = device_from_device_parent(iface);
+ IDirect3DSurface9Impl *d3d_surface;
+ BOOL lockable = TRUE;
+ HRESULT hr;
+
+ TRACE("iface %p, superior %p, width %u, height %u, format %#x, usage
%#x,\n"
+ "\tpool %#x, level %u, face %u, surface %p\n",
+ iface, superior, width, height, format, usage, pool, level, face, surface);
+
+ if (pool == D3DPOOL_DEFAULT && !(usage & D3DUSAGE_DYNAMIC)) lockable =
FALSE;
+
+ hr = IDirect3DDevice9Impl_CreateSurface((IDirect3DDevice9Ex *)This, width, height,
+ format, lockable, FALSE /* Discard */, level, (IDirect3DSurface9
**)&d3d_surface,
+ D3DRTYPE_SURFACE, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality
*/, NULL);
+ if (FAILED(hr))
+ {
+ ERR("(%p) CreateSurface failed, returning %#x\n", iface, hr);
+ return hr;
+ }
+
+ *surface = d3d_surface->wineD3DSurface;
+ d3d_surface->container = superior;
+ IDirect3DDevice9Ex_Release(d3d_surface->parentDevice);
+ d3d_surface->parentDevice = NULL;
+ d3d_surface->forwardReference = superior;
+
+ return hr;
+}
+
+static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDeviceParent
*iface,
+ IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format,
WINED3DMULTISAMPLE_TYPE multisample_type,
+ DWORD multisample_quality, BOOL lockable, IWineD3DSurface **surface)
+{
+ struct IDirect3DDevice9Impl *This = device_from_device_parent(iface);
+ IDirect3DSurface9Impl *d3d_surface;
+ HRESULT hr;
+
+ TRACE("iface %p, superior %p, width %u, height %u, format %#x, multisample_type
%#x,\n"
+ "\tmultisample_quality %u, lockable %u, surface %p\n",
+ iface, superior, width, height, format, multisample_type,
multisample_quality, lockable, surface);
+
+ hr = IDirect3DDevice9Impl_CreateRenderTarget((IDirect3DDevice9Ex *)This, width,
height, format,
+ multisample_type, multisample_quality, lockable, (IDirect3DSurface9
**)&d3d_surface, NULL);
+ if (FAILED(hr))
+ {
+ ERR("(%p) CreateRenderTarget failed, returning %#x\n", iface, hr);
+ return hr;
+ }
+
+ *surface = d3d_surface->wineD3DSurface;
+ d3d_surface->container = superior;
+ d3d_surface->isImplicit = TRUE;
+ /* Implicit surfaces are created with an refcount of 0 */
+ IDirect3DSurface9_Release((IDirect3DSurface9 *)d3d_surface);
+
+ return hr;
+}
+
+static HRESULT STDMETHODCALLTYPE
device_parent_CreateDepthStencilSurface(IWineD3DDeviceParent *iface,
+ IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format,
WINED3DMULTISAMPLE_TYPE multisample_type,
+ DWORD multisample_quality, BOOL discard, IWineD3DSurface **surface)
+{
+ struct IDirect3DDevice9Impl *This = device_from_device_parent(iface);
+ IDirect3DSurface9Impl *d3d_surface;
+ HRESULT hr;
+
+ TRACE("iface %p, superior %p, width %u, height %u, format %#x, multisample_type
%#x,\n"
+ "\tmultisample_quality %u, discard %u, surface %p\n",
+ iface, superior, width, height, format, multisample_type,
multisample_quality, discard, surface);
+
+ hr = IDirect3DDevice9Impl_CreateDepthStencilSurface((IDirect3DDevice9Ex *)This,
width, height, format,
+ multisample_type, multisample_quality, discard, (IDirect3DSurface9
**)&d3d_surface, NULL);
+ if (FAILED(hr))
+ {
+ ERR("(%p) CreateDepthStencilSurface failed, returning %#x\n", iface,
hr);
+ return hr;
+ }
+
+ *surface = d3d_surface->wineD3DSurface;
+ d3d_surface->container = (IUnknown *)This;
+ d3d_surface->isImplicit = TRUE;
+ /* Implicit surfaces are created with an refcount of 0 */
+ IDirect3DSurface9_Release((IDirect3DSurface9 *)d3d_surface);
+
+ return hr;
+}
+
+static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent *iface,
+ IUnknown *superior, UINT width, UINT height, UINT depth, WINED3DFORMAT format,
+ WINED3DPOOL pool, DWORD usage, IWineD3DVolume **volume)
+{
+ struct IDirect3DDevice9Impl *This = device_from_device_parent(iface);
+ IDirect3DVolume9Impl *object;
+ HRESULT hr;
+
+ TRACE("iface %p, superior %p, width %u, height %u, depth %u, format %#x, pool
%#x, usage %#x, volume %p\n",
+ iface, superior, width, height, depth, format, pool, usage, volume);
+
+ /* Allocate the storage for the device */
+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
+ if (!object)
+ {
+ FIXME("Allocation of memory failed\n");
+ *volume = NULL;
+ return D3DERR_OUTOFVIDEOMEMORY;
+ }
+
+ object->lpVtbl = &Direct3DVolume9_Vtbl;
+ object->ref = 1;
+ hr = IWineD3DDevice_CreateVolume(This->WineD3DDevice, width, height, depth, usage
& WINED3DUSAGE_MASK,
+ format, pool, &object->wineD3DVolume, NULL, (IUnknown *)object);
+ if (FAILED(hr))
+ {
+ ERR("(%p) CreateVolume failed, returning %#x\n", iface, hr);
+ HeapFree(GetProcessHeap(), 0, object);
+ *volume = NULL;
+ return hr;
+ }
+
+ *volume = object->wineD3DVolume;
+ object->container = superior;
+ object->forwardReference = superior;
+
+ TRACE("(%p) Created volume %p\n", iface, *volume);
+
+ return hr;
+}
+
+static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDeviceParent
*iface,
+ WINED3DPRESENT_PARAMETERS *present_parameters, IWineD3DSwapChain **swapchain)
+{
+ struct IDirect3DDevice9Impl *This = device_from_device_parent(iface);
+ IDirect3DSwapChain9Impl *d3d_swapchain;
+ D3DPRESENT_PARAMETERS local_parameters;
+ HRESULT hr;
+
+ TRACE("iface %p, present_parameters %p, swapchain %p\n", iface,
present_parameters, swapchain);
+
+ /* Copy the presentation parameters */
+ local_parameters.BackBufferWidth = present_parameters->BackBufferWidth;
+ local_parameters.BackBufferHeight = present_parameters->BackBufferHeight;
+ local_parameters.BackBufferFormat = present_parameters->BackBufferFormat;
+ local_parameters.BackBufferCount = present_parameters->BackBufferCount;
+ local_parameters.MultiSampleType = present_parameters->MultiSampleType;
+ local_parameters.MultiSampleQuality = present_parameters->MultiSampleQuality;
+ local_parameters.SwapEffect = present_parameters->SwapEffect;
+ local_parameters.hDeviceWindow = present_parameters->hDeviceWindow;
+ local_parameters.Windowed = present_parameters->Windowed;
+ local_parameters.EnableAutoDepthStencil =
present_parameters->EnableAutoDepthStencil;
+ local_parameters.AutoDepthStencilFormat =
present_parameters->AutoDepthStencilFormat;
+ local_parameters.Flags = present_parameters->Flags;
+ local_parameters.FullScreen_RefreshRateInHz =
present_parameters->FullScreen_RefreshRateInHz;
+ local_parameters.PresentationInterval = present_parameters->PresentationInterval;
+
+ hr = IDirect3DDevice9Impl_CreateAdditionalSwapChain((IDirect3DDevice9Ex *)This,
+ &local_parameters, (IDirect3DSwapChain9 **)&d3d_swapchain);
+ if (FAILED(hr))
+ {
+ ERR("(%p) CreateAdditionalSwapChain failed, returning %#x\n", iface,
hr);
+ *swapchain = NULL;
+ return hr;
+ }
+
+ *swapchain = d3d_swapchain->wineD3DSwapChain;
+ d3d_swapchain->isImplicit = TRUE;
+ /* Implicit swap chains are created with an refcount of 0 */
+ IDirect3DSwapChain9_Release((IDirect3DSwapChain9 *)d3d_swapchain);
+
+ /* Copy back the presentation parameters */
+ present_parameters->BackBufferWidth = local_parameters.BackBufferWidth;
+ present_parameters->BackBufferHeight = local_parameters.BackBufferHeight;
+ present_parameters->BackBufferFormat = local_parameters.BackBufferFormat;
+ present_parameters->BackBufferCount = local_parameters.BackBufferCount;
+ present_parameters->MultiSampleType = local_parameters.MultiSampleType;
+ present_parameters->MultiSampleQuality = local_parameters.MultiSampleQuality;
+ present_parameters->SwapEffect = local_parameters.SwapEffect;
+ present_parameters->hDeviceWindow = local_parameters.hDeviceWindow;
+ present_parameters->Windowed = local_parameters.Windowed;
+ present_parameters->EnableAutoDepthStencil =
local_parameters.EnableAutoDepthStencil;
+ present_parameters->AutoDepthStencilFormat =
local_parameters.AutoDepthStencilFormat;
+ present_parameters->Flags = local_parameters.Flags;
+ present_parameters->FullScreen_RefreshRateInHz =
local_parameters.FullScreen_RefreshRateInHz;
+ present_parameters->PresentationInterval = local_parameters.PresentationInterval;
+
+ return hr;
+}
+
+const IWineD3DDeviceParentVtbl d3d9_wined3d_device_parent_vtbl =
+{
+ /* IUnknown methods */
+ device_parent_QueryInterface,
+ device_parent_AddRef,
+ device_parent_Release,
+ /* IWineD3DDeviceParent methods */
+ device_parent_CreateSurface,
+ device_parent_CreateRenderTarget,
+ device_parent_CreateDepthStencilSurface,
+ device_parent_CreateVolume,
+ device_parent_CreateSwapChain,
+};
Modified: trunk/reactos/dll/directx/wine/d3d9/directx.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/dire…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d9/directx.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d9/directx.c [iso-8859-1] Sun Jan 18 15:11:53 2009
@@ -329,30 +329,6 @@
return ret;
}
-/* Internal function called back during the CreateDevice to create a render target */
-HRESULT WINAPI D3D9CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior, UINT
Width, UINT Height,
- WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE
MultiSample,
- DWORD MultisampleQuality, BOOL Lockable,
- IWineD3DSurface** ppSurface, HANDLE*
pSharedHandle) {
- HRESULT res = D3D_OK;
- IDirect3DSurface9Impl *d3dSurface = NULL;
- TRACE("(%p) call back\n", device);
- res = IDirect3DDevice9_CreateRenderTarget((IDirect3DDevice9 *)device, Width, Height,
- (D3DFORMAT)Format, MultiSample,
MultisampleQuality, Lockable,
- (IDirect3DSurface9 **)&d3dSurface,
pSharedHandle);
-
- if (SUCCEEDED(res)) {
- *ppSurface = d3dSurface->wineD3DSurface;
- d3dSurface->container = pSuperior;
- d3dSurface->isImplicit = TRUE;
- /* Implicit surfaces are created with an refcount of 0 */
- IDirect3DSurface9_Release((IDirect3DSurface9 *)d3dSurface);
- } else {
- *ppSurface = NULL;
- }
- return res;
-}
-
ULONG WINAPI D3D9CB_DestroyRenderTarget(IWineD3DSurface *pSurface) {
IDirect3DSurface9Impl* surfaceParent;
TRACE("(%p) call back\n", pSurface);
@@ -363,60 +339,6 @@
return IDirect3DSurface9_Release((IDirect3DSurface9*) surfaceParent);
}
-static HRESULT WINAPI D3D9CB_CreateAdditionalSwapChain(IUnknown *device,
- WINED3DPRESENT_PARAMETERS*
pPresentationParameters,
- IWineD3DSwapChain ** ppSwapChain)
{
- HRESULT res = D3D_OK;
- IDirect3DSwapChain9Impl *d3dSwapChain = NULL;
- D3DPRESENT_PARAMETERS localParameters;
- TRACE("(%p) call back\n", device);
-
- /* Copy the presentation parameters */
- localParameters.BackBufferWidth =
pPresentationParameters->BackBufferWidth;
- localParameters.BackBufferHeight =
pPresentationParameters->BackBufferHeight;
- localParameters.BackBufferFormat =
pPresentationParameters->BackBufferFormat;
- localParameters.BackBufferCount =
pPresentationParameters->BackBufferCount;
- localParameters.MultiSampleType =
pPresentationParameters->MultiSampleType;
- localParameters.MultiSampleQuality =
pPresentationParameters->MultiSampleQuality;
- localParameters.SwapEffect =
pPresentationParameters->SwapEffect;
- localParameters.hDeviceWindow =
pPresentationParameters->hDeviceWindow;
- localParameters.Windowed =
pPresentationParameters->Windowed;
- localParameters.EnableAutoDepthStencil =
pPresentationParameters->EnableAutoDepthStencil;
- localParameters.AutoDepthStencilFormat =
pPresentationParameters->AutoDepthStencilFormat;
- localParameters.Flags =
pPresentationParameters->Flags;
- localParameters.FullScreen_RefreshRateInHz =
pPresentationParameters->FullScreen_RefreshRateInHz;
- localParameters.PresentationInterval =
pPresentationParameters->PresentationInterval;
-
- res = IDirect3DDevice9_CreateAdditionalSwapChain((IDirect3DDevice9 *)device,
&localParameters, (IDirect3DSwapChain9 **)&d3dSwapChain);
-
- if (SUCCEEDED(res)) {
- *ppSwapChain = d3dSwapChain->wineD3DSwapChain;
- d3dSwapChain->isImplicit = TRUE;
- /* Implicit swap chains are created with an refcount of 0 */
- IDirect3DSwapChain9_Release((IDirect3DSwapChain9 *)d3dSwapChain);
- } else {
- *ppSwapChain = NULL;
- }
-
- /* Copy back the presentation parameters */
- pPresentationParameters->BackBufferWidth =
localParameters.BackBufferWidth;
- pPresentationParameters->BackBufferHeight =
localParameters.BackBufferHeight;
- pPresentationParameters->BackBufferFormat =
localParameters.BackBufferFormat;
- pPresentationParameters->BackBufferCount =
localParameters.BackBufferCount;
- pPresentationParameters->MultiSampleType =
localParameters.MultiSampleType;
- pPresentationParameters->MultiSampleQuality =
localParameters.MultiSampleQuality;
- pPresentationParameters->SwapEffect = localParameters.SwapEffect;
- pPresentationParameters->hDeviceWindow =
localParameters.hDeviceWindow;
- pPresentationParameters->Windowed = localParameters.Windowed;
- pPresentationParameters->EnableAutoDepthStencil =
localParameters.EnableAutoDepthStencil;
- pPresentationParameters->AutoDepthStencilFormat =
localParameters.AutoDepthStencilFormat;
- pPresentationParameters->Flags = localParameters.Flags;
- pPresentationParameters->FullScreen_RefreshRateInHz =
localParameters.FullScreen_RefreshRateInHz;
- pPresentationParameters->PresentationInterval =
localParameters.PresentationInterval;
-
- return res;
-}
-
ULONG WINAPI D3D9CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain) {
IDirect3DSwapChain9Impl* swapChainParent;
TRACE("(%p) call back\n", pSwapChain);
@@ -425,28 +347,6 @@
swapChainParent->isImplicit = FALSE;
/* Swap chain had refcount of 0 GetParent addrefed to 1, so 1 Release is enough */
return IDirect3DSwapChain9_Release((IDirect3DSwapChain9*) swapChainParent);
-}
-
-/* Internal function called back during the CreateDevice to create a render target */
-HRESULT WINAPI D3D9CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSuperior,
UINT Width, UINT Height,
- WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE
MultiSample,
- DWORD MultisampleQuality, BOOL Discard,
- IWineD3DSurface** ppSurface, HANDLE*
pSharedHandle) {
- HRESULT res = D3D_OK;
- IDirect3DSurface9Impl *d3dSurface = NULL;
- TRACE("(%p) call back\n", device);
-
- res = IDirect3DDevice9_CreateDepthStencilSurface((IDirect3DDevice9 *)device, Width,
Height,
- (D3DFORMAT)Format, MultiSample,
MultisampleQuality, Discard,
- (IDirect3DSurface9 **)&d3dSurface,
pSharedHandle);
- if (SUCCEEDED(res)) {
- *ppSurface = d3dSurface->wineD3DSurface;
- d3dSurface->container = device;
- d3dSurface->isImplicit = TRUE;
- /* Implicit surfaces are created with an refcount of 0 */
- IDirect3DSurface9_Release((IDirect3DSurface9 *)d3dSurface);
- }
- return res;
}
ULONG WINAPI D3D9CB_DestroyDepthStencilSurface(IWineD3DSurface *pSurface) {
@@ -485,13 +385,14 @@
}
object->lpVtbl = &Direct3DDevice9_Vtbl;
+ object->device_parent_vtbl = &d3d9_wined3d_device_parent_vtbl;
object->ref = 1;
*ppReturnedDeviceInterface = (IDirect3DDevice9 *)object;
/* Allocate an associated WineD3DDevice object */
EnterCriticalSection(&d3d9_cs);
- hr =IWineD3D_CreateDevice(This->WineD3D, Adapter, DeviceType, hFocusWindow,
BehaviourFlags, &object->WineD3DDevice, (IUnknown *)object);
-
+ hr = IWineD3D_CreateDevice(This->WineD3D, Adapter, DeviceType, hFocusWindow,
BehaviourFlags,
+ (IUnknown *)object, (IWineD3DDeviceParent
*)&object->device_parent_vtbl, &object->WineD3DDevice);
if (hr != D3D_OK) {
HeapFree(GetProcessHeap(), 0, object);
*ppReturnedDeviceInterface = NULL;
@@ -521,7 +422,7 @@
IWineD3DDevice_SetMultithreaded(object->WineD3DDevice);
}
- hr = IWineD3DDevice_Init3D(object->WineD3DDevice, &localParameters,
D3D9CB_CreateAdditionalSwapChain);
+ hr = IWineD3DDevice_Init3D(object->WineD3DDevice, &localParameters);
pPresentationParameters->BackBufferWidth =
localParameters.BackBufferWidth;
pPresentationParameters->BackBufferHeight =
localParameters.BackBufferHeight;
Modified: trunk/reactos/dll/directx/wine/d3d9/pixelshader.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/pixe…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d9/pixelshader.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d9/pixelshader.c [iso-8859-1] Sun Jan 18 15:11:53
2009
@@ -170,11 +170,21 @@
EnterCriticalSection(&d3d9_cs);
hrc = IWineD3DDevice_GetPixelShader(This->WineD3DDevice, &object);
- if (hrc == D3D_OK && object != NULL) {
- hrc = IWineD3DPixelShader_GetParent(object, (IUnknown **)ppShader);
- IWineD3DPixelShader_Release(object);
- } else {
- *ppShader = NULL;
+ if (SUCCEEDED(hrc))
+ {
+ if (object)
+ {
+ hrc = IWineD3DPixelShader_GetParent(object, (IUnknown **)ppShader);
+ IWineD3DPixelShader_Release(object);
+ }
+ else
+ {
+ *ppShader = NULL;
+ }
+ }
+ else
+ {
+ WARN("(%p) : Call to IWineD3DDevice_GetPixelShader failed %u (device
%p)\n", This, hrc, This->WineD3DDevice);
}
LeaveCriticalSection(&d3d9_cs);
Modified: trunk/reactos/dll/directx/wine/d3d9/query.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/quer…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d9/query.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d9/query.c [iso-8859-1] Sun Jan 18 15:11:53 2009
@@ -163,7 +163,7 @@
/* Allocate the storage for the device */
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DQuery9Impl));
if (NULL == object) {
- FIXME("Allocation of memory failed, returning
D3DERR_OUTOFVIDEOMEMORY\n");
+ ERR("Allocation of memory failed, returning
D3DERR_OUTOFVIDEOMEMORY\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
@@ -176,7 +176,7 @@
if (FAILED(hr)) {
/* free up object */
- FIXME("(%p) call to IWineD3DDevice_CreateQuery failed\n", This);
+ WARN("(%p) call to IWineD3DDevice_CreateQuery failed\n", This);
HeapFree(GetProcessHeap(), 0, object);
} else {
IDirect3DDevice9Ex_AddRef(iface);
Modified: trunk/reactos/dll/directx/wine/d3d9/stateblock.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/stat…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d9/stateblock.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d9/stateblock.c [iso-8859-1] Sun Jan 18 15:11:53
2009
@@ -175,7 +175,7 @@
hr=IWineD3DDevice_EndStateBlock(This->WineD3DDevice,&wineD3DStateBlock);
LeaveCriticalSection(&d3d9_cs);
if(hr!= D3D_OK){
- FIXME("IWineD3DDevice_EndStateBlock returned an error\n");
+ WARN("IWineD3DDevice_EndStateBlock returned an error\n");
return hr;
}
/* allocate a new IDirectD3DStateBlock */
@@ -188,6 +188,6 @@
IDirect3DDevice9Ex_AddRef(iface);
object->parentDevice = iface;
*ppSB=(IDirect3DStateBlock9*)object;
- TRACE("(%p)Returning %p %p\n", This, *ppSB, wineD3DStateBlock);
+ TRACE("(%p) Returning *ppSB %p, wineD3DStateBlock %p\n", This, *ppSB,
wineD3DStateBlock);
return D3D_OK;
}
Modified: trunk/reactos/dll/directx/wine/d3d9/surface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/surf…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d9/surface.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d9/surface.c [iso-8859-1] Sun Jan 18 15:11:53 2009
@@ -241,7 +241,11 @@
EnterCriticalSection(&d3d9_cs);
hr = IWineD3DSurface_UnlockRect(This->wineD3DSurface);
LeaveCriticalSection(&d3d9_cs);
- return hr;
+ switch(hr)
+ {
+ case WINEDDERR_NOTLOCKED: return D3DERR_INVALIDCALL;
+ default: return hr;
+ }
}
static HRESULT WINAPI IDirect3DSurface9Impl_GetDC(LPDIRECT3DSURFACE9 iface, HDC* phdc) {
@@ -263,7 +267,10 @@
EnterCriticalSection(&d3d9_cs);
hr = IWineD3DSurface_ReleaseDC(This->wineD3DSurface, hdc);
LeaveCriticalSection(&d3d9_cs);
- return hr;
+ switch(hr) {
+ case WINEDDERR_NODC: return WINED3DERR_INVALIDCALL;
+ default: return hr;
+ }
}
Modified: trunk/reactos/dll/directx/wine/d3d9/swapchain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/swap…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d9/swapchain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d9/swapchain.c [iso-8859-1] Sun Jan 18 15:11:53 2009
@@ -227,9 +227,11 @@
localParameters.Flags =
pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz =
pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval =
pPresentationParameters->PresentationInterval;
-
- EnterCriticalSection(&d3d9_cs);
- hrc = IWineD3DDevice_CreateSwapChain(This->WineD3DDevice, &localParameters,
&object->wineD3DSwapChain, (IUnknown*)object, D3D9CB_CreateRenderTarget,
D3D9CB_CreateDepthStencilSurface, SURFACE_OPENGL);
+ localParameters.AutoRestoreDisplayMode = TRUE;
+
+ EnterCriticalSection(&d3d9_cs);
+ hrc = IWineD3DDevice_CreateSwapChain(This->WineD3DDevice, &localParameters,
+ &object->wineD3DSwapChain, (IUnknown*)object, SURFACE_OPENGL);
LeaveCriticalSection(&d3d9_cs);
pPresentationParameters->BackBufferWidth =
localParameters.BackBufferWidth;
Modified: trunk/reactos/dll/directx/wine/d3d9/texture.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/text…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d9/texture.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d9/texture.c [iso-8859-1] Sun Jan 18 15:11:53 2009
@@ -339,7 +339,7 @@
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(IDirect3DTexture9Impl));
if (NULL == object) {
- FIXME("Allocation of memory failed, returning
D3DERR_OUTOFVIDEOMEMORY\n");
+ ERR("Allocation of memory failed, returning
D3DERR_OUTOFVIDEOMEMORY\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
@@ -347,13 +347,12 @@
object->ref = 1;
EnterCriticalSection(&d3d9_cs);
hrc = IWineD3DDevice_CreateTexture(This->WineD3DDevice, Width, Height, Levels,
Usage & WINED3DUSAGE_MASK,
- (WINED3DFORMAT)Format, (WINED3DPOOL) Pool,
&object->wineD3DTexture, pSharedHandle, (IUnknown *)object, D3D9CB_CreateSurface);
- LeaveCriticalSection(&d3d9_cs);
-
+ Format, Pool, &object->wineD3DTexture, pSharedHandle, (IUnknown
*)object);
+ LeaveCriticalSection(&d3d9_cs);
if (FAILED(hrc)) {
/* free up object */
- FIXME("(%p) call to IWineD3DDevice_CreateTexture failed\n", This);
+ WARN("(%p) call to IWineD3DDevice_CreateTexture failed\n", This);
HeapFree(GetProcessHeap(), 0, object);
} else {
IDirect3DDevice9Ex_AddRef(iface);
Modified: trunk/reactos/dll/directx/wine/d3d9/vertexdeclaration.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/vert…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d9/vertexdeclaration.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d9/vertexdeclaration.c [iso-8859-1] Sun Jan 18
15:11:53 2009
@@ -96,6 +96,10 @@
elements[idx].Type = D3DDECLTYPE_FLOAT4;
elements[idx].Usage = D3DDECLUSAGE_POSITIONT;
}
+ else if (!has_blend && (fvf & D3DFVF_XYZW) == D3DFVF_XYZW) {
+ elements[idx].Type = D3DDECLTYPE_FLOAT4;
+ elements[idx].Usage = D3DDECLUSAGE_POSITION;
+ }
else {
elements[idx].Type = D3DDECLTYPE_FLOAT3;
elements[idx].Usage = D3DDECLUSAGE_POSITION;
Modified: trunk/reactos/dll/directx/wine/d3d9/vertexshader.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/vert…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d9/vertexshader.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d9/vertexshader.c [iso-8859-1] Sun Jan 18 15:11:53
2009
@@ -166,10 +166,20 @@
TRACE("(%p) : Relay device@%p\n", This, This->WineD3DDevice);
EnterCriticalSection(&d3d9_cs);
hrc = IWineD3DDevice_GetVertexShader(This->WineD3DDevice, &pShader);
- if(hrc == D3D_OK && pShader != NULL){
- hrc = IWineD3DVertexShader_GetParent(pShader, (IUnknown **)ppShader);
- IWineD3DVertexShader_Release(pShader);
- } else {
+ if (SUCCEEDED(hrc))
+ {
+ if (pShader)
+ {
+ hrc = IWineD3DVertexShader_GetParent(pShader, (IUnknown **)ppShader);
+ IWineD3DVertexShader_Release(pShader);
+ }
+ else
+ {
+ *ppShader = NULL;
+ }
+ }
+ else
+ {
WARN("(%p) : Call to IWineD3DDevice_GetVertexShader failed %u (device
%p)\n", This, hrc, This->WineD3DDevice);
}
LeaveCriticalSection(&d3d9_cs);
Modified: trunk/reactos/dll/directx/wine/d3d9/volume.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/volu…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d9/volume.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d9/volume.c [iso-8859-1] Sun Jan 18 15:11:53 2009
@@ -160,7 +160,7 @@
return IWineD3DVolume_UnlockBox(This->wineD3DVolume);
}
-static const IDirect3DVolume9Vtbl Direct3DVolume9_Vtbl =
+const IDirect3DVolume9Vtbl Direct3DVolume9_Vtbl =
{
/* IUnknown */
IDirect3DVolume9Impl_QueryInterface,
@@ -177,42 +177,6 @@
IDirect3DVolume9Impl_UnlockBox
};
-
-/* Internal function called back during the CreateVolumeTexture */
-HRESULT WINAPI D3D9CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT Width,
UINT Height, UINT Depth,
- WINED3DFORMAT Format, WINED3DPOOL Pool, DWORD Usage,
- IWineD3DVolume **ppVolume,
- HANDLE * pSharedHandle) {
- IDirect3DVolume9Impl *object;
- IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)pDevice;
- HRESULT hrc = D3D_OK;
-
- /* Allocate the storage for the device */
- object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(IDirect3DVolume9Impl));
- if (NULL == object) {
- FIXME("Allocation of memory failed\n");
- *ppVolume = NULL;
- return D3DERR_OUTOFVIDEOMEMORY;
- }
-
- object->lpVtbl = &Direct3DVolume9_Vtbl;
- object->ref = 1;
- hrc = IWineD3DDevice_CreateVolume(This->WineD3DDevice, Width, Height, Depth, Usage
& WINED3DUSAGE_MASK, Format,
- Pool, &object->wineD3DVolume,
pSharedHandle, (IUnknown *)object);
- if (hrc != D3D_OK) {
- /* free up object */
- FIXME("(%p) call to IWineD3DDevice_CreateVolume failed\n", This);
- HeapFree(GetProcessHeap(), 0, object);
- *ppVolume = NULL;
- } else {
- *ppVolume = object->wineD3DVolume;
- object->container = pSuperior;
- object->forwardReference = pSuperior;
- }
- TRACE("(%p) Created volume %p\n", This, *ppVolume);
- return hrc;
-}
-
ULONG WINAPI D3D9CB_DestroyVolume(IWineD3DVolume *pVolume) {
IDirect3DVolume9Impl* volumeParent;
Modified: trunk/reactos/dll/directx/wine/d3d9/volumetexture.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/volu…
==============================================================================
--- trunk/reactos/dll/directx/wine/d3d9/volumetexture.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/d3d9/volumetexture.c [iso-8859-1] Sun Jan 18 15:11:53
2009
@@ -252,21 +252,18 @@
/* Allocate the storage for the device */
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(IDirect3DVolumeTexture9Impl));
if (NULL == object) {
- FIXME("(%p) allocation of memory failed, returning
D3DERR_OUTOFVIDEOMEMORY\n", This);
+ ERR("(%p) allocation of memory failed, returning
D3DERR_OUTOFVIDEOMEMORY\n", This);
return D3DERR_OUTOFVIDEOMEMORY;
}
object->lpVtbl = &Direct3DVolumeTexture9_Vtbl;
object->ref = 1;
- hrc = IWineD3DDevice_CreateVolumeTexture(This->WineD3DDevice, Width, Height,
Depth, Levels, Usage & WINED3DUSAGE_MASK,
- (WINED3DFORMAT)Format, (WINED3DPOOL) Pool,
&object->wineD3DVolumeTexture, pSharedHandle,
- (IUnknown *)object, D3D9CB_CreateVolume);
-
-
+ hrc = IWineD3DDevice_CreateVolumeTexture(This->WineD3DDevice, Width, Height,
Depth, Levels,
+ Usage & WINED3DUSAGE_MASK, Format, Pool,
&object->wineD3DVolumeTexture, pSharedHandle, (IUnknown *)object);
if (hrc != D3D_OK) {
/* free up object */
- FIXME("(%p) call to IWineD3DDevice_CreateVolumeTexture failed\n",
This);
+ WARN("(%p) call to IWineD3DDevice_CreateVolumeTexture failed\n",
This);
HeapFree(GetProcessHeap(), 0, object);
} else {
IDirect3DDevice9Ex_AddRef(iface);