From 893be438351c82305310bcb760d308197bd402ac Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Wed, 29 Nov 2006 22:09:52 +0000 Subject: [PATCH] 1. adding surface callbacks stub, and activate them. 2. Finish the mix betwin HAL and HEL that we can do for now. 3. Finish the switch betwin HAL and HEL that we can do for now. 4. mange activate a DDCALLBACKS stub that was not posible before with wine ddraw.h header. after I wrote a new ddraw.f header for ReactOS, it works to actiavte FlipToGDISurface HEL callbacks. But it is stub for moment. svn path=/trunk/; revision=24976 --- reactos/dll/directx/ddraw/callbacks_hel.c | 4 +- reactos/dll/directx/ddraw/ddraw.rbuild | 1 + reactos/dll/directx/ddraw/rosdraw.h | 17 ++++++ reactos/dll/directx/ddraw/startup.c | 70 ++++++++++++++++++----- 4 files changed, 75 insertions(+), 17 deletions(-) diff --git a/reactos/dll/directx/ddraw/callbacks_hel.c b/reactos/dll/directx/ddraw/callbacks_hel.c index 1ef5543c07c..b423f023e8e 100644 --- a/reactos/dll/directx/ddraw/callbacks_hel.c +++ b/reactos/dll/directx/ddraw/callbacks_hel.c @@ -28,12 +28,12 @@ DWORD CALLBACK HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface) DX_STUB; } -/* + DWORD CALLBACK HelDdSetColorKey(LPDDHAL_SETCOLORKEYDATA lpSetColorKey) { DX_STUB; } -*/ + DWORD CALLBACK HelDdSetMode(LPDDHAL_SETMODEDATA SetMode) { diff --git a/reactos/dll/directx/ddraw/ddraw.rbuild b/reactos/dll/directx/ddraw/ddraw.rbuild index e6c0ef3a63b..69a7390650f 100644 --- a/reactos/dll/directx/ddraw/ddraw.rbuild +++ b/reactos/dll/directx/ddraw/ddraw.rbuild @@ -29,6 +29,7 @@ iface_kernel.c callbacks_hel.c + callbacks_surf_hel.c ddraw_main.c diff --git a/reactos/dll/directx/ddraw/rosdraw.h b/reactos/dll/directx/ddraw/rosdraw.h index f168355fa99..21764c6317f 100644 --- a/reactos/dll/directx/ddraw/rosdraw.h +++ b/reactos/dll/directx/ddraw/rosdraw.h @@ -571,6 +571,23 @@ DWORD CALLBACK HelDdGetScanLine(LPDDHAL_GETSCANLINEDATA lpGetScanLine); DWORD CALLBACK HelDdSetExclusiveMode(LPDDHAL_SETEXCLUSIVEMODEDATA lpSetExclusiveMode); DWORD CALLBACK HelDdFlipToGDISurface(LPDDHAL_FLIPTOGDISURFACEDATA lpFlipToGDISurface); +DWORD CALLBACK HelDdSurfAddAttachedSurface(LPDDHAL_ADDATTACHEDSURFACEDATA lpDestroySurface); +DWORD CALLBACK HelDdSurfBlt(LPDDHAL_BLTDATA lpBltData); +DWORD CALLBACK HelDdSurfDestroySurface(LPDDHAL_DESTROYSURFACEDATA lpDestroySurfaceData); +DWORD CALLBACK HelDdSurfFlip(LPDDHAL_FLIPDATA lpFlipData); +DWORD CALLBACK HelDdSurfGetBltStatus(LPDDHAL_GETBLTSTATUSDATA lpGetBltStatusData); +DWORD CALLBACK HelDdSurfGetFlipStatus(LPDDHAL_GETFLIPSTATUSDATA lpGetFlipStatusData); +DWORD CALLBACK HelDdSurfLock(LPDDHAL_LOCKDATA lpLockData); +DWORD CALLBACK HelDdSurfreserved4(DWORD *lpPtr); +DWORD CALLBACK HelDdSurfSetClipList(LPDDHAL_SETCLIPLISTDATA lpSetClipListData); +DWORD CALLBACK HelDdSurfSetColorKey(LPDDHAL_SETCOLORKEYDATA lpSetColorKeyData); +DWORD CALLBACK HelDdSurfSetOverlayPosition(LPDDHAL_SETOVERLAYPOSITIONDATA lpSetOverlayPositionData); +DWORD CALLBACK HelDdSurfSetPalette(LPDDHAL_SETPALETTEDATA lpSetPaletteData); +DWORD CALLBACK HelDdSurfUnlock(LPDDHAL_UNLOCKDATA lpUnLockData); +DWORD CALLBACK HelDdSurfUpdateOverlay(LPDDHAL_UPDATEOVERLAYDATA lpUpDateOveryLayData); + + + /* Setting for HEL should be move to ros special reg key ? */ diff --git a/reactos/dll/directx/ddraw/startup.c b/reactos/dll/directx/ddraw/startup.c index ee48b0253f4..cf70d8f3875 100644 --- a/reactos/dll/directx/ddraw/startup.c +++ b/reactos/dll/directx/ddraw/startup.c @@ -170,8 +170,7 @@ StartDirectDraw(LPDIRECTDRAW* iface, LPGUID lpGuid) This->lpLcl->hDD = This->lpLcl->lpGbl->hDD; - /* Mix the DDCALLBACKS */ - + /* Mix the DDCALLBACKS */ This->lpLcl->lpDDCB->cbDDCallbacks.dwSize = sizeof(This->lpLcl->lpDDCB->cbDDCallbacks); if ((This->lpLcl->lpDDCB->HALDD.dwFlags & DDHAL_CB32_CANCREATESURFACE) && (devicetypes !=3)) @@ -490,14 +489,41 @@ StartDirectDraw(LPDIRECTDRAW* iface, LPGUID lpGuid) This->lpLcl->lpDDCB->HELDDSurface.UpdateOverlay; } + /* Mix the DDPALETTE CALLBACKS */ + This->lpLcl->lpDDCB->HALDDPalette.dwSize = sizeof(This->lpLcl->lpDDCB->HALDDPalette); - /* Mix the DDPALETTE CALLBACKS - This->lpLcl->lpDDCB->HELDDPalette.DestroyPalette = HelDdPalDestroyPalette; - This->lpLcl->lpDDCB->HELDDPalette.SetEntries = HelDdPalSetEntries; - This->lpLcl->lpDDCB->HELDDPalette.dwSize = sizeof(This->lpLcl->lpDDCB->HELDDPalette); - */ + if ((This->lpLcl->lpDDCB->HALDDPalette.dwFlags & DDHAL_PALCB32_DESTROYPALETTE) && (devicetypes !=3)) + { + This->lpLcl->lpDDCB->cbDDPaletteCallbacks.dwFlags |= DDHAL_PALCB32_SETENTRIES; + + This->lpLcl->lpDDCB->cbDDPaletteCallbacks.DestroyPalette = + This->lpLcl->lpDDCB->HALDDPalette.DestroyPalette; + } + else if ((This->lpLcl->lpDDCB->HELDDPalette.dwFlags & DDHAL_PALCB32_DESTROYPALETTE) && (devicetypes !=2)) + { + This->lpLcl->lpDDCB->cbDDPaletteCallbacks.dwFlags |= DDHAL_PALCB32_DESTROYPALETTE; + + This->lpLcl->lpDDCB->cbDDPaletteCallbacks.DestroyPalette = + This->lpLcl->lpDDCB->HELDDPalette.DestroyPalette; + } + + if ((This->lpLcl->lpDDCB->HALDDPalette.dwFlags & DDHAL_PALCB32_SETENTRIES) && (devicetypes !=3)) + { + This->lpLcl->lpDDCB->cbDDPaletteCallbacks.dwFlags |= DDHAL_PALCB32_SETENTRIES; + + This->lpLcl->lpDDCB->cbDDPaletteCallbacks.SetEntries = + This->lpLcl->lpDDCB->HALDDPalette.SetEntries; + } + else if ((This->lpLcl->lpDDCB->HELDDPalette.dwFlags & DDHAL_PALCB32_SETENTRIES) && (devicetypes !=2)) + { + This->lpLcl->lpDDCB->cbDDPaletteCallbacks.dwFlags |= DDHAL_PALCB32_SETENTRIES; + + This->lpLcl->lpDDCB->cbDDPaletteCallbacks.SetEntries = + This->lpLcl->lpDDCB->HELDDPalette.SetEntries; + } /* Mix the DDExeBuf CALLBACKS */ + This->lpLcl->lpDDCB->cbDDExeBufCallbacks.dwSize = sizeof(This->lpLcl->lpDDCB->cbDDExeBufCallbacks); if ((This->lpLcl->lpDDCB->HALDDExeBuf.dwFlags & DDHAL_EXEBUFCB32_CANCREATEEXEBUF) && (devicetypes !=3)) { @@ -770,9 +796,9 @@ StartDirectDrawHel(LPDIRECTDRAW* iface) This->lpLcl->lpDDCB->HELDD.CreateSurface = HelDdCreateSurface; This->lpLcl->lpDDCB->HELDD.CreatePalette = HelDdCreatePalette; This->lpLcl->lpDDCB->HELDD.DestroyDriver = HelDdDestroyDriver; - //This->lpLcl->lpDDCB->HELDD.FlipToGDISurface = HelDdFlipToGDISurface + This->lpLcl->lpDDCB->HELDD.FlipToGDISurface = HelDdFlipToGDISurface; This->lpLcl->lpDDCB->HELDD.GetScanLine = HelDdGetScanLine; - // This->lpLcl->lpDDCB->HELDD.SetColorKey = HelDdSetColorKey; + //This->lpLcl->lpDDCB->HELDD.SetColorKey = HelDdSetColorKey; This->lpLcl->lpDDCB->HELDD.SetExclusiveMode = HelDdSetExclusiveMode; This->lpLcl->lpDDCB->HELDD.SetMode = HelDdSetMode; This->lpLcl->lpDDCB->HELDD.WaitForVerticalBlank = HelDdWaitForVerticalBlank; @@ -781,17 +807,15 @@ StartDirectDrawHel(LPDIRECTDRAW* iface) DDHAL_CB32_CREATESURFACE | DDHAL_CB32_CREATEPALETTE | DDHAL_CB32_DESTROYDRIVER | - // DDHAL_CB32_FLIPTOGDISURFACE | + DDHAL_CB32_FLIPTOGDISURFACE | DDHAL_CB32_GETSCANLINE | - // DDHAL_CB32_SETCOLORKEY | + //DDHAL_CB32_SETCOLORKEY | DDHAL_CB32_SETEXCLUSIVEMODE | DDHAL_CB32_SETMODE | DDHAL_CB32_WAITFORVERTICALBLANK ; - This->lpLcl->lpDDCB->HELDD.dwSize = sizeof(This->lpLcl->lpDDCB->HELDD); - - /* + This->lpLcl->lpDDCB->HELDDSurface.AddAttachedSurface = HelDdSurfAddAttachedSurface; This->lpLcl->lpDDCB->HELDDSurface.Blt = HelDdSurfBlt; This->lpLcl->lpDDCB->HELDDSurface.DestroySurface = HelDdSurfDestroySurface; @@ -806,8 +830,24 @@ StartDirectDrawHel(LPDIRECTDRAW* iface) This->lpLcl->lpDDCB->HELDDSurface.SetPalette = HelDdSurfSetPalette; This->lpLcl->lpDDCB->HELDDSurface.Unlock = HelDdSurfUnlock; This->lpLcl->lpDDCB->HELDDSurface.UpdateOverlay = HelDdSurfUpdateOverlay; - */ + + This->lpLcl->lpDDCB->HELDDSurface.dwFlags = DDHAL_SURFCB32_ADDATTACHEDSURFACE | + DDHAL_SURFCB32_BLT | + DDHAL_SURFCB32_DESTROYSURFACE | + DDHAL_SURFCB32_FLIP | + DDHAL_SURFCB32_GETBLTSTATUS | + DDHAL_SURFCB32_GETFLIPSTATUS | + DDHAL_SURFCB32_LOCK | + DDHAL_SURFCB32_RESERVED4 | + DDHAL_SURFCB32_SETCLIPLIST | + DDHAL_SURFCB32_SETCOLORKEY | + DDHAL_SURFCB32_SETOVERLAYPOSITION | + DDHAL_SURFCB32_SETPALETTE | + DDHAL_SURFCB32_UNLOCK | + DDHAL_SURFCB32_UPDATEOVERLAY; + This->lpLcl->lpDDCB->HELDDSurface.dwSize = sizeof(This->lpLcl->lpDDCB->HELDDSurface); + /* This->lpLcl->lpDDCB->HELDDPalette.DestroyPalette = HelDdPalDestroyPalette; This->lpLcl->lpDDCB->HELDDPalette.SetEntries = HelDdPalSetEntries;