Author: greatlrd
Date: Sun Apr 2 19:04:09 2006
New Revision: 21444
URL:
http://svn.reactos.ru/svn/reactos?rev=21444&view=rev
Log:
Remove Hal_DDrawSurface_Initialize, Hel_DDrawSurface_Initialize and make sure
DDrawSurface_Initialize act as windows ddraw.dll and wine ddraw.dll
Under devlopin with small changes in
Main_DirectDraw_CreateSurface this interface shall split now into one hel and one hal
part
Modified:
trunk/reactos/dll/directx/ddraw/hal/surface_hal.c
trunk/reactos/dll/directx/ddraw/main/ddraw_main.c
trunk/reactos/dll/directx/ddraw/main/surface_main.c
trunk/reactos/dll/directx/ddraw/rosdraw.h
trunk/reactos/dll/directx/ddraw/soft/surface_hel.c
Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/surfa…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/hal/surface_hal.c (original)
+++ trunk/reactos/dll/directx/ddraw/hal/surface_hal.c Sun Apr 2 19:04:09 2006
@@ -9,115 +9,6 @@
*/
#include "rosdraw.h"
-
-HRESULT Hal_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAW pDD,
LPDDSURFACEDESC2 pDDSD2)
-{
- IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
-
- if(sizeof(DDSURFACEDESC2) != pDDSD2->dwSize)
- return DDERR_UNSUPPORTED;
-
- This->owner = (IDirectDrawImpl*)pDD;
-
- /************ fill the discription of our primary surface ***********************/
-
- memset (&This->ddsd, 0, sizeof(DDSURFACEDESC));
- This->ddsd.dwSize = sizeof(DDSURFACEDESC);
-
- RtlCopyMemory(&This->ddsd.ddckCKDestBlt,&pDDSD2->ddckCKDestBlt,sizeof(This->ddsd.ddckCKDestBlt));
- RtlCopyMemory(&This->ddsd.ddckCKDestOverlay,&pDDSD2->ddckCKDestOverlay,sizeof(This->ddsd.ddckCKDestOverlay));
- RtlCopyMemory(&This->ddsd.ddckCKSrcBlt,&pDDSD2->ddckCKSrcBlt,sizeof(This->ddsd.ddckCKSrcBlt));
- RtlCopyMemory(&This->ddsd.ddckCKSrcOverlay,&pDDSD2->ddckCKSrcOverlay,sizeof(This->ddsd.ddckCKSrcOverlay));
- RtlCopyMemory(&This->ddsd.ddpfPixelFormat,&pDDSD2->ddpfPixelFormat,sizeof(This->ddsd.ddpfPixelFormat));
- RtlCopyMemory(&This->ddsd.ddsCaps,&pDDSD2->ddsCaps,sizeof(This->ddsd.ddsCaps));
-
- This->ddsd.dwAlphaBitDepth = pDDSD2->dwAlphaBitDepth;
- This->ddsd.dwBackBufferCount = pDDSD2->dwBackBufferCount;
- This->ddsd.dwFlags = pDDSD2->dwFlags;
- This->ddsd.dwHeight = pDDSD2->dwHeight;
- This->ddsd.dwLinearSize = pDDSD2->dwLinearSize;
- This->ddsd.dwMipMapCount = pDDSD2->dwMipMapCount;
- This->ddsd.dwRefreshRate = pDDSD2->dwRefreshRate;
- This->ddsd.dwReserved = pDDSD2->dwReserved;
- This->ddsd.dwWidth = pDDSD2->dwWidth;
- This->ddsd.lPitch = pDDSD2->lPitch;
- This->ddsd.lpSurface = pDDSD2->lpSurface;
-
- /************ Test see if we can Create Surface ***********************/
-
- if (This->owner->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags &
DDHAL_CB32_CANCREATESURFACE)
- {
- /* can the driver create the surface */
- DDHAL_CANCREATESURFACEDATA CanCreateData;
- memset(&CanCreateData, 0, sizeof(DDHAL_CANCREATESURFACEDATA));
- CanCreateData.lpDD = &This->owner->mDDrawGlobal;
- CanCreateData.lpDDSurfaceDesc = (LPDDSURFACEDESC)&This->ddsd;
-
- if
(This->owner->mDDrawGlobal.lpDDCBtmp->HALDD.CanCreateSurface(&CanCreateData)
== DDHAL_DRIVER_NOTHANDLED)
- return DDERR_INVALIDPARAMS;
-
- if(CanCreateData.ddRVal != DD_OK)
- return CanCreateData.ddRVal;
- }
-
- /************ Create Surface ***********************/
-
- /* surface global struct */
- memset(&This->Global, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL));
- This->Global.lpDD = &This->owner->mDDrawGlobal;
- This->Global.wHeight = This->owner->mDDrawGlobal.vmiData.dwDisplayHeight;
- This->Global.wWidth = This->owner->mDDrawGlobal.vmiData.dwDisplayWidth;
- This->Global.dwLinearSize = This->owner->mDDrawGlobal.vmiData.lDisplayPitch;
- if(pDDSD2->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
- This->Global.dwGlobalFlags = DDRAWISURFGBL_ISGDISURFACE;
-
- /* surface more struct */
- memset(&This->More, 0, sizeof(DDRAWI_DDRAWSURFACE_MORE));
- This->More.dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE);
- This->More.dmiDDrawReserved7.wWidth = This->Global.wWidth;
- This->More.dmiDDrawReserved7.wHeight = This->Global.wHeight;
- //This->More.dmiDDrawReserved7.wBPP = This->owner->Bpp;
- This->More.dmiDDrawReserved7.wBPP = This->Global.dwLinearSize;
-
- This->More.dmiDDrawReserved7.wRefreshRate =
This->owner->mDDrawGlobal.dwMonitorFrequency;
- //This->More.dmiDDrawReserved7.wMonitorsAttachedToDesktop = 2;
- /* ToDo: fill ddsCapsEx */
-
- /* surface local struct */
- memset(&This->Local, 0, sizeof(DDRAWI_DDRAWSURFACE_LCL));
- This->Local.lpGbl = &This->Global;
- This->Local.lpSurfMore = &This->More;
- This->Local.ddsCaps.dwCaps = pDDSD2->ddsCaps.dwCaps;
- This->Local.dwProcessId = This->owner->ExclusiveOwner.dwProcessId;
-
- /* for the double pointer below */
- This->pLocal[0] = &This->Local;
- This->pLocal[1] = NULL;
-
- /* the parameter struct */
- DDHAL_CREATESURFACEDATA CreateData;
- memset(&CreateData, 0, sizeof(DDHAL_CREATESURFACEDATA));
- CreateData.lpDD = &This->owner->mDDrawGlobal;
- CreateData.lpDDSurfaceDesc = (LPDDSURFACEDESC)&This->ddsd;
- CreateData.dwSCnt = 1;
- CreateData.lplpSList = This->pLocal;
- asm("int3");
- CreateData.ddRVal = 1;
-
- /* this is the call we were waiting for */
- if(This->owner->mDDrawGlobal.lpDDCBtmp->HALDD.CreateSurface(&CreateData) ==
DDHAL_DRIVER_NOTHANDLED)
- return DDERR_INVALIDPARAMS;
- asm("int3");
-
- /* FIXME remove the if and debug string*/
- if(CreateData.ddRVal != DD_OK)
- return CreateData.ddRVal;
-
- OutputDebugString(L"This does hit By Ati Readon but not for nvida :( ");
- OutputDebugString(L"Yet ;)");
-
- return DD_OK;
-}
HRESULT Hal_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rDest,
Modified: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/ddra…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/main/ddraw_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/main/ddraw_main.c Sun Apr 2 19:04:09 2006
@@ -43,12 +43,6 @@
RtlCopyMemory(&This->mDDrawGlobal.cObsolete,&"DISPLAY",7);
RtlCopyMemory(&This->mDDrawGlobal.cDriverName,&"DISPLAY",7);
- /* Setup the lpExclusiveOwner struct in msdn this struct member is undoc
- I am using there name to figout which info it should be fild with
- My hardware drv does not support call to SetExusive so I can not
- debug it see how it should be fild
- this part have been move to HAL
- */
// call software first
@@ -254,8 +248,9 @@
That = (IDirectDrawSurfaceImpl*)HeapAlloc(GetProcessHeap(), 0,
sizeof(IDirectDrawSurfaceImpl));
if (That == NULL)
+ {
return E_OUTOFMEMORY;
-
+ }
ZeroMemory(That, sizeof(IDirectDrawSurfaceImpl));
That->lpVtbl = &DirectDrawSurface7_Vtable;
@@ -272,7 +267,9 @@
*ppSurf = (LPDIRECTDRAWSURFACE7)That;
// the real surface object creation
- return That->lpVtbl->Initialize (*ppSurf, (LPDIRECTDRAW)iface, pDDSD);
+ //return That->lpVtbl->Initialize (*ppSurf, (LPDIRECTDRAW)iface, pDDSD);
+
+ return DD_OK;
}
HRESULT WINAPI Main_DirectDraw_CreateClipper(LPDIRECTDRAW7 iface, DWORD dwFlags,
Modified: trunk/reactos/dll/directx/ddraw/main/surface_main.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/surf…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/main/surface_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/main/surface_main.c Sun Apr 2 19:04:09 2006
@@ -11,18 +11,10 @@
#include "rosdraw.h"
+
HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAW
pDD, LPDDSURFACEDESC2 pDDSD2)
{
- IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
-
- /* Call the Hal CreateSurface */
- if (This->owner->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags &
DDHAL_CB32_CREATESURFACE)
- {
- return Hal_DDrawSurface_Initialize (iface, pDD, pDDSD2);
- }
-
- /* Call Hel if Hal of CreateSurface is not supported */
- return Hel_DDrawSurface_Initialize (iface, pDD, pDDSD2);
+ return DDERR_ALREADYINITIALIZED;
}
ULONG WINAPI Main_DDrawSurface_AddRef(LPDIRECTDRAWSURFACE7 iface)
@@ -55,10 +47,10 @@
HRESULT WINAPI Main_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst,
LPDIRECTDRAWSURFACE7 src, LPRECT rsrc, DWORD dwFlags, LPDDBLTFX lpbltfx)
{
- IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
+ IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
- if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_FLIPTOGDISURFACE)
+ if (This->owner->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags &
DDHAL_SURFCB32_BLT)
{
return Hal_DDrawSurface_Blt( iface, rdst, src, rsrc, dwFlags, lpbltfx);
}
@@ -69,7 +61,15 @@
HRESULT WINAPI Main_DDrawSurface_Lock (LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
LPDDSURFACEDESC2 pDDSD, DWORD flags, HANDLE event)
-{
+{ /*
+ IDirectDrawSurfaceImpl* That = (IDirectDrawSurfaceImpl*)iface;
+
+ if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_CREATESURFACE)
+ {
+ return Hal_DDrawSurface_Lock( iiface, LPRECT prect, pDDSD, flags, event);
+ }
+
+ return Hel_DDrawSurface_Lock( iiface, LPRECT prect, pDDSD, flags, event);*/
DX_STUB;
}
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 Apr 2 19:04:09 2006
@@ -121,7 +121,7 @@
HRESULT Hal_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 );
HRESULT Hal_DirectDraw_SetDisplayMode (LPDIRECTDRAW7, DWORD, DWORD, DWORD, DWORD, DWORD
);
HRESULT Hal_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7, LPRECT, LPDIRECTDRAWSURFACE7, LPRECT,
DWORD, LPDDBLTFX );
-HRESULT Hal_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 , LPDIRECTDRAW ,
LPDDSURFACEDESC2 );
+
HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 );
@@ -133,7 +133,7 @@
HRESULT Hel_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 );
HRESULT Hel_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 , DWORD , DWORD ,DWORD , DWORD ,
DWORD );
HRESULT Hel_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7, LPRECT, LPDIRECTDRAWSURFACE7, LPRECT,
DWORD, LPDDBLTFX );
-HRESULT Hel_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 , LPDIRECTDRAW ,
LPDDSURFACEDESC2 );
+
/*********** Macros ***********/
Modified: trunk/reactos/dll/directx/ddraw/soft/surface_hel.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/surf…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/soft/surface_hel.c (original)
+++ trunk/reactos/dll/directx/ddraw/soft/surface_hel.c Sun Apr 2 19:04:09 2006
@@ -10,10 +10,7 @@
#include "rosdraw.h"
-HRESULT Hel_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAW pDD,
LPDDSURFACEDESC2 pDDSD2)
-{
- DX_STUB;
-}
+
HRESULT Hel_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst,
LPDIRECTDRAWSURFACE7 src, LPRECT rsrc, DWORD dwFlags, LPDDBLTFX lpbltfx)