mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
Kill more of the old design.
svn path=/trunk/; revision=23272
This commit is contained in:
parent
0f10d5736f
commit
6561a4a6b2
5 changed files with 111 additions and 158 deletions
|
@ -1,74 +0,0 @@
|
|||
/* $Id$
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS
|
||||
* FILE: lib/ddraw/hal/ddraw.c
|
||||
* PURPOSE: DirectDraw HAL Implementation
|
||||
* PROGRAMMER: Magnus Olsen, Maarten Bosma
|
||||
*
|
||||
*/
|
||||
|
||||
#include "rosdraw.h"
|
||||
|
||||
|
||||
|
||||
|
||||
HRESULT
|
||||
Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
|
||||
LPDWORD total, LPDWORD free)
|
||||
{
|
||||
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
|
||||
|
||||
DDHAL_GETAVAILDRIVERMEMORYDATA mem;
|
||||
|
||||
if (!(This->mDDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.dwFlags & DDHAL_MISCCB32_GETAVAILDRIVERMEMORY))
|
||||
{
|
||||
return DDERR_NODRIVERSUPPORT;
|
||||
}
|
||||
|
||||
mem.lpDD = &This->mDDrawGlobal;
|
||||
mem.ddRVal = DDERR_NOTPALETTIZED;
|
||||
|
||||
if (This->mDDrawGlobal.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;
|
||||
}
|
||||
|
||||
HRESULT Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,HANDLE h)
|
||||
{
|
||||
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
|
||||
|
||||
DDHAL_WAITFORVERTICALBLANKDATA WaitVectorData;
|
||||
|
||||
if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK))
|
||||
{
|
||||
return DDERR_NODRIVERSUPPORT;
|
||||
}
|
||||
|
||||
WaitVectorData.lpDD = &This->mDDrawGlobal;
|
||||
WaitVectorData.dwFlags = dwFlags;
|
||||
WaitVectorData.hEvent = (DWORD)h;
|
||||
WaitVectorData.ddRVal = DDERR_NOTPALETTIZED;
|
||||
|
||||
if (This->mDDrawGlobal.lpDDCBtmp->HALDD.WaitForVerticalBlank(&WaitVectorData) != DDHAL_DRIVER_HANDLED)
|
||||
{
|
||||
return DDERR_NODRIVERSUPPORT;
|
||||
}
|
||||
|
||||
return WaitVectorData.ddRVal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -920,17 +920,20 @@ Main_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine)
|
|||
return DDERR_NODRIVERSUPPORT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Stub
|
||||
* Status todo
|
||||
*/
|
||||
HRESULT WINAPI
|
||||
Main_DirectDraw_GetVerticalBlankStatus(LPDIRECTDRAW7 iface, LPBOOL status)
|
||||
{
|
||||
DX_WINDBG_trace();
|
||||
DX_STUB;
|
||||
}
|
||||
|
||||
/*
|
||||
* IMPLEMENT
|
||||
* Status this api is finish and is 100% correct
|
||||
* Status ok
|
||||
*/
|
||||
HRESULT
|
||||
WINAPI
|
||||
|
@ -957,7 +960,25 @@ Main_DirectDraw_Initialize (LPDIRECTDRAW7 iface, LPGUID lpGUID)
|
|||
return DD_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI Main_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface, HWND hwnd, DWORD cooplevel)
|
||||
/*
|
||||
* IMPLEMENT
|
||||
* Status ok
|
||||
*/
|
||||
HRESULT WINAPI
|
||||
Main_DirectDraw_RestoreDisplayMode(LPDIRECTDRAW7 iface)
|
||||
{
|
||||
DX_WINDBG_trace();
|
||||
|
||||
ChangeDisplaySettings(NULL, 0);
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* IMPLEMENT
|
||||
* Status ok
|
||||
*/
|
||||
HRESULT WINAPI
|
||||
Main_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface, HWND hwnd, DWORD cooplevel)
|
||||
{
|
||||
// TODO:
|
||||
// - create a scaner that check which driver we should get the HDC from
|
||||
|
@ -1015,7 +1036,12 @@ HRESULT WINAPI Main_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface, HWND hw
|
|||
return SetExclusiveMode.ddRVal;
|
||||
}
|
||||
|
||||
HRESULT WINAPI Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight,
|
||||
/*
|
||||
* IMPLEMENT
|
||||
* Status ok
|
||||
*/
|
||||
HRESULT WINAPI
|
||||
Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight,
|
||||
DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
|
||||
{
|
||||
DX_WINDBG_trace();
|
||||
|
@ -1083,6 +1109,61 @@ HRESULT WINAPI Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidt
|
|||
}
|
||||
|
||||
|
||||
HRESULT WINAPI Main_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
|
||||
HANDLE h)
|
||||
{
|
||||
DX_WINDBG_trace();
|
||||
|
||||
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
|
||||
|
||||
if (This->mDdWaitForVerticalBlank.WaitForVerticalBlank == NULL)
|
||||
{
|
||||
return DDERR_NODRIVERSUPPORT;
|
||||
}
|
||||
|
||||
This->mDdWaitForVerticalBlank.dwFlags = dwFlags;
|
||||
This->mDdWaitForVerticalBlank.hEvent = (DWORD)h;
|
||||
This->mDdWaitForVerticalBlank.ddRVal = DDERR_NOTPALETTIZED;
|
||||
|
||||
if (This->mDdWaitForVerticalBlank.WaitForVerticalBlank(&This->mDdWaitForVerticalBlank)==DDHAL_DRIVER_HANDLED);
|
||||
{
|
||||
return This->mDdWaitForVerticalBlank.ddRVal;
|
||||
}
|
||||
|
||||
return DDERR_NODRIVERSUPPORT;
|
||||
}
|
||||
|
||||
HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
|
||||
LPDWORD total, LPDWORD free)
|
||||
{
|
||||
DX_WINDBG_trace();
|
||||
DDHAL_GETAVAILDRIVERMEMORYDATA mem;
|
||||
|
||||
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
|
||||
|
||||
/* Only Hal version exists acodring msdn */
|
||||
if (!(This->mDDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.dwFlags & DDHAL_MISCCB32_GETAVAILDRIVERMEMORY))
|
||||
{
|
||||
return DDERR_NODRIVERSUPPORT;
|
||||
}
|
||||
|
||||
mem.lpDD = &This->mDDrawGlobal;
|
||||
mem.ddRVal = DDERR_NOTPALETTIZED;
|
||||
|
||||
if (This->mDDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.GetAvailDriverMemory(&mem) == DDHAL_DRIVER_HANDLED);
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
return DDERR_NODRIVERSUPPORT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1090,6 +1171,18 @@ HRESULT WINAPI Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidt
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* IMPLEMENT
|
||||
* Status this api is finish and is 100% correct
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
// This function is exported by the dll
|
||||
HRESULT WINAPI DirectDrawCreateClipper (DWORD dwFlags,
|
||||
LPDIRECTDRAWCLIPPER* lplpDDClipper, LPUNKNOWN pUnkOuter)
|
||||
|
@ -1105,48 +1198,12 @@ HRESULT WINAPI DirectDrawCreateClipper (DWORD dwFlags,
|
|||
|
||||
|
||||
|
||||
HRESULT WINAPI Main_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
|
||||
HANDLE h)
|
||||
{
|
||||
DX_WINDBG_trace();
|
||||
|
||||
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
|
||||
|
||||
if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK)
|
||||
{
|
||||
return Hal_DirectDraw_WaitForVerticalBlank( iface, dwFlags, h);
|
||||
}
|
||||
|
||||
return Hel_DirectDraw_WaitForVerticalBlank( iface, dwFlags, h);
|
||||
}
|
||||
|
||||
HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
|
||||
LPDWORD total, LPDWORD free)
|
||||
{
|
||||
DX_WINDBG_trace();
|
||||
|
||||
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
|
||||
|
||||
|
||||
if (This->mDDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.dwFlags & DDHAL_MISCCB32_GETAVAILDRIVERMEMORY)
|
||||
{
|
||||
return Hal_DirectDraw_GetAvailableVidMem (iface,ddscaps,total,free);
|
||||
}
|
||||
|
||||
return Hel_DirectDraw_GetAvailableVidMem (iface,ddscaps,total,free);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HRESULT WINAPI Main_DirectDraw_RestoreDisplayMode(LPDIRECTDRAW7 iface)
|
||||
{
|
||||
DX_WINDBG_trace();
|
||||
|
||||
ChangeDisplaySettings(NULL, 0);
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
/********************************** Stubs **********************************/
|
||||
|
||||
|
@ -1163,11 +1220,7 @@ HRESULT WINAPI Main_DirectDraw_RestoreDisplayMode(LPDIRECTDRAW7 iface)
|
|||
|
||||
|
||||
|
||||
HRESULT WINAPI Main_DirectDraw_GetVerticalBlankStatus(LPDIRECTDRAW7 iface, LPBOOL status)
|
||||
{
|
||||
DX_WINDBG_trace();
|
||||
DX_STUB;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ typedef struct
|
|||
DDHAL_GETSCANLINEDATA mDdGetScanLine;
|
||||
DDHAL_SETEXCLUSIVEMODEDATA mDdSetExclusiveMode;
|
||||
DDHAL_FLIPTOGDISURFACEDATA mDdFlipToGDISurface;
|
||||
|
||||
|
||||
DDRAWI_DDRAWSURFACE_GBL mPrimaryGlobal;
|
||||
|
||||
/* adding a switch */
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
/* $Id$
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS
|
||||
* FILE: lib/ddraw/soft/ddraw.c
|
||||
* PURPOSE: DirectDraw Software Implementation
|
||||
* PROGRAMMER: Magnus Olsen, Maarten Bosma
|
||||
*
|
||||
*/
|
||||
|
||||
#include "rosdraw.h"
|
||||
|
||||
|
||||
HRESULT Hel_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
|
||||
LPDWORD total, LPDWORD free)
|
||||
{
|
||||
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
|
||||
|
||||
*total = HEL_GRAPHIC_MEMORY_MAX;
|
||||
*free = This->HELMemoryAvilable;
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT Hel_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,HANDLE h)
|
||||
{
|
||||
DX_STUB;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -364,6 +364,11 @@ StartDirectDrawHal(LPDIRECTDRAW* iface)
|
|||
DriverInfo.dwExpectedSize = sizeof(DDHAL_DDMISCELLANEOUSCALLBACKS);
|
||||
This->mHALInfo.GetDriverInfo(&DriverInfo);
|
||||
|
||||
if (This->mDDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.dwFlags & DDHAL_MISCCB32_GETAVAILDRIVERMEMORY)
|
||||
{
|
||||
This->mDdGetDriverMemory.GetAvailDriverMemory = This->mDDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.GetAvailDriverMemory;
|
||||
}
|
||||
|
||||
/* Setup global surface */
|
||||
/*This->mPrimaryGlobal.dwGlobalFlags = DDRAWISURFGBL_ISGDISURFACE;
|
||||
This->mPrimaryGlobal.lpDD = &This->mDDrawGlobal;
|
||||
|
@ -413,7 +418,7 @@ StartDirectDrawHel(LPDIRECTDRAW* iface)
|
|||
|
||||
This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_FLIPTOGDISURFACE;
|
||||
This->mCallbacks.HELDD.FlipToGDISurface = HelDdFlipToGDISurface;
|
||||
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue