Author: greatlrd
Date: Sat Apr 8 13:04:42 2006
New Revision: 21516
URL:
http://svn.reactos.ru/svn/reactos?rev=21516&view=rev
Log:
Implement Surface_GetDC
Modified:
trunk/reactos/dll/directx/ddraw/hal/surface_hal.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 Sat Apr 8 13:04:42 2006
@@ -69,10 +69,13 @@
That->Surf->mPrimaryLocal.ddsCaps.dwCaps =
That->Surf->mddsdPrimary.ddsCaps.dwCaps;
That->Surf->mpPrimaryLocals[0] = &That->Surf->mPrimaryLocal;
+
+
mDdCreateSurface.lpDDSurfaceDesc = &That->Surf->mddsdPrimary;
mDdCreateSurface.lplpSList = That->Surf->mpPrimaryLocals;
mDdCreateSurface.dwSCnt = This->mDDrawGlobal.dsList->dwIntRefCnt ;
+
if (This->mHALInfo.lpDDCallbacks->CreateSurface(&mDdCreateSurface)
== DDHAL_DRIVER_NOTHANDLED)
{
return DDERR_NOTINITIALIZED;
@@ -82,12 +85,15 @@
{
return mDdCreateSurface.ddRVal;
}
+
+
return DD_OK;
}
else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_OVERLAY)
{
+ DX_STUB_str( "Can not create overlay surface");
////memset(&This->mddsdOverlay, 0, sizeof(DDSURFACEDESC));
//memcpy(&This->mddsdOverlay,pDDSD,sizeof(DDSURFACEDESC));
//This->mddsdOverlay.dwSize = sizeof(DDSURFACEDESC);
@@ -208,19 +214,19 @@
}
else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_BACKBUFFER)
{
- DX_STUB;
+ DX_STUB_str( "Can not create backbuffer surface");
}
else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_TEXTURE)
{
- DX_STUB;
+ DX_STUB_str( "Can not create texture surface");
}
else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
{
- DX_STUB;
+ DX_STUB_str( "Can not create zbuffer surface");
}
else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_OFFSCREENPLAIN)
{
- DX_STUB;
+ DX_STUB_str( "Can not create offscreenplain surface");
}
return DDERR_INVALIDSURFACETYPE;
@@ -289,6 +295,7 @@
// This->Surf->mpPrimaryLocals[0]->hDC =
This->owner->mDDrawGlobal.lpExclusiveOwner->hDC;
// FIXME dectect if it clipped or not
+ DX_STUB_str( "Can not create offscreenplain surface");
mDdBlt.IsClipped = FALSE;
if (mDdBlt.Blt(&mDdBlt) != DDHAL_DRIVER_HANDLED)
@@ -304,3 +311,9 @@
return DD_OK;
}
+
+HRESULT Hal_DDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect, LPDDSURFACEDESC2
+ pDDSD, DWORD flags, HANDLE event)
+{
+ DX_STUB;
+}
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 Sat Apr 8 13:04:42 2006
@@ -61,16 +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)
+{
+ IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
+
+ if (This->owner->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags &
DDHAL_CB32_CREATESURFACE)
{
- return Hal_DDrawSurface_Lock( iiface, LPRECT prect, pDDSD, flags, event);
+ return Hal_DDrawSurface_Lock( iface, prect, pDDSD, flags, event);
}
- return Hel_DDrawSurface_Lock( iiface, LPRECT prect, pDDSD, flags, event);*/
- DX_STUB;
+ return Hel_DDrawSurface_Lock( iface, prect, pDDSD, flags, event);
}
HRESULT WINAPI Main_DDrawSurface_Unlock (LPDIRECTDRAWSURFACE7 iface, LPRECT pRect)
@@ -224,7 +223,30 @@
HRESULT WINAPI
Main_DDrawSurface_GetDC(LPDIRECTDRAWSURFACE7 iface, HDC *phDC)
{
- DX_STUB;
+ IDirectDrawSurfaceImpl* This;
+
+ if (iface == NULL)
+ {
+ return DDERR_INVALIDOBJECT;
+ }
+
+ if (phDC == NULL)
+ {
+ return DDERR_INVALIDPARAMS;
+ }
+
+ This = (IDirectDrawSurfaceImpl*)iface;
+
+ if ((HDC)This->Surf->mPrimaryLocal.hDC == NULL)
+ {
+ *phDC = (HDC)This->owner->mDDrawGlobal.lpExclusiveOwner->hDC;
+ }
+ else
+ {
+ *phDC = (HDC)This->Surf->mpPrimaryLocals[0]->hDC;
+ }
+
+ return DD_OK;
}
HRESULT WINAPI
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 Sat Apr 8 13:04:42 2006
@@ -147,7 +147,10 @@
HRESULT Hal_DirectDraw_SetDisplayMode (LPDIRECTDRAW7, DWORD, DWORD, DWORD, DWORD, DWORD
);
HRESULT Hal_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7, LPRECT, LPDIRECTDRAWSURFACE7, LPRECT,
DWORD, LPDDBLTFX );
HRESULT Hal_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD,
IDirectDrawSurfaceImpl *ppSurf, IUnknown *pUnkOuter);
+HRESULT Hal_DDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect, LPDDSURFACEDESC2
pDDSD, DWORD flags, HANDLE event);
+
+
HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 );
HRESULT Hel_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 );
@@ -159,6 +162,7 @@
HRESULT Hel_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 , DWORD , DWORD ,DWORD , DWORD ,
DWORD );
HRESULT Hel_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7, LPRECT, LPDIRECTDRAWSURFACE7, LPRECT,
DWORD, LPDDBLTFX );
HRESULT Hel_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD,
LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown *pUnkOuter);
+HRESULT Hel_DDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect, LPDDSURFACEDESC2
pDDSD, DWORD flags, HANDLE event);
/* Setting for HEL should be move to ros special reg key ? */
@@ -178,4 +182,14 @@
} \
return DDERR_UNSUPPORTED;
+#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; \
+ }
+
#endif /* __DDRAW_PRIVATE */
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 Sat Apr 8 13:04:42 2006
@@ -21,3 +21,12 @@
{
DX_STUB;
}
+
+HRESULT Hel_DDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect, LPDDSURFACEDESC2
+ pDDSD, DWORD flags, HANDLE event)
+{
+ DX_STUB;
+}
+
+
+