Module: wine Branch: master Commit: 9628a1b2e29b9918ae8bd72be6ea4414331ecc60 URL: http://source.winehq.org/git/wine.git/?a=commit;h=9628a1b2e29b9918ae8bd72be6...
Author: Ivan Gyurdiev ivg231@gmail.com Date: Thu Oct 12 02:22:18 2006 -0400
wined3d: Merge D3DRECT types into one type in WINED3D namespace.
---
dlls/d3d8/device.c | 3 ++- dlls/d3d9/device.c | 8 ++++++-- dlls/ddraw/device.c | 3 ++- dlls/wined3d/device.c | 8 ++++---- dlls/wined3d/surface.c | 4 ++-- include/wine/wined3d_interface.h | 4 ++-- include/wine/wined3d_types.h | 7 +++++++ 7 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 150abde..380a8ff 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -671,7 +671,8 @@ static HRESULT WINAPI IDirect3DDevice8Im IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; TRACE("(%p) Relay\n" , This);
- return IWineD3DDevice_Clear(This->WineD3DDevice, Count, pRects, Flags, Color, Z, Stencil); + /* Note: D3DRECT is compatible with WINED3DRECT */ + return IWineD3DDevice_Clear(This->WineD3DDevice, Count, (CONST WINED3DRECT*) pRects, Flags, Color, Z, Stencil); }
static HRESULT WINAPI IDirect3DDevice8Impl_SetTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* lpMatrix) { diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index ff5eada..b450cbb 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -361,7 +361,9 @@ static HRESULT WINAPI IDirect3DDevice9 IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DSurface9Impl *surface = (IDirect3DSurface9Impl *)pSurface; TRACE("(%p) Relay\n" , This); - return IWineD3DDevice_ColorFill(This->WineD3DDevice, surface->wineD3DSurface, (CONST D3DRECT*)pRect, color); + + /* Note: D3DRECT is compatible with WINED3DRECT */ + return IWineD3DDevice_ColorFill(This->WineD3DDevice, surface->wineD3DSurface, (CONST WINED3DRECT*)pRect, color); }
static HRESULT WINAPI IDirect3DDevice9Impl_CreateOffscreenPlainSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9 **ppSurface, HANDLE* pSharedHandle) { @@ -458,7 +460,9 @@ static HRESULT WINAPI IDirect3DDevice9 static HRESULT WINAPI IDirect3DDevice9Impl_Clear(LPDIRECT3DDEVICE9 iface, DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; TRACE("(%p) Relay\n" , This); - return IWineD3DDevice_Clear(This->WineD3DDevice, Count, pRects, Flags, Color, Z, Stencil); + + /* Note: D3DRECT is compatible with WINED3DRECT */ + return IWineD3DDevice_Clear(This->WineD3DDevice, Count, (CONST WINED3DRECT*) pRects, Flags, Color, Z, Stencil); }
static HRESULT WINAPI IDirect3DDevice9Impl_SetTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* lpMatrix) { diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 78ed293..b0eccc9 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -4031,7 +4031,8 @@ IDirect3DDeviceImpl_7_Clear(IDirect3DDev ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface); TRACE("(%p)->(%08x,%p,%08x,%08x,%f,%08x): Relay\n", This, Count, Rects, Flags, (DWORD) Color, Z, Stencil);
- return IWineD3DDevice_Clear(This->wineD3DDevice, Count, Rects, Flags, Color, Z, Stencil); + /* Note; D3DRECT is compatible with WINED3DRECT */ + return IWineD3DDevice_Clear(This->wineD3DDevice, Count, (WINED3DRECT*) Rects, Flags, Color, Z, Stencil); }
/***************************************************************************** diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 6de22f7..4b72580 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -6021,7 +6021,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl return WINED3D_OK; }
-static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Count, CONST D3DRECT* pRects, +static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Count, CONST WINED3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
@@ -6034,7 +6034,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl GLint old_stencil_clear_value; GLfloat old_color_clear_value[4]; unsigned int i; - CONST D3DRECT* curRect; + CONST WINED3DRECT* curRect;
TRACE("(%p) Count (%d), pRects (%p), Flags (%x), Z (%f), Stencil (%d)\n", This, Count, pRects, Flags, Z, Stencil); @@ -6108,7 +6108,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl checkGLcall("glClear");
/* Step to the next rectangle */ - if (curRect) curRect = curRect + sizeof(D3DRECT); + if (curRect) curRect = curRect + sizeof(WINED3DRECT); }
/* Restore the old values (why..?) */ @@ -6995,7 +6995,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl return WINED3D_OK; }
-static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface, IWineD3DSurface *pSurface, CONST D3DRECT* pRect, D3DCOLOR color) { +static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface, IWineD3DSurface *pSurface, CONST WINED3DRECT* pRect, D3DCOLOR color) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *) pSurface; DDBLTFX BltFx; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 0377ddd..1242bbc 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2237,7 +2237,7 @@ static HRESULT WINAPI IWineD3DSurfaceImp
/* Not called from the VTable */ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, DDBLTFX *DDBltFx) { - D3DRECT rect; + WINED3DRECT rect; IWineD3DDeviceImpl *myDevice = This->resource.wineD3DDevice; IWineD3DSwapChainImpl *swapchain = NULL; IWineD3DSurfaceImpl *Src = (IWineD3DSurfaceImpl *) SrcSurface; @@ -2580,7 +2580,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOv if( ( (IWineD3DSurface *) This != swapchain->frontBuffer) && ( swapchain->backBuffer && (IWineD3DSurface *) This != swapchain->backBuffer[0]) ) { UINT row; - D3DRECT srect; + WINED3DRECT srect; float xrel, yrel;
TRACE("Blt from rendertarget to texture\n"); diff --git a/include/wine/wined3d_interface.h b/include/wine/wined3d_interface.h index 01a9d74..b6a2650 100644 --- a/include/wine/wined3d_interface.h +++ b/include/wine/wined3d_interface.h @@ -447,7 +447,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD STDMETHOD(BeginScene)(THIS) PURE; STDMETHOD(EndScene)(THIS) PURE; STDMETHOD(Present)(THIS_ CONST RECT * pSourceRect,CONST RECT * pDestRect,HWND hDestWindowOverride,CONST RGNDATA * pDirtyRegion) PURE; - STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT * pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) PURE; + STDMETHOD(Clear)(THIS_ DWORD Count, CONST WINED3DRECT * pRects, DWORD Flags, D3DCOLOR Color,float Z, DWORD Stencil) PURE; STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE; STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,INT baseVIdx, UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE; STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void * pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; @@ -456,7 +456,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD STDMETHOD(DrawRectPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST WINED3DRECTPATCH_INFO* pRectPatchInfo) PURE; STDMETHOD(DrawTriPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST WINED3DTRIPATCH_INFO* pTriPatchInfo) PURE; STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; - STDMETHOD(ColorFill)(THIS_ struct IWineD3DSurface* pSurface, CONST D3DRECT* pRect, D3DCOLOR color) PURE; + STDMETHOD(ColorFill)(THIS_ struct IWineD3DSurface* pSurface, CONST WINED3DRECT* pRect, D3DCOLOR 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(CopyRects)(THIS_ struct IWineD3DSurface* pSourceSurface, CONST RECT* pSourceRectsArray, UINT cRects, struct IWineD3DSurface* pDestinationSurface, CONST POINT* pDestPointsArray); diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h index ccd588f..9eac171 100644 --- a/include/wine/wined3d_types.h +++ b/include/wine/wined3d_types.h @@ -64,6 +64,13 @@ typedef struct _WINED3DMATRIX { } DUMMYUNIONNAME; } WINED3DMATRIX;
+typedef struct _WINED3DRECT { + LONG x1; + LONG y1; + LONG x2; + LONG y2; +} WINED3DRECT; + typedef struct _WINED3DLIGHT { WINED3DLIGHTTYPE Type; WINED3DCOLORVALUE Diffuse;