Author: greatlrd
Date: Sat May 12 23:20:54 2007
New Revision: 26738
URL:
http://svn.reactos.org/svn/reactos?rev=26738&view=rev
Log:
commit some bugfix for ddraw createsurface, fixing comping as well
Modified:
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c
trunk/reactos/dll/directx/ddraw/Surface/createsurface.c
trunk/reactos/dll/directx/ddraw/Surface/surface.h
trunk/reactos/dll/directx/ddraw/rosdraw.h
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Sat May 12 23:20:54 2007
@@ -29,6 +29,7 @@
{
/* DirectDraw7 Vtable */
This->lpVtbl = &DirectDraw7_Vtable;
+ This->lpLcl->dwLocalFlags = This->lpLcl->dwLocalFlags +
DDRAWILCL_DIRECTDRAW7;
*obj = &This->lpVtbl;
}
else
@@ -155,11 +156,11 @@
if (pDDSD->dwSize == sizeof(DDSURFACEDESC))
{
- CopyDDSurfDescToDDSurfDesc2(&dd_desc_v2,pDDSD);
+ CopyDDSurfDescToDDSurfDesc2(&dd_desc_v2, (LPDDSURFACEDESC)pDDSD);
}
else if (pDDSD->dwSize == sizeof(DDSURFACEDESC2))
{
- RtlCopyMemory(&dd_desc_v2,pDDSD,sizeof(DDSURFACEDESC2));
+ RtlCopyMemory(&dd_desc_v2, pDDSD,sizeof(DDSURFACEDESC2));
}
else
{
@@ -168,13 +169,13 @@
}
/* check if this process belong to this ddraw */
- if ( dd_int->lcl->dwProcessId != GetCurrentProcessId() )
+ if ( dd_int->lpLcl->dwProcessId != GetCurrentProcessId() )
{
/* FIXME send back right return code */
return DDERR_GENERIC;
}
- ret = internal_CreateSurface(dd_int,dd_desc_v2,ppSurf,pUnkOuter);
+ ret = Internal_CreateSurface(dd_int,&dd_desc_v2, ppSurf,pUnkOuter);
LeaveCriticalSection(&ddcs);
return ret;
Modified: trunk/reactos/dll/directx/ddraw/Surface/createsurface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Surface/…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Surface/createsurface.c (original)
+++ trunk/reactos/dll/directx/ddraw/Surface/createsurface.c Sat May 12 23:20:54 2007
@@ -10,11 +10,19 @@
#include "rosdraw.h"
HRESULT
-Internal_CreateSurface(LPDDRAWI_DIRECTDRAW_INT pDDraw,
- LPDDRAWI_DDRAWSURFACE_LCL *lpLcl,
- LPDDSURFACEDESC2 pDDSD)
-{
- return DDERR_GENERIC;
+Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD,
+ LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown *pUnkOuter)
+{
+ if (!pDDraw->lpLcl->dwLocalFlags & DDRAWILCL_DIRECTDRAW7)
+ {
+ /* it is directdraw 1-6 so no DirectD3D support */
+ }
+ else
+ {
+ /* directdraw 7 support */
+ }
+
+ return DDERR_GENERIC;
}
void CopyDDSurfDescToDDSurfDesc2(LPDDSURFACEDESC2 dst_pDesc, LPDDSURFACEDESC src_pDesc)
Modified: trunk/reactos/dll/directx/ddraw/Surface/surface.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Surface/…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Surface/surface.h (original)
+++ trunk/reactos/dll/directx/ddraw/Surface/surface.h Sat May 12 23:20:54 2007
@@ -71,4 +71,4 @@
HRESULT CreateOverlaySurface(LPDDRAWI_DIRECTDRAW_INT This, LPDDRAWI_DDRAWSURFACE_INT
*That, LPDDSURFACEDESC2 pDDSD);
HRESULT CreateBackBufferSurface(LPDDRAWI_DIRECTDRAW_INT This, LPDDRAWI_DDRAWSURFACE_INT
*That, LPDDRAWI_DDRAWSURFACE_LCL *lpLcl, LPDDSURFACEDESC2 pDDSD);
HRESULT CreatePrimarySurface(LPDDRAWI_DIRECTDRAW_INT This, LPDDRAWI_DDRAWSURFACE_INT
*That,LPDDRAWI_DDRAWSURFACE_LCL *lpLcl, LPDDSURFACEDESC2 pDDSD);
-HRESULT Internal_CreateSurface(LPDDRAWI_DIRECTDRAW_INT, LPDDRAWI_DDRAWSURFACE_LCL*,
LPDDSURFACEDESC2);
+
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 Sat May 12 23:20:54 2007
@@ -24,6 +24,8 @@
HRESULT WINAPI StartDirectDrawHel(LPDIRECTDRAW* iface, BOOL reenable);
HRESULT WINAPI Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface, REFIID id, BOOL
ex);
HRESULT WINAPI ReCreateDirectDraw(LPDIRECTDRAW* iface);
+HRESULT Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD,
+ LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown *pUnkOuter);
/* convert DDSURFACEDESC to DDSURFACEDESC2 */
void CopyDDSurfDescToDDSurfDesc2(LPDDSURFACEDESC2 dst_pDesc, LPDDSURFACEDESC src_pDesc);