mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
Implement Main_DDrawSurface_GetAttachedSurface after wine desgin of it
we need rewrite Createsurface and Implement AttahedSurface Thanks to wine code and some wine devloper to expain how it works svn path=/trunk/; revision=23283
This commit is contained in:
parent
c9bdabd39c
commit
3fadd1de23
3 changed files with 67 additions and 6 deletions
|
@ -325,10 +325,10 @@ HRESULT WINAPI Main_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDE
|
|||
|
||||
if (pDDSD->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
|
||||
{
|
||||
memcpy(&That->Surf->mddsdPrimary,pDDSD,sizeof(DDSURFACEDESC));
|
||||
That->Surf->mddsdPrimary.dwSize = sizeof(DDSURFACEDESC);
|
||||
memcpy(&That->Surf->mddsdPrimary,pDDSD,pDDSD->dwSize);
|
||||
That->Surf->mddsdPrimary.dwSize = sizeof(DDSURFACEDESC2);
|
||||
This->mDdCanCreateSurface.bIsDifferentPixelFormat = FALSE;
|
||||
This->mDdCanCreateSurface.lpDDSurfaceDesc = &That->Surf->mddsdPrimary;
|
||||
This->mDdCanCreateSurface.lpDDSurfaceDesc = (DDSURFACEDESC*)&That->Surf->mddsdPrimary;
|
||||
|
||||
if (This->mDdCanCreateSurface.CanCreateSurface(&This->mDdCanCreateSurface)== DDHAL_DRIVER_NOTHANDLED)
|
||||
{
|
||||
|
@ -366,7 +366,7 @@ HRESULT WINAPI Main_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDE
|
|||
|
||||
|
||||
|
||||
This->mDdCreateSurface.lpDDSurfaceDesc = &That->Surf->mddsdPrimary;
|
||||
This->mDdCreateSurface.lpDDSurfaceDesc = (DDSURFACEDESC*)&That->Surf->mddsdPrimary;
|
||||
This->mDdCreateSurface.lplpSList = That->Surf->mpPrimaryLocals;
|
||||
This->mDdCreateSurface.dwSCnt = This->mDDrawGlobal.dsList->dwIntRefCnt ;
|
||||
|
||||
|
|
|
@ -234,9 +234,54 @@ Main_DDrawSurface_GetAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
|
|||
LPDDSCAPS2 pCaps,
|
||||
LPDIRECTDRAWSURFACE7* ppSurface)
|
||||
{
|
||||
IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
|
||||
IDirectDrawSurfaceImpl *surf;
|
||||
DDSCAPS2 our_caps;
|
||||
|
||||
DX_WINDBG_trace();
|
||||
|
||||
DX_STUB;
|
||||
/*
|
||||
Wine Code from wine cvs 27/7-2006
|
||||
with small changes to fith into our ddraw desgin
|
||||
*/
|
||||
|
||||
our_caps = *pCaps;
|
||||
|
||||
/*
|
||||
FIXME adding version check
|
||||
Earlier dx apps put garbage into these members, clear them
|
||||
*/
|
||||
our_caps.dwCaps2 = 0;
|
||||
our_caps.dwCaps3 = 0;
|
||||
our_caps.dwCaps4 = 0;
|
||||
|
||||
surf = This;
|
||||
while( (surf = surf->Surf->next_complex) )
|
||||
{
|
||||
if (((surf->Surf->mddsdPrimary.ddsCaps.dwCaps & our_caps.dwCaps) == our_caps.dwCaps) &&
|
||||
((surf->Surf->mddsdPrimary.ddsCaps.dwCaps2 & our_caps.dwCaps2) == our_caps.dwCaps2))
|
||||
{
|
||||
*ppSurface = (LPDIRECTDRAWSURFACE7)surf;
|
||||
Main_DDrawSurface_AddRef(*ppSurface);
|
||||
return DD_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/* Next, look at the attachment chain */
|
||||
surf = This;
|
||||
|
||||
while( (surf = surf->Surf->next_attached) )
|
||||
{
|
||||
if (((surf->Surf->mddsdPrimary.ddsCaps.dwCaps & our_caps.dwCaps) == our_caps.dwCaps) &&
|
||||
((surf->Surf->mddsdPrimary.ddsCaps.dwCaps2 & our_caps.dwCaps2) == our_caps.dwCaps2))
|
||||
{
|
||||
*ppSurface = (LPDIRECTDRAWSURFACE7)surf;
|
||||
Main_DDrawSurface_AddRef(*ppSurface);
|
||||
return DD_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return DDERR_NOTFOUND;
|
||||
}
|
||||
|
||||
HRESULT WINAPI
|
||||
|
|
|
@ -116,10 +116,26 @@ typedef struct
|
|||
DDRAWI_DDRAWCLIPPER_LCL mPrimaryClipperLocal;
|
||||
DDRAWI_DDRAWCLIPPER_GBL mPrimaryClipperGlobal;
|
||||
|
||||
DDSURFACEDESC mddsdPrimary;
|
||||
DDSURFACEDESC2 mddsdPrimary;
|
||||
|
||||
DDRAWI_DDRAWSURFACE_LCL *mpInUseSurfaceLocals[1];
|
||||
|
||||
/*
|
||||
AttachList We need getting surface pointer
|
||||
of already create surface that have some private
|
||||
data msdn ATTACHLIST can not provide all info
|
||||
we need with our desgin therfor we are using
|
||||
wine desgin for it
|
||||
type IDirectDrawSurfaceImpl;
|
||||
*/
|
||||
LPVOID next_attached;
|
||||
LPVOID first_attached;
|
||||
LPVOID next_complex;
|
||||
LPVOID first_complex;
|
||||
LPVOID next;
|
||||
LPVOID prev;
|
||||
|
||||
/* Need be delete later */
|
||||
DDRAWI_DDRAWSURFACE_GBL mSurfGlobal;
|
||||
DDRAWI_DDRAWSURFACE_MORE mSurfMore;
|
||||
DDRAWI_DDRAWSURFACE_LCL mSurfLocal;
|
||||
|
|
Loading…
Reference in a new issue