Author: greatlrd Date: Sun May 7 13:12:37 2006 New Revision: 21821
URL: http://svn.reactos.ru/svn/reactos?rev=21821&view=rev Log: merges HEL_SetCooperativeLevel and HAL_SetCooperativeLevel to MAIN_SetCooperativeLevel the new desgin allown us to use HEL as callbacks, we need change all HEL calls to the new desgin now
Modified: trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c trunk/reactos/dll/directx/ddraw/main/ddraw_main.c trunk/reactos/dll/directx/ddraw/rosdraw.h trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c
Modified: trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/ddraw_... ============================================================================== --- trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c (original) +++ trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c Sun May 7 13:12:37 2006 @@ -198,33 +198,6 @@ }
- -HRESULT -Hal_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface) -{ - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - - DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode; - - if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE)) - { - return DDERR_NODRIVERSUPPORT; - } - - SetExclusiveMode.lpDD = &This->mDDrawGlobal; - SetExclusiveMode.ddRVal = DDERR_NOTPALETTIZED; - SetExclusiveMode.dwEnterExcl = This->cooperative_level; - - if (This->mDDrawGlobal.lpDDCBtmp->HALDD.SetExclusiveMode(&SetExclusiveMode) != DDHAL_DRIVER_HANDLED) - { - return DDERR_NODRIVERSUPPORT; - } - - return SetExclusiveMode.ddRVal; -} - - - HRESULT Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps, LPDWORD total, LPDWORD free)
Modified: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/ddraw... ============================================================================== --- trunk/reactos/dll/directx/ddraw/main/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/main/ddraw_main.c Sun May 7 13:12:37 2006 @@ -290,7 +290,8 @@ DX_WINDBG_trace();
IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - + DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode; + // check the parameters if ((This->cooperative_level == cooplevel) && ((HWND)This->mDDrawGlobal.lpExclusiveOwner->hWnd == hwnd)) return DD_OK; @@ -314,13 +315,27 @@
This->cooperative_level = cooplevel;
- if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE) - { - return Hal_DirectDraw_SetCooperativeLevel (iface); - } - - return Hel_DirectDraw_SetCooperativeLevel(iface); - + if ((This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE)) + { + DX_STUB_str("HAL \n"); + SetExclusiveMode.SetExclusiveMode = This->mDDrawGlobal.lpDDCBtmp->HALDD.SetExclusiveMode; + } + else + { + DX_STUB_str("HEL \n"); + SetExclusiveMode.SetExclusiveMode = This->mDDrawGlobal.lpDDCBtmp->HELDD.SetExclusiveMode; + } + + SetExclusiveMode.lpDD = &This->mDDrawGlobal; + SetExclusiveMode.ddRVal = DDERR_NOTPALETTIZED; + SetExclusiveMode.dwEnterExcl = This->cooperative_level; + + if (SetExclusiveMode.SetExclusiveMode(&SetExclusiveMode) != DDHAL_DRIVER_HANDLED) + { + return DDERR_NODRIVERSUPPORT; + } + + return SetExclusiveMode.ddRVal; }
HRESULT WINAPI Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight,
Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.h?... ============================================================================== --- trunk/reactos/dll/directx/ddraw/rosdraw.h (original) +++ trunk/reactos/dll/directx/ddraw/rosdraw.h Sun May 7 13:12:37 2006 @@ -303,15 +303,13 @@ return DD_OK;
-#define DX_STUB_str(x) \ - static BOOL firstcall = TRUE; \ - if (firstcall) \ - { \ - char buffer[1024]; \ +#define DX_STUB_str(x) \ + { \ + char buffer[1024]; \ sprintf ( buffer, "Function %s %s (%s:%d)\n", __FUNCTION__,x,__FILE__,__LINE__ ); \ OutputDebugStringA(buffer); \ - firstcall = FALSE; \ - } + } +
//#define DX_WINDBG_trace()
Modified: trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/ddraw... ============================================================================== --- trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c (original) +++ trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c Sun May 7 13:12:37 2006 @@ -11,26 +11,7 @@ #include "rosdraw.h"
-/* -HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface) -{ - IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
- This->HELMemoryAvilable = HEL_GRAPHIC_MEMORY_MAX; - - This->mCallbacks.HELDD.dwFlags = DDHAL_CB32_CANCREATESURFACE; - This->mCallbacks.HELDD.CanCreateSurface = HelDdCanCreateSurface; - - This->mCallbacks.HELDD.dwFlags = DDHAL_CB32_CREATESURFACE; - This->mCallbacks.HELDD.CreateSurface = HelDdCreateSurface; - - return DD_OK; -} */ - -HRESULT Hel_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface) -{ - return DD_OK; -}
VOID Hel_DirectDraw_Release (LPDIRECTDRAW7 iface) {
Modified: trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/surfa... ============================================================================== --- trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c (original) +++ trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c Sun May 7 13:12:37 2006 @@ -64,7 +64,9 @@ { DX_WINDBG_trace(); DX_STUB_str("Not implement yet, return DD_OK for not bsod\n"); - return DD_OK; + lpSetExclusiveMode->ddRVal = DD_OK; + + return DDHAL_DRIVER_HANDLED; }
DWORD CALLBACK HelDdFlipToGDISurface(LPDDHAL_FLIPTOGDISURFACEDATA lpFlipToGDISurface)