Implement IDirectDrawSurface::Blt for HAL
Modified: trunk/reactos/lib/ddraw/hal/surface_hal.c
Modified: trunk/reactos/lib/ddraw/main/surface_main.c
Modified: trunk/reactos/lib/ddraw/rosdraw.h

Modified: trunk/reactos/lib/ddraw/hal/surface_hal.c
--- trunk/reactos/lib/ddraw/hal/surface_hal.c	2005-10-30 14:51:12 UTC (rev 18883)
+++ trunk/reactos/lib/ddraw/hal/surface_hal.c	2005-10-30 15:34:03 UTC (rev 18884)
@@ -10,30 +10,31 @@
 
 #include "rosdraw.h"
 
-HRESULT Hal_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst,
-			  LPDIRECTDRAWSURFACE7 src, LPRECT rsrc, DWORD dwFlags, LPDDBLTFX lpbltfx)
+HRESULT Hal_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rDest,
+			  LPDIRECTDRAWSURFACE7 src, LPRECT rSrc, DWORD dwFlags, LPDDBLTFX lpbltfx)
 {
-  
-	DDHAL_BLTDATA BltData;
-    IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
+    IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
+    IDirectDrawSurfaceImpl* That = (IDirectDrawSurfaceImpl*)src;
  	
-	if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.dwFlags  & DDHAL_SURFCB32_BLT)) 
+	if (!(This->owner->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.dwFlags  & DDHAL_SURFCB32_BLT)) 
 	{
 		return DDERR_NODRIVERSUPPORT;
 	}
 
-	BltData.lpDD = &This->DirectDrawGlobal;
-	/* RtlCopyMemory( &BltData.bltFX, lpbltfx,sizeof(DDBLTFX)); */
-	BltData.dwFlags =  dwFlags;
+	DDHAL_BLTDATA BltData;
+	BltData.lpDD = &This->owner->DirectDrawGlobal;
+	BltData.dwFlags = dwFlags;
+	BltData.lpDDDestSurface = This->local;
+    if(rDest) BltData.rDest = *(RECTL*)rDest;
+    if(rSrc) BltData.rSrc = *(RECTL*)rSrc;
+    if(That) BltData.lpDDSrcSurface = That->local;
+	if(lpbltfx) BltData.bltFX = *lpbltfx;
 
-    /* FIXME blt is not complete */
-
-	if (This->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.Blt(&BltData) != DDHAL_DRIVER_HANDLED)
+	if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.Blt(&BltData) != DDHAL_DRIVER_HANDLED)
 	{
 	   return DDERR_NODRIVERSUPPORT;
 	}
 	
 	return BltData.ddRVal;
-
 }
 

Modified: trunk/reactos/lib/ddraw/main/surface_main.c
--- trunk/reactos/lib/ddraw/main/surface_main.c	2005-10-30 14:51:12 UTC (rev 18883)
+++ trunk/reactos/lib/ddraw/main/surface_main.c	2005-10-30 15:34:03 UTC (rev 18884)
@@ -41,38 +41,33 @@
 			return CanCreateData.ddRVal;
 	}
 
-	/* down here we got a crach */
-
 	/* surface global struct */
-	DDRAWI_DDRAWSURFACE_GBL Global;
-	memset(&Global, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL));
-	Global.lpDD = &This->owner->DirectDrawGlobal;	
-	Global.wHeight = This->owner->Height;
-	Global.wWidth = This->owner->Width;
-	Global.dwLinearSize =  Global.wWidth * This->owner->Bpp/8;
+	memset(&This->Global, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL));
+	This->Global.lpDD = &This->owner->DirectDrawThis->Global;	
+	This->Global.wHeight = This->owner->Height;
+	This->Global.wWidth = This->owner->Width;
+	This->Global.dwLinearSize =  This->Global.wWidth * This->owner->Bpp/8;
 	
 	/* surface more struct */
-	DDRAWI_DDRAWSURFACE_MORE More;
-	memset(&More, 0, sizeof(DDRAWI_DDRAWSURFACE_MORE));
-	More.dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE);
+	memset(&This->More, 0, sizeof(DDRAWI_DDRAWSURFACE_MORE));
+	This->More.dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE);
 
 	/* surface local struct */
-	DDRAWI_DDRAWSURFACE_LCL Local;
-	memset(&Local, 0, sizeof(DDRAWI_DDRAWSURFACE_LCL));
-	Local.lpGbl = &Global;
-	Local.lpSurfMore = &More;
-	Local.ddsCaps = *(DDSCAPS*)&pDDSD->ddsCaps;
+	memset(&This->Local, 0, sizeof(DDRAWI_DDRAWSURFACE_LCL));
+	This->Local.lpGbl = &This->Global;
+	This->Local.lpSurfMore = &This->More;
+	This->Local.ddsCaps = *(DDSCAPS*)&pDDSD->ddsCaps;
 
 	/* we need to set some flags if we create the primary surface */
 	if(pDDSD->ddsCaps.dwCaps == DDSCAPS_PRIMARYSURFACE)
 	{
-		Local.dwFlags |= DDRAWISURF_FRONTBUFFER;
-		Global.dwGlobalFlags |= DDRAWISURFGBL_ISGDISURFACE;
+		This->Local.dwFlags |= DDRAWISURF_FRONTBUFFER;
+		This->Global.dwGlobalFlags |= DDRAWISURFGBL_ISGDISURFACE;
 	}
 
 	/* for the double pointer below */
 	DDRAWI_DDRAWSURFACE_LCL *pLocal[2]; 
-	pLocal[0] = &Local; 
+	pLocal[0] = &This->Local; 
     pLocal[1] = NULL;  // we need this one for bad written drivers
 
 	/* the parameter struct */
@@ -84,7 +79,6 @@
 	CreateData.lplpSList = pLocal;	
 	
 	/* this is the call we were waiting for */
-	MessageBox(0,0,0,0);
 	if(This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.CreateSurface(&CreateData) == DDHAL_DRIVER_NOTHANDLED)
 		return DDERR_INVALIDPARAMS;
 	

Modified: trunk/reactos/lib/ddraw/rosdraw.h
--- trunk/reactos/lib/ddraw/rosdraw.h	2005-10-30 14:51:12 UTC (rev 18883)
+++ trunk/reactos/lib/ddraw/rosdraw.h	2005-10-30 15:34:03 UTC (rev 18884)
@@ -41,6 +41,10 @@
 
     LONG ref;
 
+	DDRAWI_DDRAWSURFACE_GBL Global;
+	DDRAWI_DDRAWSURFACE_MORE More;
+	DDRAWI_DDRAWSURFACE_LCL Local;
+
     IDirectDrawImpl* owner;
 
 } IDirectDrawSurfaceImpl;