Fill some structs more correctly.
Modified: trunk/reactos/lib/ddraw/hal/surface_hal.c
_____
Modified: trunk/reactos/lib/ddraw/hal/surface_hal.c
--- trunk/reactos/lib/ddraw/hal/surface_hal.c 2005-11-05 08:37:01 UTC
(rev 19011)
+++ trunk/reactos/lib/ddraw/hal/surface_hal.c 2005-11-05 10:27:50 UTC
(rev 19012)
@@ -19,7 +19,8 @@
This->owner = (IDirectDrawImpl*)pDD;
- /************ fill the discription of our primary surface
***********************/
+ /************ fill the discription of our primary surface
***********************/
+
memset (&This->ddsd, 0, sizeof(DDSURFACEDESC));
This->ddsd.dwSize = sizeof(DDSURFACEDESC);
@@ -43,6 +44,7 @@
This->ddsd.lpSurface = pDDSD2->lpSurface;
/************ Test see if we can Create Surface
***********************/
+
if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags &
DDHAL_CB32_CANCREATESURFACE)
{
/* can the driver create the surface */
@@ -59,8 +61,6 @@
}
/************ Create Surface ***********************/
-
- /* FIXME we are skipping filling in some data, I do not care for
now */
/* surface global struct */
memset(&This->Global, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL));
@@ -68,21 +68,25 @@
This->Global.wHeight =
This->owner->DirectDrawGlobal.vmiData.dwDisplayHeight;
This->Global.wWidth =
This->owner->DirectDrawGlobal.vmiData.dwDisplayWidth;
This->Global.dwLinearSize =
This->owner->DirectDrawGlobal.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.wRefreshRate = ;
+ //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;
-
-
- /* FIXME do a memcopy */
- This->Local.ddsCaps = *(DDSCAPS*)&This->ddsd.ddsCaps;
+ This->Local.ddsCaps.dwCaps = pDDSD2->ddsCaps.dwCaps;
+ This->Local.dwProcessId = GetCurrentProcessId();
/* for the double pointer below */
This->pLocal[0] = &This->Local;
@@ -92,7 +96,7 @@
DDHAL_CREATESURFACEDATA CreateData;
memset(&CreateData, 0, sizeof(DDHAL_CREATESURFACEDATA));
CreateData.lpDD = &This->owner->DirectDrawGlobal;
- CreateData.lpDDSurfaceDesc = (LPDDSURFACEDESC) &This->ddsd;
+ CreateData.lpDDSurfaceDesc = (LPDDSURFACEDESC)&This->ddsd;
CreateData.dwSCnt = 1;
CreateData.lplpSList = This->pLocal;
CreateData.ddRVal = DD_FALSE;