From 94b3fddec8c701dea670b623ee1c02d5ed4aeae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 24 Apr 2007 10:29:22 +0200 Subject: [PATCH] d3d: Pass the cube face to Create*Texture's surface creation callback. --- dlls/d3d8/d3d8_private.h | 3 ++- dlls/d3d8/device.c | 3 ++- dlls/d3d9/d3d9_private.h | 3 ++- dlls/d3d9/device.c | 3 ++- dlls/ddraw/ddraw.c | 2 ++ dlls/wined3d/device.c | 4 ++-- include/wine/wined3d_interface.h | 1 + 7 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h index a86867c49e..f41b7edbac 100644 --- a/dlls/d3d8/d3d8_private.h +++ b/dlls/d3d8/d3d8_private.h @@ -626,7 +626,8 @@ size_t convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3d8_el /* Callbacks */ extern HRESULT WINAPI D3D8CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height, WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level, - IWineD3DSurface** ppSurface, HANDLE* pSharedHandle); + WINED3DCUBEMAP_FACES Face, IWineD3DSurface** ppSurface, + HANDLE* pSharedHandle); extern HRESULT WINAPI D3D8CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT Width, UINT Height, UINT Depth, WINED3DFORMAT Format, WINED3DPOOL Pool, DWORD Usage, diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 71de0173a8..da3280d709 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1769,7 +1769,8 @@ const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl = /* Internal function called back during the CreateDevice to create a render target */ HRESULT WINAPI D3D8CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height, WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level, - IWineD3DSurface **ppSurface, HANDLE *pSharedHandle) { + WINED3DCUBEMAP_FACES Face, IWineD3DSurface **ppSurface, + HANDLE *pSharedHandle) { HRESULT res = D3D_OK; IDirect3DSurface8Impl *d3dSurface = NULL; diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index 33c780bac4..af308ac770 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -552,7 +552,8 @@ typedef struct IDirect3DQuery9Impl { /* Callbacks */ extern HRESULT WINAPI D3D9CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height, WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level, - IWineD3DSurface** ppSurface, HANDLE* pSharedHandle); + 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, diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index af4f3adc92..c42f4560b0 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1085,7 +1085,8 @@ const IDirect3DDevice9Vtbl Direct3DDevice9_Vtbl = /* 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, - IWineD3DSurface** ppSurface, HANDLE* pSharedHandle) { + WINED3DCUBEMAP_FACES Face,IWineD3DSurface** ppSurface, + HANDLE* pSharedHandle) { HRESULT res = D3D_OK; IDirect3DSurface9Impl *d3dSurface = NULL; diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 9f641e130c..a7b06399f3 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -1578,6 +1578,7 @@ IDirectDrawImpl_RecreateAllSurfaces(IDirectDrawImpl *This) * Format: The requested format * Usage, Pool: D3DUSAGE and D3DPOOL of the surface * level: The mipmap level + * Face: The cube map face type * Surface: Pointer to pass the created surface back at * SharedHandle: NULL * @@ -1591,6 +1592,7 @@ D3D7CB_CreateSurface(IUnknown *device, UINT Width, UINT Height, WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT level, + WINED3DCUBEMAP_FACES Face, IWineD3DSurface **Surface, HANDLE *SharedHandle) { diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index f4f3002d83..5c2d700f75 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -851,7 +851,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U for (i = 0; i < object->baseTexture.levels; i++) { /* use the callback to create the texture surface */ - hr = D3DCB_CreateSurface(This->parent, parent, tmpW, tmpH, Format, Usage, Pool, i, &object->surfaces[i],NULL); + hr = D3DCB_CreateSurface(This->parent, parent, tmpW, tmpH, Format, Usage, Pool, i, WINED3DCUBEMAP_FACE_POSITIVE_X, &object->surfaces[i],NULL); if (hr!= WINED3D_OK || ( (IWineD3DSurfaceImpl *) object->surfaces[i])->Flags & SFLAG_OVERSIZE) { FIXME("Failed to create surface %p\n", object); /* clean up */ @@ -1046,7 +1046,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface for (j = 0; j < 6; j++) { hr=D3DCB_CreateSurface(This->parent, parent, tmpW, tmpW, Format, Usage, Pool, - i /* Level */, &object->surfaces[j][i],pSharedHandle); + i /* Level */, j, &object->surfaces[j][i],pSharedHandle); if(hr!= WINED3D_OK) { /* clean up */ diff --git a/include/wine/wined3d_interface.h b/include/wine/wined3d_interface.h index d9f33d05d2..82ddc23459 100644 --- a/include/wine/wined3d_interface.h +++ b/include/wine/wined3d_interface.h @@ -209,6 +209,7 @@ typedef HRESULT WINAPI (*D3DCB_CREATESURFACEFN) (IUnknown *pDevice, DWORD Usage, WINED3DPOOL Pool, UINT Level, + WINED3DCUBEMAP_FACES Face, struct IWineD3DSurface **ppSurface, HANDLE *pSharedHandle);