Author: greatlrd
Date: Tue Jul 25 01:51:31 2006
New Revision: 23272
URL:
http://svn.reactos.org/svn/reactos?rev=23272&view=rev
Log:
Kill more of the old design.
Removed:
trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c
trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c
Modified:
trunk/reactos/dll/directx/ddraw/main/ddraw_main.c
trunk/reactos/dll/directx/ddraw/rosdraw.h
trunk/reactos/dll/directx/ddraw/startup.c
Removed: trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/ddra…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c (original)
+++ trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c (removed)
@@ -1,74 +1,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;
-}
-
-
-
-
-
Modified: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/main/ddr…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/main/ddraw_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/main/ddraw_main.c Tue Jul 25 01:51:31 2006
@@ -920,17 +920,20 @@
return DDERR_NODRIVERSUPPORT;
}
-
-
-
-
-
-
-
-
-/*
- * IMPLEMENT
- * Status this api is finish and is 100% correct
+/*
+ * Stub
+ * Status todo
+ */
+HRESULT WINAPI
+Main_DirectDraw_GetVerticalBlankStatus(LPDIRECTDRAW7 iface, LPBOOL status)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
+/*
+ * IMPLEMENT
+ * Status ok
*/
HRESULT
WINAPI
@@ -957,7 +960,25 @@
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 @@
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,9 +1109,76 @@
}
-
-
-
+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;
+}
+
+
+
+
+
+
+
+
+
+
+
+/*
+ * IMPLEMENT
+ * Status this api is finish and is 100% correct
+ */
@@ -1105,48 +1198,12 @@
-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_GetVerticalBlankStatus(LPDIRECTDRAW7 iface, LPBOOL
status)
-{
- DX_WINDBG_trace();
- DX_STUB;
-}
+
Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/rosdraw.h (original)
+++ trunk/reactos/dll/directx/ddraw/rosdraw.h Tue Jul 25 01:51:31 2006
@@ -97,7 +97,7 @@
DDHAL_GETSCANLINEDATA mDdGetScanLine;
DDHAL_SETEXCLUSIVEMODEDATA mDdSetExclusiveMode;
DDHAL_FLIPTOGDISURFACEDATA mDdFlipToGDISurface;
-
+
DDRAWI_DDRAWSURFACE_GBL mPrimaryGlobal;
/* adding a switch */
Removed: trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/ddr…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c (original)
+++ trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c (removed)
@@ -1,31 +1,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;
-}
-
-
-
Modified: trunk/reactos/dll/directx/ddraw/startup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/startup.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/startup.c (original)
+++ trunk/reactos/dll/directx/ddraw/startup.c Tue Jul 25 01:51:31 2006
@@ -364,6 +364,11 @@
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 @@
This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_FLIPTOGDISURFACE;
This->mCallbacks.HELDD.FlipToGDISurface = HelDdFlipToGDISurface;
-
+
return DD_OK;
}