Author: greatlrd
Date: Thu Dec 13 05:02:15 2007
New Revision: 31189
URL:
http://svn.reactos.org/svn/reactos?rev=31189&view=rev
Log:
patch from Kamil Hornicek tykef at atlas dot cz (irc nick : Pigglesworth)
fix one fixme in createsurface.c support more that only dx7 surface in createsurface.c
Modified:
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw.h
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c
trunk/reactos/dll/directx/ddraw/Surface/createsurface.c
trunk/reactos/dll/directx/ddraw/rosdraw.h
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw.h (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw.h Thu Dec 13 05:02:15 2007
@@ -31,10 +31,17 @@
LPUNKNOWN pUnkOuter);
HRESULT WINAPI
+Main_DirectDraw_CreateSurface(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ LPDDSURFACEDESC pDDSD,
+ LPDDRAWI_DDRAWSURFACE_INT *ppSurf,
+ IUnknown *pUnkOuter);
+
+HRESULT WINAPI
Main_DirectDraw_CreateSurface4(
LPDDRAWI_DIRECTDRAW_INT This,
LPDDSURFACEDESC2 pDDSD,
- LPDIRECTDRAWSURFACE7 *ppSurf,
+ LPDDRAWI_DDRAWSURFACE_INT *ppSurf,
IUnknown *pUnkOuter);
HRESULT WINAPI
@@ -209,3 +216,4 @@
DWORD CALLBACK HelDdSurfUpdateOverlay(LPDDHAL_UPDATEOVERLAYDATA lpUpDateOveryLayData);
+
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 Thu Dec 13 05:02:15 2007
@@ -434,7 +434,7 @@
/* For DirectDraw 1 - 3 */
HRESULT WINAPI
Main_DirectDraw_CreateSurface (LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC pDDSD,
- LPDIRECTDRAWSURFACE *ppSurf, IUnknown *pUnkOuter)
+ LPDDRAWI_DDRAWSURFACE_INT *ppSurf, IUnknown *pUnkOuter)
{
HRESULT ret = DDERR_GENERIC;
DDSURFACEDESC2 dd_desc_v2;
@@ -449,7 +449,7 @@
CopyDDSurfDescToDDSurfDesc2(&dd_desc_v2, (LPDDSURFACEDESC)pDDSD);
ret = Internal_CreateSurface(This,
&dd_desc_v2,
- (LPDIRECTDRAWSURFACE7 *)ppSurf,
+ ppSurf,
pUnkOuter);
}
else
@@ -470,14 +470,14 @@
/* For DirectDraw 4 - 7 */
HRESULT WINAPI
Main_DirectDraw_CreateSurface4(LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC2 pDDSD,
- LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown *pUnkOuter)
+ LPDDRAWI_DDRAWSURFACE_INT *ppSurf, IUnknown *pUnkOuter)
{
HRESULT ret;
DX_WINDBG_trace();
// EnterCriticalSection(&ddcs);
_SEH_TRY
{
- ret = Internal_CreateSurface(This, pDDSD, ppSurf,pUnkOuter);
+ ret = Internal_CreateSurface(This, pDDSD, ppSurf, pUnkOuter);
}
_SEH_HANDLE
{
@@ -499,3 +499,4 @@
+
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 Thu Dec 13 05:02:15 2007
@@ -22,7 +22,7 @@
HRESULT
Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD,
- LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown *pUnkOuter)
+ LPDDRAWI_DDRAWSURFACE_INT *ppSurf, IUnknown *pUnkOuter)
{
DDHAL_CANCREATESURFACEDATA mDdCanCreateSurface = { 0 };
DDHAL_CREATESURFACEDATA mDdCreateSurface = { 0 };
@@ -175,8 +175,26 @@
ThisSurfaceGbl->dwLinearSize = pDDSD->lPitch;
}
- /* FIXME set right version */
- ThisSurfInt->lpVtbl = &DirectDrawSurface7_Vtable;
+ if(pDDraw->lpVtbl == &DirectDraw7_Vtable)
+ {
+ ThisSurfInt->lpVtbl = &DirectDrawSurface7_Vtable;
+ }
+ else if(pDDraw->lpVtbl == &DirectDraw4_Vtable)
+ {
+ ThisSurfInt->lpVtbl = &DirectDrawSurface4_Vtable;
+ }
+ else if(pDDraw->lpVtbl == &DirectDraw2_Vtable)
+ {
+ ThisSurfInt->lpVtbl = &DirectDrawSurface2_Vtable;
+ }
+ else if(pDDraw->lpVtbl == &DirectDraw_Vtable)
+ {
+ ThisSurfInt->lpVtbl = &DirectDrawSurface_Vtable;
+ }
+ else
+ {
+ return DDERR_NOTINITIALIZED;
+ }
ThisSurfLcl->lpSurfMore = ThisSurfaceMore;
ThisSurfaceMore->dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE);
@@ -232,7 +250,7 @@
return mDdCreateSurface.ddRVal;
}
- *ppSurf = (LPDIRECTDRAWSURFACE7) &slist_int[0]->lpVtbl;
+ *ppSurf = (LPDDRAWI_DDRAWSURFACE_INT) &slist_int[0]->lpVtbl;
return DD_OK;
}
@@ -248,3 +266,4 @@
+
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 Thu Dec 13 05:02:15 2007
@@ -83,7 +83,7 @@
Internal_CreateSurface(
LPDDRAWI_DIRECTDRAW_INT pDDraw,
LPDDSURFACEDESC2 pDDSD,
- LPDIRECTDRAWSURFACE7 *ppSurf,
+ LPDDRAWI_DDRAWSURFACE_INT *ppSurf,
IUnknown *pUnkOuter);
/* convert DDSURFACEDESC to DDSURFACEDESC2 */