From b6bfd30b733585912f1b825a29dcdb5b5a21ddbf Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sun, 30 Oct 2005 12:53:32 +0000 Subject: [PATCH] lay some gorun for blt but not implement svn path=/trunk/; revision=18879 --- reactos/lib/ddraw/hal/surface_hal.c | 28 +++++++++++++++ reactos/lib/ddraw/main/surface_main.c | 10 +++++- reactos/lib/ddraw/rosdraw.h | 50 ++++++++++----------------- reactos/lib/ddraw/soft/surface_hel.c | 6 ++++ 4 files changed, 61 insertions(+), 33 deletions(-) diff --git a/reactos/lib/ddraw/hal/surface_hal.c b/reactos/lib/ddraw/hal/surface_hal.c index da3118c4d76..e4654c5fc86 100644 --- a/reactos/lib/ddraw/hal/surface_hal.c +++ b/reactos/lib/ddraw/hal/surface_hal.c @@ -9,3 +9,31 @@ */ #include "rosdraw.h" + +HRESULT Hal_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst, + LPDIRECTDRAWSURFACE7 src, LPRECT rsrc, DWORD dwFlags, LPDDBLTFX lpbltfx) +{ + + DDHAL_BLTDATA BltData; + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + + if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.dwFlags & DDHAL_SURFCB32_BLT)) + { + return DDERR_NODRIVERSUPPORT; + } + + BltData.lpDD = &This->DirectDrawGlobal; + /* RtlCopyMemory( &BltData.bltFX, lpbltfx,sizeof(DDBLTFX)); */ + BltData.dwFlags = dwFlags; + + /* FIXME blt is not complete */ + + if (This->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.Blt(&BltData) != DDHAL_DRIVER_HANDLED) + { + return DDERR_NODRIVERSUPPORT; + } + + return BltData.ddRVal; + +} + diff --git a/reactos/lib/ddraw/main/surface_main.c b/reactos/lib/ddraw/main/surface_main.c index 0c47fc6421b..5f89c46c099 100644 --- a/reactos/lib/ddraw/main/surface_main.c +++ b/reactos/lib/ddraw/main/surface_main.c @@ -126,9 +126,17 @@ Main_DDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE7 iface, REFIID riid, HRESULT WINAPI Main_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst, LPDIRECTDRAWSURFACE7 src, LPRECT rsrc, DWORD dwFlags, LPDDBLTFX lpbltfx) { - DX_STUB; + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + + if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_FLIPTOGDISURFACE) + { + return Hal_DDrawSurface_Blt( iface, rdst, src, rsrc, dwFlags, lpbltfx); + } + + return Hel_DDrawSurface_Blt( iface, rdst, src, rsrc, dwFlags, lpbltfx); } + HRESULT WINAPI Main_DDrawSurface_Lock (LPDIRECTDRAWSURFACE7 iface, LPRECT prect, LPDDSURFACEDESC2 pDDSD, DWORD flags, HANDLE event) { diff --git a/reactos/lib/ddraw/rosdraw.h b/reactos/lib/ddraw/rosdraw.h index d19c522763c..c2cad52a287 100644 --- a/reactos/lib/ddraw/rosdraw.h +++ b/reactos/lib/ddraw/rosdraw.h @@ -84,40 +84,26 @@ extern IDirectDrawGammaControlVtbl DirectDrawGammaControl_Vtable; /********* Prototypes **********/ -HRESULT Hal_DirectDraw_Initialize (LPDIRECTDRAW7 iface); -HRESULT Hal_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface); -VOID Hal_DirectDraw_Release (LPDIRECTDRAW7 iface); - -HRESULT Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps, - LPDWORD total, LPDWORD free); - -HRESULT Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags, - HANDLE h); - -HRESULT Hal_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine); -HRESULT Hal_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface); -HRESULT Hal_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight, - DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags); +HRESULT Hal_DirectDraw_Initialize (LPDIRECTDRAW7 ); +HRESULT Hal_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 ); +VOID Hal_DirectDraw_Release (LPDIRECTDRAW7 ); +HRESULT Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7, LPDDSCAPS2, LPDWORD, LPDWORD ); +HRESULT Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7, DWORD, HANDLE ); +HRESULT Hal_DirectDraw_GetScanLine(LPDIRECTDRAW7 , LPDWORD ); +HRESULT Hal_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 ); +HRESULT Hal_DirectDraw_SetDisplayMode (LPDIRECTDRAW7, DWORD, DWORD, DWORD, DWORD, DWORD ); +HRESULT Hal_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7, LPRECT, LPDIRECTDRAWSURFACE7, LPRECT, DWORD, LPDDBLTFX ); - - - -HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface); -HRESULT Hel_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface); -VOID Hel_DirectDraw_Release (LPDIRECTDRAW7 iface); - -HRESULT Hel_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps, - LPDWORD total, LPDWORD free); - -HRESULT Hel_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags, - HANDLE h); - -HRESULT Hel_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine); -HRESULT Hel_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface); -HRESULT Hel_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight, - DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags); - +HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 ); +HRESULT Hel_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 ); +VOID Hel_DirectDraw_Release (LPDIRECTDRAW7 ); +HRESULT Hel_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 , LPDDSCAPS2 ddsaps, LPDWORD , LPDWORD ); +HRESULT Hel_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7, DWORD, HANDLE ); +HRESULT Hel_DirectDraw_GetScanLine(LPDIRECTDRAW7 , LPDWORD ); +HRESULT Hel_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 ); +HRESULT Hel_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 , DWORD , DWORD ,DWORD , DWORD , DWORD ); +HRESULT Hel_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7, LPRECT, LPDIRECTDRAWSURFACE7, LPRECT, DWORD, LPDDBLTFX ); /*********** Macros ***********/ diff --git a/reactos/lib/ddraw/soft/surface_hel.c b/reactos/lib/ddraw/soft/surface_hel.c index 6ba93ec416e..cf8d10f271c 100644 --- a/reactos/lib/ddraw/soft/surface_hel.c +++ b/reactos/lib/ddraw/soft/surface_hel.c @@ -9,3 +9,9 @@ */ #include "rosdraw.h" + +HRESULT Hel_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst, + LPDIRECTDRAWSURFACE7 src, LPRECT rsrc, DWORD dwFlags, LPDDBLTFX lpbltfx) +{ + DX_STUB; +}