Fixed the "header problems".

svn path=/trunk/; revision=18923
This commit is contained in:
Maarten Bosma 2005-11-01 09:50:29 +00:00
parent 1287fda4c9
commit 72d7506aca
2 changed files with 22 additions and 31 deletions

View file

@ -18,38 +18,30 @@ HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIREC
if(sizeof(DDSURFACEDESC2) != pDDSD2->dwSize) if(sizeof(DDSURFACEDESC2) != pDDSD2->dwSize)
return DDERR_UNSUPPORTED; return DDERR_UNSUPPORTED;
This->owner = (IDirectDrawImpl*)pDD; This->owner = (IDirectDrawImpl*)pDD;
/************ fill the discription of our primary surface ***********************/ /************ fill the discription of our primary surface ***********************/
DDSURFACEDESC ddsd; memset (&ddsd, 0, sizeof(DDSURFACEDESC));
memset (&ddsd, 0, sizeof(DDSURFACEDESC)); ddsd.dwSize = sizeof(DDSURFACEDESC);
ddsd.dwSize = sizeof(DDSURFACEDESC);
/* FIXME Fill the rest from ddsd2 to ddsd */
RtlCopyMemory(&ddsd.ddckCKDestBlt,&pDDSD2->ddckCKDestBlt,sizeof(ddsd.ddckCKDestBlt));
RtlCopyMemory(&ddsd.ddckCKDestOverlay,&pDDSD2->ddckCKDestOverlay,sizeof(ddsd.ddckCKDestOverlay));
RtlCopyMemory(&ddsd.ddckCKSrcBlt,&pDDSD2->ddckCKSrcBlt,sizeof(ddsd.ddckCKSrcBlt));
RtlCopyMemory(&ddsd.ddckCKSrcOverlay,&pDDSD2->ddckCKSrcOverlay,sizeof(ddsd.ddckCKSrcOverlay));
RtlCopyMemory(&ddsd.ddpfPixelFormat,&pDDSD2->ddpfPixelFormat,sizeof(ddsd.ddpfPixelFormat));
RtlCopyMemory(&ddsd.ddsCaps,&pDDSD2->ddsCaps,sizeof(ddsd.ddsCaps));
ddsd.dwAlphaBitDepth = pDDSD2->dwAlphaBitDepth;
ddsd.dwBackBufferCount = pDDSD2->dwBackBufferCount;
ddsd.dwFlags = pDDSD2->dwFlags;
ddsd.dwHeight = pDDSD2->dwHeight;
/* FIXME ddsd.dwLinearSize = pDDSD2->dwLinearSize; Problem with our header for dx */
ddsd.dwMipMapCount = pDDSD2->dwMipMapCount;
ddsd.dwRefreshRate = pDDSD2->dwRefreshRate;
ddsd.dwReserved = pDDSD2->dwReserved;
ddsd.dwWidth = pDDSD2->dwWidth;
/* FIXME ddsd.dwZBufferBitDepth where in pDDSD2 */
/* FIXME ddsd.lPitch = pDDSD2->lPitch; Problem with our header for dx */
ddsd.lpSurface = pDDSD2->lpSurface;
RtlCopyMemory(&ddsd.ddckCKDestBlt,&pDDSD2->ddckCKDestBlt,sizeof(ddsd.ddckCKDestBlt));
RtlCopyMemory(&ddsd.ddckCKDestOverlay,&pDDSD2->ddckCKDestOverlay,sizeof(ddsd.ddckCKDestOverlay));
RtlCopyMemory(&ddsd.ddckCKSrcBlt,&pDDSD2->ddckCKSrcBlt,sizeof(ddsd.ddckCKSrcBlt));
RtlCopyMemory(&ddsd.ddckCKSrcOverlay,&pDDSD2->ddckCKSrcOverlay,sizeof(ddsd.ddckCKSrcOverlay));
RtlCopyMemory(&ddsd.ddpfPixelFormat,&pDDSD2->ddpfPixelFormat,sizeof(ddsd.ddpfPixelFormat));
RtlCopyMemory(&ddsd.ddsCaps,&pDDSD2->ddsCaps,sizeof(ddsd.ddsCaps));
ddsd.dwAlphaBitDepth = pDDSD2->dwAlphaBitDepth;
ddsd.dwBackBufferCount = pDDSD2->dwBackBufferCount;
ddsd.dwFlags = pDDSD2->dwFlags;
ddsd.dwHeight = pDDSD2->dwHeight;
ddsd.dwLinearSize = pDDSD2->dwLinearSize;
ddsd.dwMipMapCount = pDDSD2->dwMipMapCount;
ddsd.dwRefreshRate = pDDSD2->dwRefreshRate;
ddsd.dwReserved = pDDSD2->dwReserved;
ddsd.dwWidth = pDDSD2->dwWidth;
ddsd.lPitch = pDDSD2->lPitch;
ddsd.lpSurface = pDDSD2->lpSurface;
/************ Test see if we can Create Surface ***********************/ /************ Test see if we can Create Surface ***********************/
if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_CANCREATESURFACE) if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_CANCREATESURFACE)
@ -67,7 +59,6 @@ HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIREC
return CanCreateData.ddRVal; return CanCreateData.ddRVal;
} }
/************ Create Surface ***********************/ /************ Create Surface ***********************/
/* FIXME we are skipping filling in some data, I do not care for now */ /* FIXME we are skipping filling in some data, I do not care for now */
@ -109,8 +100,7 @@ HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIREC
CreateData.lpDDSurfaceDesc = (LPDDSURFACEDESC) &ddsd; CreateData.lpDDSurfaceDesc = (LPDDSURFACEDESC) &ddsd;
CreateData.dwSCnt = 1; CreateData.dwSCnt = 1;
CreateData.lplpSList = pLocal; CreateData.lplpSList = pLocal;
CreateData.ddRVal = DD_FALSE; CreateData.ddRVal = DD_FALSE;
/* this is the call we were waiting for */ /* this is the call we were waiting for */
if(This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.CreateSurface(&CreateData) == DDHAL_DRIVER_NOTHANDLED) if(This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.CreateSurface(&CreateData) == DDHAL_DRIVER_NOTHANDLED)

View file

@ -45,6 +45,7 @@ typedef struct
DDRAWI_DDRAWSURFACE_MORE More; DDRAWI_DDRAWSURFACE_MORE More;
DDRAWI_DDRAWSURFACE_LCL Local; DDRAWI_DDRAWSURFACE_LCL Local;
DDRAWI_DDRAWSURFACE_LCL *pLocal[2]; DDRAWI_DDRAWSURFACE_LCL *pLocal[2];
DDSURFACEDESC ddsd;
} IDirectDrawSurfaceImpl; } IDirectDrawSurfaceImpl;