Implement Hal GetAvailableVidMem and is it working in windows

svn path=/trunk/; revision=18864
This commit is contained in:
Magnus Olsen 2005-10-30 01:06:56 +00:00
parent c55ab58a88
commit fd2311a670
4 changed files with 59 additions and 4 deletions

View file

@ -354,3 +354,33 @@ VOID Hal_DirectDraw_Release (LPDIRECTDRAW7 iface)
if(This->DirectDrawGlobal.lpD3DGlobalDriverData)
HeapFree(GetProcessHeap(), 0, (PVOID)This->DirectDrawGlobal.lpD3DGlobalDriverData);
}
HRESULT Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
LPDWORD total, LPDWORD free)
{
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
DDHAL_GETAVAILDRIVERMEMORYDATA mem;
if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.dwFlags & DDHAL_MISCCB32_GETAVAILDRIVERMEMORY))
{
return DDERR_NODRIVERSUPPORT;
}
mem.lpDD = &This->DirectDrawGlobal;
if (This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.GetAvailDriverMemory(&mem) != DDHAL_DRIVER_HANDLED)
{
return DDERR_NODRIVERSUPPORT;
}
ddscaps->dwCaps = mem.DDSCaps.dwCaps;
ddscaps->dwCaps2 = mem.ddsCapsEx.dwCaps2;
ddscaps->dwCaps3 = mem.ddsCapsEx.dwCaps3;
ddscaps->dwCaps4 = mem.ddsCapsEx.dwCaps4;
*total = mem.dwTotal;
*free = mem.dwFree;
return mem.ddRVal;
}

View file

@ -352,7 +352,8 @@ HRESULT WINAPI Main_DirectDraw_GetDisplayMode(LPDIRECTDRAW7 iface, LPDDSURFACEDE
DDCOLORKEY ddckCKSrcOverlay;
DDCOLORKEY ddckCKSrcBlt;
*/
RtlCopyMemory(&pDDSD->ddpfPixelFormat,&This->DirectDrawGlobal.vmiData.ddpfDisplay,sizeof(DDPIXELFORMAT));
RtlCopyMemory(&pDDSD->ddsCaps,&This->DirectDrawGlobal.ddCaps,sizeof(DDCORECAPS));
@ -412,9 +413,18 @@ HRESULT WINAPI Main_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD d
HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
LPDWORD total, LPDWORD free)
{
DX_STUB;
{
DWORD ret;
if((ret = Hal_DirectDraw_GetAvailableVidMem (iface,ddscaps,total,free)) == DD_OK)
return ret;
if((ret = Hel_DirectDraw_GetAvailableVidMem (iface,ddscaps,total,free)) == DD_OK)
return ret;
return DDERR_NOTINITIALIZED;
}
HRESULT WINAPI Main_DirectDraw_GetSurfaceFromDC(LPDIRECTDRAW7 iface, HDC hdc,

View file

@ -88,10 +88,18 @@ 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 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);
/*********** Macros ***********/
#define DX_STUB \

View file

@ -24,3 +24,10 @@ HRESULT Hel_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface)
VOID Hel_DirectDraw_Release (LPDIRECTDRAW7 iface)
{
}
HRESULT Hel_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
LPDWORD total, LPDWORD free)
{
DX_STUB;
}