D3D9: Implement IDirect3DDevice9::StretchRect
Stefan Dösinger
stefan at codeweavers.com
Wed Jan 10 19:10:07 CST 2007
This call can be handled fully by IWineD3DSurface::Blt. To remove double
functionality from wined3d d3d9.dll does the Blt call, and sets the cap for
the caps structure.
This fixes the old G man intro in Half-Life 2 :-)
-------------- next part --------------
From e642f341787a5010b65b3667cf840ba6433787bf Mon Sep 17 00:00:00 2001
From: Stefan Doesinger <stefan at codeweavers.com>
Date: Thu, 11 Jan 2007 01:28:40 +0100
Subject: [PATCH] D3D9: Implement IDirect3DDevice9::StretchRect
---
dlls/d3d9/device.c | 9 ++++++---
dlls/d3d9/directx.c | 3 +++
dlls/wined3d/device.c | 9 ---------
include/wine/wined3d_interface.h | 2 --
4 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index aa788af..38511a0 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -356,9 +356,12 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetFrontBufferData(LPDIRECT3DDEVICE
}
static HRESULT WINAPI IDirect3DDevice9Impl_StretchRect(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) {
- IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
- TRACE("(%p) Relay\n" , This);
- return IWineD3DDevice_StretchRect(This->WineD3DDevice, ((IDirect3DSurface9Impl *)pSourceSurface)->wineD3DSurface, pSourceRect, ((IDirect3DSurface9Impl *)pDestSurface)->wineD3DSurface, pDestRect, (WINED3DTEXTUREFILTERTYPE) Filter);
+ IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
+ IDirect3DSurface9Impl *src = (IDirect3DSurface9Impl *) pSourceSurface;
+ IDirect3DSurface9Impl *dst = (IDirect3DSurface9Impl *) pDestSurface;
+
+ TRACE("(%p)->(%p,%p,%p,%p,%d) Relay\n" , This, src, pSourceRect, dst, pDestRect, Filter);
+ return IWineD3DSurface_Blt(dst->wineD3DSurface, (RECT *) pDestRect, src->wineD3DSurface, (RECT *) pSourceRect, 0, NULL);
}
static HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color) {
diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c
index f360b4e..57062b2 100644
--- a/dlls/d3d9/directx.c
+++ b/dlls/d3d9/directx.c
@@ -170,6 +170,9 @@ static HRESULT WINAPI IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9 iface, UINT Adapt
D3D9CAPSTOWINECAPS(pCaps, pWineCaps)
hrc = IWineD3D_GetDeviceCaps(This->WineD3D, Adapter, DeviceType, pWineCaps);
HeapFree(GetProcessHeap(), 0, pWineCaps);
+
+ /* Some functionality is implemented in d3d9.dll, not wined3d.dll. Add the needed caps */
+ pCaps->Caps2 |= D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES;
TRACE("(%p) returning %p\n", This, pCaps);
return hrc;
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 4f5c290..707437a 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4930,14 +4930,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture (IWineD3DDevice *iface, I
return hr;
}
-static HRESULT WINAPI IWineD3DDeviceImpl_StretchRect(IWineD3DDevice *iface, IWineD3DSurface *pSourceSurface,
- CONST RECT* pSourceRect, IWineD3DSurface *pDestinationSurface,
- CONST RECT* pDestRect, WINED3DTEXTUREFILTERTYPE Filter) {
- IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
-
- TRACE("(%p) : stub\n", This);
- return WINED3D_OK;
-}
static HRESULT WINAPI IWineD3DDeviceImpl_GetRenderTargetData(IWineD3DDevice *iface, IWineD3DSurface *pRenderTarget, IWineD3DSurface *pSurface) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
/** TODO: remove remove casts to IWineD3DSurfaceImpl *
@@ -6776,7 +6768,6 @@ const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl =
IWineD3DDeviceImpl_ColorFill,
IWineD3DDeviceImpl_UpdateTexture,
IWineD3DDeviceImpl_UpdateSurface,
- IWineD3DDeviceImpl_StretchRect,
IWineD3DDeviceImpl_GetRenderTargetData,
IWineD3DDeviceImpl_GetFrontBufferData,
/*** object tracking ***/
diff --git a/include/wine/wined3d_interface.h b/include/wine/wined3d_interface.h
index 8a685f0..4a24636 100644
--- a/include/wine/wined3d_interface.h
+++ b/include/wine/wined3d_interface.h
@@ -469,7 +469,6 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
STDMETHOD(ColorFill)(THIS_ struct IWineD3DSurface* pSurface, CONST WINED3DRECT* pRect, WINED3DCOLOR color) PURE;
STDMETHOD(UpdateTexture)(THIS_ struct IWineD3DBaseTexture *pSourceTexture, struct IWineD3DBaseTexture *pDestinationTexture) PURE;
STDMETHOD(UpdateSurface)(THIS_ struct IWineD3DSurface* pSourceSurface, CONST RECT* pSourceRect, struct IWineD3DSurface* pDestinationSurface, CONST POINT* pDestPoint) PURE;
- STDMETHOD(StretchRect)(THIS_ struct IWineD3DSurface* pSourceSurface, CONST RECT* pSourceRect, struct IWineD3DSurface* pDestinationSurface, CONST RECT* pDestRect, WINED3DTEXTUREFILTERTYPE Filter) PURE;
STDMETHOD(GetRenderTargetData)(THIS_ struct IWineD3DSurface* pRenderTarget, struct IWineD3DSurface* pSurface) PURE;
STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,struct IWineD3DSurface* pSurface) PURE;
/*** object tracking ***/
@@ -608,7 +607,6 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
#define IWineD3DDevice_ColorFill(p,a,b,c) (p)->lpVtbl->ColorFill(p,a,b,c)
#define IWineD3DDevice_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b)
#define IWineD3DDevice_UpdateSurface(p,a,b,c,d) (p)->lpVtbl->UpdateSurface(p,a,b,c,d)
-#define IWineD3DDevice_StretchRect(p,a,b,c,d,e) (p)->lpVtbl->StretchRect(p,a,b,c,d,e)
#define IWineD3DDevice_GetRenderTargetData(p,a,b) (p)->lpVtbl->GetRenderTargetData(p,a,b)
#define IWineD3DDevice_GetFrontBufferData(p,a,b) (p)->lpVtbl->GetFrontBufferData(p,a,b)
#define IWineD3DDevice_ResourceReleased(p,a) (p)->lpVtbl->ResourceReleased(p,a)
--
1.4.4.3
More information about the wine-patches
mailing list