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

svn path=/trunk/; revision=21821
This commit is contained in:
Magnus Olsen 2006-05-07 09:12:37 +00:00
parent cf6a23c944
commit 234eeebea4
5 changed files with 28 additions and 59 deletions

View file

@ -198,33 +198,6 @@ Hal_DirectDraw_Release (LPDIRECTDRAW7 iface)
}
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)

View file

@ -290,6 +290,7 @@ HRESULT WINAPI Main_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface, HWND hw
DX_WINDBG_trace();
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode;
// check the parameters
if ((This->cooperative_level == cooplevel) && ((HWND)This->mDDrawGlobal.lpExclusiveOwner->hWnd == hwnd))
@ -314,13 +315,27 @@ HRESULT WINAPI Main_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface, HWND hw
This->cooperative_level = cooplevel;
if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE)
if ((This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE))
{
return Hal_DirectDraw_SetCooperativeLevel (iface);
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;
}
return Hel_DirectDraw_SetCooperativeLevel(iface);
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,

View file

@ -304,15 +304,13 @@ DWORD CALLBACK HelDdFlipToGDISurface(LPDDHAL_FLIPTOGDISURFACEDATA lpFlipToGDISu
#define DX_STUB_str(x) \
static BOOL firstcall = TRUE; \
if (firstcall) \
{ \
char buffer[1024]; \
sprintf ( buffer, "Function %s %s (%s:%d)\n", __FUNCTION__,x,__FILE__,__LINE__ ); \
OutputDebugStringA(buffer); \
firstcall = FALSE; \
}
//#define DX_WINDBG_trace()

View file

@ -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)
{

View file

@ -64,7 +64,9 @@ DWORD CALLBACK HelDdSetExclusiveMode(LPDDHAL_SETEXCLUSIVEMODEDATA lpSetExclusiv
{
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)