From 725057da47c9062483f3d4373b39f574bb78dbce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 14 Apr 2007 22:44:55 +0200 Subject: [PATCH] d3d: Remove dependency on ddraw.h header. --- dlls/d3d8/d3d8_private.h | 1 - dlls/d3d8/device.c | 6 +- dlls/d3d9/d3d9_private.h | 1 - dlls/d3d9/device.c | 2 +- dlls/ddraw/ddraw.c | 21 +-- dlls/ddraw/surface.c | 85 ++++++++--- dlls/wined3d/device.c | 6 +- dlls/wined3d/directx.c | 2 +- dlls/wined3d/palette.c | 16 +-- dlls/wined3d/query.c | 2 +- dlls/wined3d/state.c | 4 +- dlls/wined3d/surface.c | 135 ++++++++--------- dlls/wined3d/surface_gdi.c | 116 +++++++-------- dlls/wined3d/swapchain.c | 2 +- dlls/wined3d/wined3d_private.h | 15 +- include/wine/wined3d_interface.h | 19 ++- include/wine/wined3d_types.h | 239 ++++++++++++++++++++++++++----- 17 files changed, 448 insertions(+), 224 deletions(-) diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h index 6ec3f186c00..a86867c49e4 100644 --- a/dlls/d3d8/d3d8_private.h +++ b/dlls/d3d8/d3d8_private.h @@ -33,7 +33,6 @@ #include "wingdi.h" #include "wine/debug.h" #include "d3d8.h" -#include "ddraw.h" #include "wine/wined3d_interface.h" /* Device caps */ diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 9e05a517303..71de0173a80 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -661,17 +661,17 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(LPDIRECT3DDEVICE8 iface, ID /* Quick if complete copy ... */ if (cRects == 0 && pSourceRects == NULL && pDestPoints == NULL) { - IWineD3DSurface_BltFast(Dest->wineD3DSurface, 0, 0, Source->wineD3DSurface, NULL, DDBLTFAST_NOCOLORKEY); + IWineD3DSurface_BltFast(Dest->wineD3DSurface, 0, 0, Source->wineD3DSurface, NULL, WINEDDBLTFAST_NOCOLORKEY); } else { unsigned int i; /* Copy rect by rect */ if (NULL != pSourceRects && NULL != pDestPoints) { for (i = 0; i < cRects; ++i) { - IWineD3DSurface_BltFast(Dest->wineD3DSurface, pDestPoints[i].x, pDestPoints[i].y, Source->wineD3DSurface, (RECT *) &pSourceRects[i], DDBLTFAST_NOCOLORKEY); + IWineD3DSurface_BltFast(Dest->wineD3DSurface, pDestPoints[i].x, pDestPoints[i].y, Source->wineD3DSurface, (RECT *) &pSourceRects[i], WINEDDBLTFAST_NOCOLORKEY); } } else { for (i = 0; i < cRects; ++i) { - IWineD3DSurface_BltFast(Dest->wineD3DSurface, 0, 0, Source->wineD3DSurface, (RECT *) &pSourceRects[i], DDBLTFAST_NOCOLORKEY); + IWineD3DSurface_BltFast(Dest->wineD3DSurface, 0, 0, Source->wineD3DSurface, (RECT *) &pSourceRects[i], WINEDDBLTFAST_NOCOLORKEY); } } } diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index 972945d1e45..cef1c1f0f46 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -36,7 +36,6 @@ #include "wine/unicode.h" #include "d3d9.h" -#include "ddraw.h" #include "wine/wined3d_interface.h" /* =========================================================================== diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 8fc75117b3c..48e3b0decb7 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -366,7 +366,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTargetData(LPDIRECT3DDEVIC IDirect3DSurface9Impl *renderTarget = (IDirect3DSurface9Impl *)pRenderTarget; IDirect3DSurface9Impl *destSurface = (IDirect3DSurface9Impl *)pDestSurface; TRACE("(%p)->(%p,%p)\n" , This, renderTarget, destSurface); - return IWineD3DSurface_BltFast(destSurface->wineD3DSurface, 0, 0, renderTarget->wineD3DSurface, NULL, DDBLTFAST_NOCOLORKEY); + return IWineD3DSurface_BltFast(destSurface->wineD3DSurface, 0, 0, renderTarget->wineD3DSurface, NULL, WINEDDBLTFAST_NOCOLORKEY); } static HRESULT WINAPI IDirect3DDevice9Impl_GetFrontBufferData(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSurface9* pDestSurface) { diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 4255adb9e9a..e59a7ee3773 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -557,6 +557,7 @@ IDirectDrawImpl_SetDisplayMode(IDirectDraw7 *iface, { ICOM_THIS_FROM(IDirectDrawImpl, IDirectDraw7, iface); WINED3DDISPLAYMODE Mode; + HRESULT hr; TRACE("(%p)->(%d,%d,%d,%d,%x: Relay!\n", This, Width, Height, BPP, RefreshRate, Flags); if( !Width || !Height ) @@ -593,10 +594,14 @@ IDirectDrawImpl_SetDisplayMode(IDirectDraw7 *iface, */ /* TODO: Lose the primary surface */ - return IWineD3DDevice_SetDisplayMode(This->wineD3DDevice, - 0, /* First swapchain */ - &Mode); - + hr = IWineD3DDevice_SetDisplayMode(This->wineD3DDevice, + 0, /* First swapchain */ + &Mode); + switch(hr) + { + case WINED3DERR_NOTAVAILABLE: return DDERR_INVALIDMODE; + default: return hr; + }; } /***************************************************************************** @@ -1895,25 +1900,25 @@ IDirectDrawImpl_CreateNewSurface(IDirectDrawImpl *This, { IWineD3DSurface_SetColorKey((*ppSurf)->WineD3DSurface, DDCKEY_DESTOVERLAY, - &pDDSD->u3.ddckCKDestOverlay); + (WINEDDCOLORKEY *) &pDDSD->u3.ddckCKDestOverlay); } if(pDDSD->dwFlags & DDSD_CKDESTBLT) { IWineD3DSurface_SetColorKey((*ppSurf)->WineD3DSurface, DDCKEY_DESTBLT, - &pDDSD->ddckCKDestBlt); + (WINEDDCOLORKEY *) &pDDSD->ddckCKDestBlt); } if(pDDSD->dwFlags & DDSD_CKSRCOVERLAY) { IWineD3DSurface_SetColorKey((*ppSurf)->WineD3DSurface, DDCKEY_SRCOVERLAY, - &pDDSD->ddckCKSrcOverlay); + (WINEDDCOLORKEY *) &pDDSD->ddckCKSrcOverlay); } if(pDDSD->dwFlags & DDSD_CKSRCBLT) { IWineD3DSurface_SetColorKey((*ppSurf)->WineD3DSurface, DDCKEY_SRCBLT, - &pDDSD->ddckCKSrcBlt); + (WINEDDCOLORKEY *) &pDDSD->ddckCKSrcBlt); } if ( pDDSD->dwFlags & DDSD_LPSURFACE) { diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 13f5d4d20cb..e374f983e8f 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -693,6 +693,7 @@ IDirectDrawSurfaceImpl_Blt(IDirectDrawSurface7 *iface, DDBLTFX *DDBltFx) { ICOM_THIS_FROM(IDirectDrawSurfaceImpl, IDirectDrawSurface7, iface); + HRESULT hr; IDirectDrawSurfaceImpl *Src = ICOM_OBJECT(IDirectDrawSurfaceImpl, IDirectDrawSurface7, SrcSurface); TRACE("(%p)->(%p,%p,%p,%x,%p)\n", This, DestRect, Src, SrcRect, Flags, DDBltFx); @@ -714,13 +715,23 @@ IDirectDrawSurfaceImpl_Blt(IDirectDrawSurface7 *iface, return DDERR_INVALIDPARAMS; } - return IWineD3DSurface_Blt(This->WineD3DSurface, - DestRect, - Src ? Src->WineD3DSurface : NULL, - SrcRect, - Flags, - DDBltFx, - WINED3DTEXF_NONE); + /* TODO: Check if the DDBltFx contains any ddraw surface pointers. If it does, copy the struct, + * and replace the ddraw surfaces with the wined3d surfaces + * So far no blitting operations using surfaces in the bltfx struct are supported anyway. + */ + hr = IWineD3DSurface_Blt(This->WineD3DSurface, + DestRect, + Src ? Src->WineD3DSurface : NULL, + SrcRect, + Flags, + (WINEDDBLTFX *) DDBltFx, + WINED3DTEXF_NONE); + switch(hr) + { + case WINED3DERR_NOTAVAILABLE: return DDERR_UNSUPPORTED; + case WINED3DERR_WRONGTEXTUREFORMAT: return DDERR_INVALIDPIXELFORMAT; + default: return hr; + } } /***************************************************************************** @@ -1283,9 +1294,15 @@ IDirectDrawSurfaceImpl_GetBltStatus(IDirectDrawSurface7 *iface, DWORD Flags) { ICOM_THIS_FROM(IDirectDrawSurfaceImpl, IDirectDrawSurface7, iface); + HRESULT hr; TRACE("(%p)->(%x): Relay\n", This, Flags); - return IWineD3DSurface_GetBltStatus(This->WineD3DSurface, Flags); + hr = IWineD3DSurface_GetBltStatus(This->WineD3DSurface, Flags); + switch(hr) + { + case WINED3DERR_INVALIDCALL: return DDERR_INVALIDPARAMS; + default: return hr; + } } /***************************************************************************** @@ -1358,9 +1375,15 @@ IDirectDrawSurfaceImpl_GetFlipStatus(IDirectDrawSurface7 *iface, DWORD Flags) { ICOM_THIS_FROM(IDirectDrawSurfaceImpl, IDirectDrawSurface7, iface); + HRESULT hr; TRACE("(%p)->(%x): Relay\n", This, Flags); - return IWineD3DSurface_GetFlipStatus(This->WineD3DSurface, Flags); + hr = IWineD3DSurface_GetFlipStatus(This->WineD3DSurface, Flags); + switch(hr) + { + case WINED3DERR_INVALIDCALL: return DDERR_INVALIDPARAMS; + default: return hr; + } } /***************************************************************************** @@ -1497,6 +1520,7 @@ static HRESULT WINAPI IDirectDrawSurfaceImpl_IsLost(IDirectDrawSurface7 *iface) { ICOM_THIS_FROM(IDirectDrawSurfaceImpl, IDirectDrawSurface7, iface); + HRESULT hr; TRACE("(%p)\n", This); /* We lose the surface if the implementation was changed */ @@ -1510,7 +1534,15 @@ IDirectDrawSurfaceImpl_IsLost(IDirectDrawSurface7 *iface) return DDERR_SURFACELOST; } - return IWineD3DSurface_IsLost(This->WineD3DSurface); + hr = IWineD3DSurface_IsLost(This->WineD3DSurface); + switch(hr) + { + /* D3D8 and 9 loose full devices, thus there's only a DEVICELOST error. + * WineD3D uses the same error for surfaces + */ + case WINED3DERR_DEVICELOST: return DDERR_SURFACELOST; + default: return hr; + } } /***************************************************************************** @@ -1825,14 +1857,21 @@ IDirectDrawSurfaceImpl_BltFast(IDirectDrawSurface7 *iface, DWORD trans) { ICOM_THIS_FROM(IDirectDrawSurfaceImpl, IDirectDrawSurface7, iface); + HRESULT hr; IDirectDrawSurfaceImpl *src = ICOM_OBJECT(IDirectDrawSurfaceImpl, IDirectDrawSurface7, Source); TRACE("(%p)->(%d,%d,%p,%p,%d): Relay\n", This, dstx, dsty, Source, rsrc, trans); - return IWineD3DSurface_BltFast(This->WineD3DSurface, - dstx, dsty, - src ? src->WineD3DSurface : NULL, - rsrc, - trans); + hr = IWineD3DSurface_BltFast(This->WineD3DSurface, + dstx, dsty, + src ? src->WineD3DSurface : NULL, + rsrc, + trans); + switch(hr) + { + case WINED3DERR_NOTAVAILABLE: return DDERR_UNSUPPORTED; + case WINED3DERR_WRONGTEXTUREFORMAT: return DDERR_INVALIDPIXELFORMAT; + default: return hr; + } } /***************************************************************************** @@ -1956,25 +1995,25 @@ IDirectDrawSurfaceImpl_SetSurfaceDesc(IDirectDrawSurface7 *iface, { IWineD3DSurface_SetColorKey(This->WineD3DSurface, DDCKEY_DESTOVERLAY, - &DDSD->u3.ddckCKDestOverlay); + (WINEDDCOLORKEY *) &DDSD->u3.ddckCKDestOverlay); } if (DDSD->dwFlags & DDSD_CKDESTBLT) { IWineD3DSurface_SetColorKey(This->WineD3DSurface, DDCKEY_DESTBLT, - &DDSD->ddckCKDestBlt); + (WINEDDCOLORKEY *) &DDSD->ddckCKDestBlt); } if (DDSD->dwFlags & DDSD_CKSRCOVERLAY) { IWineD3DSurface_SetColorKey(This->WineD3DSurface, DDCKEY_SRCOVERLAY, - &DDSD->ddckCKSrcOverlay); + (WINEDDCOLORKEY *) &DDSD->ddckCKSrcOverlay); } if (DDSD->dwFlags & DDSD_CKSRCBLT) { IWineD3DSurface_SetColorKey(This->WineD3DSurface, DDCKEY_SRCBLT, - &DDSD->ddckCKSrcBlt); + (WINEDDCOLORKEY *) &DDSD->ddckCKSrcBlt); } if (DDSD->dwFlags & DDSD_LPSURFACE) { @@ -2115,12 +2154,16 @@ IDirectDrawSurfaceImpl_SetColorKey(IDirectDrawSurface7 *iface, { hr = IWineD3DSurface_SetColorKey(surf->WineD3DSurface, Flags, - CKey); + (WINEDDCOLORKEY *) CKey); if(FAILED(hr)) { WARN("IWineD3DSurface::SetColorKey for surface %p failed with hr=%08x\n", surf->WineD3DSurface, hr); - return hr; + switch(hr) + { + case WINED3DERR_INVALIDCALL: return DDERR_INVALIDPARAMS; + default: return hr; + } } } return DD_OK; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 8153fb7887b..51fcfb3ec04 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1916,7 +1916,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDisplayMode(IWineD3DDevice *iface, U ret = ChangeDisplaySettingsExW(NULL, &devmode, NULL, CDS_FULLSCREEN, NULL) != DISP_CHANGE_SUCCESSFUL; } if(ret != DISP_CHANGE_SUCCESSFUL) { - return DDERR_INVALIDMODE; + return WINED3DERR_NOTAVAILABLE; } } @@ -4972,7 +4972,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DeletePatch(IWineD3DDevice *iface, UINT static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface, IWineD3DSurface *pSurface, CONST WINED3DRECT* pRect, WINED3DCOLOR color) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *) pSurface; - DDBLTFX BltFx; + WINEDDBLTFX BltFx; TRACE("(%p) Colour fill Surface: %p rect: %p color: %d\n", This, pSurface, pRect, color); if (surface->resource.pool != WINED3DPOOL_DEFAULT && surface->resource.pool != WINED3DPOOL_SYSTEMMEM) { @@ -4984,7 +4984,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface, IWineD memset(&BltFx, 0, sizeof(BltFx)); BltFx.dwSize = sizeof(BltFx); BltFx.u5.dwFillColor = color; - return IWineD3DSurface_Blt(pSurface, (RECT *) pRect, NULL, NULL, DDBLT_COLORFILL, &BltFx, WINED3DTEXF_NONE); + return IWineD3DSurface_Blt(pSurface, (RECT *) pRect, NULL, NULL, WINEDDBLT_COLORFILL, &BltFx, WINED3DTEXF_NONE); } /* rendertarget and deptth stencil functions */ diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 8f9998c06c2..3f72a479328 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1836,7 +1836,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt * * With Shader Model 3.0 capable cards Instancing 'just works' in Windows. */ - case MAKEFOURCC('I','N','S','T'): + case WINEMAKEFOURCC('I','N','S','T'): TRACE("ATI Instancing check hack\n"); if(GL_SUPPORT(ARB_VERTEX_PROGRAM) || GL_SUPPORT(ARB_VERTEX_SHADER)) { TRACE_(d3d_caps)("[OK]\n"); diff --git a/dlls/wined3d/palette.c b/dlls/wined3d/palette.c index 43c942f944b..a1dcc9f95f7 100644 --- a/dlls/wined3d/palette.c +++ b/dlls/wined3d/palette.c @@ -29,7 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); -#define SIZE_BITS (DDPCAPS_1BIT | DDPCAPS_2BIT | DDPCAPS_4BIT | DDPCAPS_8BIT) +#define SIZE_BITS (WINEDDPCAPS_1BIT | WINEDDPCAPS_2BIT | WINEDDPCAPS_4BIT | WINEDDPCAPS_8BIT) static HRESULT WINAPI IWineD3DPaletteImpl_QueryInterface(IWineD3DPalette *iface, REFIID refiid, void **obj) { IWineD3DPaletteImpl *This = (IWineD3DPaletteImpl *)iface; @@ -73,10 +73,10 @@ static ULONG WINAPI IWineD3DPaletteImpl_Release(IWineD3DPalette *iface) { /* Not called from the vtable */ DWORD IWineD3DPaletteImpl_Size(DWORD dwFlags) { switch (dwFlags & SIZE_BITS) { - case DDPCAPS_1BIT: return 2; - case DDPCAPS_2BIT: return 4; - case DDPCAPS_4BIT: return 16; - case DDPCAPS_8BIT: return 256; + case WINEDDPCAPS_1BIT: return 2; + case WINEDDPCAPS_2BIT: return 4; + case WINEDDPCAPS_4BIT: return 16; + case WINEDDPCAPS_8BIT: return 256; default: assert(0); return 256; } } @@ -90,7 +90,7 @@ static HRESULT WINAPI IWineD3DPaletteImpl_GetEntries(IWineD3DPalette *iface, DW if (Start + Count > IWineD3DPaletteImpl_Size(This->Flags)) return WINED3DERR_INVALIDCALL; - if (This->Flags & DDPCAPS_8BITENTRIES) + if (This->Flags & WINEDDPCAPS_8BITENTRIES) { unsigned int i; LPBYTE entry = (LPBYTE)PalEnt; @@ -111,7 +111,7 @@ static HRESULT WINAPI IWineD3DPaletteImpl_SetEntries(IWineD3DPalette *iface, DW TRACE("(%p)->(%08x,%d,%d,%p)\n",This,Flags,Start,Count,PalEnt); - if (This->Flags & DDPCAPS_8BITENTRIES) { + if (This->Flags & WINEDDPCAPS_8BITENTRIES) { unsigned int i; const BYTE* entry = (const BYTE*)PalEnt; @@ -143,7 +143,7 @@ static HRESULT WINAPI IWineD3DPaletteImpl_SetEntries(IWineD3DPalette *iface, DW } /* If the palette is the primary palette, set the entries to the device */ - if(This->Flags & DDPCAPS_PRIMARYSURFACE) { + if(This->Flags & WINEDDPCAPS_PRIMARYSURFACE) { unsigned int i; IWineD3DDeviceImpl *device = This->wineD3DDevice; PALETTEENTRY *entry = PalEnt; diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c index 10f5c6d26e2..9e6e3241673 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -125,7 +125,7 @@ static HRESULT WINAPI IWineD3DQueryImpl_GetData(IWineD3DQuery* iface, void* pDa WINED3DDEVINFO_VCACHE *data = (WINED3DDEVINFO_VCACHE *)pData; FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_VCACHE\n", This); - data->Pattern = MAKEFOURCC('C','A','C','H'); + data->Pattern = WINEMAKEFOURCC('C','A','C','H'); data->OptMethod = 0; /*0 get longest strips, 1 optimize vertex cache*/ data->CacheSize = 0; /*cache size, only required if OptMethod == 1*/ data->MagicNumber = 0; /*only required if OptMethod == 1 (used internally)*/ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index cd60841cc4a..c8a315034a7 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -348,7 +348,7 @@ static void state_alpha(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D if(stateblock->textures[0] && stateblock->textureDimensions[0] == GL_TEXTURE_2D) { surf = (IWineD3DSurfaceImpl *) ((IWineD3DTextureImpl *)stateblock->textures[0])->surfaces[0]; - if(surf->CKeyFlags & DDSD_CKSRCBLT) { + if(surf->CKeyFlags & WINEDDSD_CKSRCBLT) { const PixelFormatDesc *fmt = getFormatDescEntry(surf->resource.format); /* The surface conversion does not do color keying conversion for surfaces that have an alpha * channel on their own. Likewise, the alpha test shouldn't be set up for color keying if the @@ -1711,7 +1711,7 @@ static void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D stateblock->textures[0] && stateblock->textureDimensions[0] == GL_TEXTURE_2D) { IWineD3DSurfaceImpl *surf = (IWineD3DSurfaceImpl *) ((IWineD3DTextureImpl *) stateblock->textures[0])->surfaces[0]; - if(surf->CKeyFlags & DDSD_CKSRCBLT && + if(surf->CKeyFlags & WINEDDSD_CKSRCBLT && getFormatDescEntry(surf->resource.format)->alphaMask == 0x00000000) { /* Color keying needs to pass alpha values from the texture through to have the alpha test work properly. diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 6e090725595..117c4576e7b 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1273,12 +1273,12 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC) { if(This->Flags & SFLAG_USERPTR) { ERR("Not supported on surfaces with an application-provided surfaces\n"); - return DDERR_NODC; + return WINEDDERR_NODC; } /* Give more detailed info for ddraw */ if (This->Flags & SFLAG_DCINUSE) - return DDERR_DCALREADYCREATED; + return WINEDDERR_DCALREADYCREATED; /* Can't GetDC if the surface is locked */ if (This->Flags & SFLAG_LOCKED) @@ -1486,7 +1486,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC hDC) { ****************************************************** */ static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_texturing, GLenum *format, GLenum *internal, GLenum *type, CONVERT_TYPES *convert, int *target_bpp) { - BOOL colorkey_active = need_alpha_ck && (This->CKeyFlags & DDSD_CKSRCBLT); + BOOL colorkey_active = need_alpha_ck && (This->CKeyFlags & WINEDDSD_CKSRCBLT); const PixelFormatDesc *formatEntry = getFormatDescEntry(This->resource.format); /* Default values: From the surface */ @@ -1855,11 +1855,11 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) { if (!(This->Flags & SFLAG_INTEXTURE)) { TRACE("Reloading because surface is dirty\n"); } else if(/* Reload: gl texture has ck, now no ckey is set OR */ - ((This->Flags & SFLAG_GLCKEY) && (!(This->CKeyFlags & DDSD_CKSRCBLT))) || + ((This->Flags & SFLAG_GLCKEY) && (!(This->CKeyFlags & WINEDDSD_CKSRCBLT))) || /* Reload: vice versa OR */ - ((!(This->Flags & SFLAG_GLCKEY)) && (This->CKeyFlags & DDSD_CKSRCBLT)) || + ((!(This->Flags & SFLAG_GLCKEY)) && (This->CKeyFlags & WINEDDSD_CKSRCBLT)) || /* Also reload: Color key is active AND the color key has changed */ - ((This->CKeyFlags & DDSD_CKSRCBLT) && ( + ((This->CKeyFlags & WINEDDSD_CKSRCBLT) && ( (This->glCKey.dwColorSpaceLowValue != This->SrcBltCKey.dwColorSpaceLowValue) || (This->glCKey.dwColorSpaceHighValue != This->SrcBltCKey.dwColorSpaceHighValue)))) { TRACE("Reloading because of color keying\n"); @@ -1929,7 +1929,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) { /* Otherwise: System memory copy must be most up to date */ - if(This->CKeyFlags & DDSD_CKSRCBLT) { + if(This->CKeyFlags & WINEDDSD_CKSRCBLT) { This->Flags |= SFLAG_GLCKEY; This->glCKey = This->SrcBltCKey; } @@ -2315,7 +2315,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Flip(IWineD3DSurface *iface, IWineD3DS TRACE("(%p)->(%p,%x)\n", This, override, Flags); /* Flipping is only supported on RenderTargets */ - if( !(This->resource.usage & WINED3DUSAGE_RENDERTARGET) ) return DDERR_NOTFLIPPABLE; + if( !(This->resource.usage & WINED3DUSAGE_RENDERTARGET) ) return WINEDDERR_NOTFLIPPABLE; if(override) { /* DDraw sets this for the X11 surfaces, so don't confuse the user @@ -2599,7 +2599,7 @@ static inline void fb_copy_to_texture_hwstretch(IWineD3DSurfaceImpl *This, IWine } /* Not called from the VTable */ -static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, DDBLTFX *DDBltFx, WINED3DTEXTUREFILTERTYPE Filter) { +static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, WINEDDBLTFX *DDBltFx, WINED3DTEXTUREFILTERTYPE Filter) { WINED3DRECT rect; IWineD3DDeviceImpl *myDevice = This->resource.wineD3DDevice; IWineD3DSwapChainImpl *srcSwapchain = NULL, *dstSwapchain = NULL; @@ -2624,7 +2624,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * } /* No destination color keying supported */ - if(Flags & (DDBLT_KEYDEST | DDBLT_KEYDESTOVERRIDE)) { + if(Flags & (WINEDDBLT_KEYDEST | WINEDDBLT_KEYDESTOVERRIDE)) { /* Can we support that with glBlendFunc if blitting to the frame buffer? */ TRACE("Destination color key not supported in accelerated Blit, falling back to software\n"); return WINED3DERR_INVALIDCALL; @@ -2666,7 +2666,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * (This->currentDesc.Height == Src->currentDesc.Height)) { /* These flags are unimportant for the flag check, remove them */ - if((Flags & ~(DDBLT_DONOTWAIT | DDBLT_WAIT)) == 0) { + if((Flags & ~(WINEDDBLT_DONOTWAIT | WINEDDBLT_WAIT)) == 0) { if( dstSwapchain->backBuffer && ((IWineD3DSurface *) This == dstSwapchain->frontBuffer) && SrcSurface == dstSwapchain->backBuffer[0] ) { @@ -2710,7 +2710,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * WINED3DRECT srect; BOOL upsideDown, stretchx; - if(Flags & (DDBLT_KEYSRC | DDBLT_KEYSRCOVERRIDE)) { + if(Flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE)) { TRACE("Color keying not supported by frame buffer to texture blit\n"); return WINED3DERR_INVALIDCALL; /* Destination color key is checked above */ @@ -2806,7 +2806,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * /* Blit from offscreen surface to render target */ float glTexCoord[4]; DWORD oldCKeyFlags = Src->CKeyFlags; - DDCOLORKEY oldBltCKey = This->SrcBltCKey; + WINEDDCOLORKEY oldBltCKey = This->SrcBltCKey; RECT SourceRectangle; TRACE("Blt from surface %p to rendertarget %p\n", Src, This); @@ -2838,15 +2838,15 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * * The surface keeps track of the color key last used to load the opengl surface. * PreLoad will catch the change to the flags and color key and reload if neccessary. */ - if(Flags & DDBLT_KEYSRC) { + if(Flags & WINEDDBLT_KEYSRC) { /* Use color key from surface */ - } else if(Flags & DDBLT_KEYSRCOVERRIDE) { + } else if(Flags & WINEDDBLT_KEYSRCOVERRIDE) { /* Use color key from DDBltFx */ - Src->CKeyFlags |= DDSD_CKSRCBLT; + Src->CKeyFlags |= WINEDDSD_CKSRCBLT; This->SrcBltCKey = DDBltFx->ddckSrcColorkey; } else { /* Do not use color key */ - Src->CKeyFlags &= ~DDSD_CKSRCBLT; + Src->CKeyFlags &= ~WINEDDSD_CKSRCBLT; } /* Now load the surface */ @@ -2887,7 +2887,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * checkGLcall("glTexEnvi"); /* This is for color keying */ - if(Flags & (DDBLT_KEYSRC | DDBLT_KEYSRCOVERRIDE)) { + if(Flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE)) { glEnable(GL_ALPHA_TEST); checkGLcall("glEnable GL_ALPHA_TEST"); glAlphaFunc(GL_NOTEQUAL, 0.0); @@ -2922,7 +2922,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * glEnd(); checkGLcall("glEnd"); - if(Flags & (DDBLT_KEYSRC | DDBLT_KEYSRCOVERRIDE)) { + if(Flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE)) { glDisable(GL_ALPHA_TEST); checkGLcall("glDisable(GL_ALPHA_TEST)"); } @@ -2958,7 +2958,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * return WINED3D_OK; } else { /* Source-Less Blit to render target */ - if (Flags & DDBLT_COLORFILL) { + if (Flags & WINEDDBLT_COLORFILL) { /* This is easy to handle for the D3D Device... */ DWORD color; @@ -3041,7 +3041,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * return WINED3DERR_INVALIDCALL; } -static HRESULT WINAPI IWineD3DSurfaceImpl_Blt(IWineD3DSurface *iface, RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, DDBLTFX *DDBltFx, WINED3DTEXTUREFILTERTYPE Filter) { +static HRESULT WINAPI IWineD3DSurfaceImpl_Blt(IWineD3DSurface *iface, RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, WINEDDBLTFX *DDBltFx, WINED3DTEXTUREFILTERTYPE Filter) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; IWineD3DSurfaceImpl *Src = (IWineD3DSurfaceImpl *) SrcSurface; IWineD3DDeviceImpl *myDevice = This->resource.wineD3DDevice; @@ -3075,12 +3075,12 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetBltStatus(IWineD3DSurface *iface, DWORD Fl switch (Flags) { - case DDGBS_CANBLT: - case DDGBS_ISBLTDONE: - return DD_OK; + case WINEDDGBS_CANBLT: + case WINEDDGBS_ISBLTDONE: + return WINED3D_OK; default: - return DDERR_INVALIDPARAMS; + return WINED3DERR_INVALIDCALL; } } @@ -3089,12 +3089,12 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetFlipStatus(IWineD3DSurface *iface, DWORD F TRACE("(%p)->(%08x)\n",iface,Flags); switch (Flags) { - case DDGFS_CANFLIP: - case DDGFS_ISFLIPDONE: - return DD_OK; + case WINEDDGFS_CANFLIP: + case WINEDDGFS_ISFLIPDONE: + return WINED3D_OK; default: - return DDERR_INVALIDPARAMS; + return WINED3DERR_INVALIDCALL; } } @@ -3102,7 +3102,8 @@ HRESULT WINAPI IWineD3DSurfaceImpl_IsLost(IWineD3DSurface *iface) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; TRACE("(%p)\n", This); - return This->Flags & SFLAG_LOST ? DDERR_SURFACELOST : WINED3D_OK; + /* D3D8 and 9 loose full devices, ddraw only surfaces */ + return This->Flags & SFLAG_LOST ? WINED3DERR_DEVICELOST : WINED3D_OK; } HRESULT WINAPI IWineD3DSurfaceImpl_Restore(IWineD3DSurface *iface) { @@ -3152,14 +3153,14 @@ HRESULT WINAPI IWineD3DSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dstx, D DstRect.bottom = dsty + SrcRect.bottom - SrcRect.top; /* Convert BltFast flags into Btl ones because it is called from SurfaceImpl_Blt as well */ - if(trans & DDBLTFAST_SRCCOLORKEY) - Flags |= DDBLT_KEYSRC; - if(trans & DDBLTFAST_DESTCOLORKEY) - Flags |= DDBLT_KEYDEST; - if(trans & DDBLTFAST_WAIT) - Flags |= DDBLT_WAIT; - if(trans & DDBLTFAST_DONOTWAIT) - Flags |= DDBLT_DONOTWAIT; + if(trans & WINEDDBLTFAST_SRCCOLORKEY) + Flags |= WINEDDBLT_KEYSRC; + if(trans & WINEDDBLTFAST_DESTCOLORKEY) + Flags |= WINEDDBLT_KEYDEST; + if(trans & WINEDDBLTFAST_WAIT) + Flags |= WINEDDBLT_WAIT; + if(trans & WINEDDBLTFAST_DONOTWAIT) + Flags |= WINEDDBLT_DONOTWAIT; if(IWineD3DSurfaceImpl_BltOverride(This, &DstRect, Source, &SrcRect, Flags, NULL, WINED3DTEXF_NONE) == WINED3D_OK) return WINED3D_OK; } @@ -3173,7 +3174,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetPalette(IWineD3DSurface *iface, IWineD3DPa TRACE("(%p)->(%p)\n", This, Pal); *Pal = (IWineD3DPalette *) This->palette; - return DD_OK; + return WINED3D_OK; } HRESULT WINAPI IWineD3DSurfaceImpl_RealizePalette(IWineD3DSurface *iface) { @@ -3222,14 +3223,14 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD3DPa if(This->palette != NULL) if(This->resource.usage & WINED3DUSAGE_RENDERTARGET) - This->palette->Flags &= ~DDPCAPS_PRIMARYSURFACE; + This->palette->Flags &= ~WINEDDPCAPS_PRIMARYSURFACE; if(PalImpl != NULL) { if(This->resource.usage & WINED3DUSAGE_RENDERTARGET) { /* Set the device's main palette if the palette * wasn't a primary palette before */ - if(!(PalImpl->Flags & DDPCAPS_PRIMARYSURFACE)) { + if(!(PalImpl->Flags & WINEDDPCAPS_PRIMARYSURFACE)) { IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; unsigned int i; @@ -3238,7 +3239,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD3DPa } } - (PalImpl)->Flags |= DDPCAPS_PRIMARYSURFACE; + (PalImpl)->Flags |= WINEDDPCAPS_PRIMARYSURFACE; } } This->palette = PalImpl; @@ -3246,55 +3247,55 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD3DPa return IWineD3DSurface_RealizePalette(iface); } -HRESULT WINAPI IWineD3DSurfaceImpl_SetColorKey(IWineD3DSurface *iface, DWORD Flags, DDCOLORKEY *CKey) { +HRESULT WINAPI IWineD3DSurfaceImpl_SetColorKey(IWineD3DSurface *iface, DWORD Flags, WINEDDCOLORKEY *CKey) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; TRACE("(%p)->(%08x,%p)\n", This, Flags, CKey); - if ((Flags & DDCKEY_COLORSPACE) != 0) { + if ((Flags & WINEDDCKEY_COLORSPACE) != 0) { FIXME(" colorkey value not supported (%08x) !\n", Flags); - return DDERR_INVALIDPARAMS; + return WINED3DERR_INVALIDCALL; } /* Dirtify the surface, but only if a key was changed */ if(CKey) { - switch (Flags & ~DDCKEY_COLORSPACE) { - case DDCKEY_DESTBLT: + switch (Flags & ~WINEDDCKEY_COLORSPACE) { + case WINEDDCKEY_DESTBLT: This->DestBltCKey = *CKey; - This->CKeyFlags |= DDSD_CKDESTBLT; + This->CKeyFlags |= WINEDDSD_CKDESTBLT; break; - case DDCKEY_DESTOVERLAY: + case WINEDDCKEY_DESTOVERLAY: This->DestOverlayCKey = *CKey; - This->CKeyFlags |= DDSD_CKDESTOVERLAY; + This->CKeyFlags |= WINEDDSD_CKDESTOVERLAY; break; - case DDCKEY_SRCOVERLAY: + case WINEDDCKEY_SRCOVERLAY: This->SrcOverlayCKey = *CKey; - This->CKeyFlags |= DDSD_CKSRCOVERLAY; + This->CKeyFlags |= WINEDDSD_CKSRCOVERLAY; break; - case DDCKEY_SRCBLT: + case WINEDDCKEY_SRCBLT: This->SrcBltCKey = *CKey; - This->CKeyFlags |= DDSD_CKSRCBLT; + This->CKeyFlags |= WINEDDSD_CKSRCBLT; break; } } else { - switch (Flags & ~DDCKEY_COLORSPACE) { - case DDCKEY_DESTBLT: - This->CKeyFlags &= ~DDSD_CKDESTBLT; + switch (Flags & ~WINEDDCKEY_COLORSPACE) { + case WINEDDCKEY_DESTBLT: + This->CKeyFlags &= ~WINEDDSD_CKDESTBLT; break; - case DDCKEY_DESTOVERLAY: - This->CKeyFlags &= ~DDSD_CKDESTOVERLAY; + case WINEDDCKEY_DESTOVERLAY: + This->CKeyFlags &= ~WINEDDSD_CKDESTOVERLAY; break; - case DDCKEY_SRCOVERLAY: - This->CKeyFlags &= ~DDSD_CKSRCOVERLAY; + case WINEDDCKEY_SRCOVERLAY: + This->CKeyFlags &= ~WINEDDSD_CKSRCOVERLAY; break; - case DDCKEY_SRCBLT: - This->CKeyFlags &= ~DDSD_CKSRCBLT; + case WINEDDCKEY_SRCBLT: + This->CKeyFlags &= ~WINEDDSD_CKSRCBLT; break; } } @@ -3371,7 +3372,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetOverlayPosition(IWineD3DSurface *iface, LO if(!(This->resource.usage & WINED3DUSAGE_OVERLAY)) { TRACE("(%p): Not an overlay surface\n", This); - return DDERR_NOTAOVERLAYSURFACE; + return WINEDDERR_NOTAOVERLAYSURFACE; } return WINED3D_OK; @@ -3385,7 +3386,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetOverlayPosition(IWineD3DSurface *iface, LO if(!(This->resource.usage & WINED3DUSAGE_OVERLAY)) { TRACE("(%p): Not an overlay surface\n", This); - return DDERR_NOTAOVERLAYSURFACE; + return WINEDDERR_NOTAOVERLAYSURFACE; } return WINED3D_OK; @@ -3400,7 +3401,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UpdateOverlayZOrder(IWineD3DSurface *iface, D if(!(This->resource.usage & WINED3DUSAGE_OVERLAY)) { TRACE("(%p): Not an overlay surface\n", This); - return DDERR_NOTAOVERLAYSURFACE; + return WINEDDERR_NOTAOVERLAYSURFACE; } return WINED3D_OK; @@ -3414,7 +3415,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UpdateOverlay(IWineD3DSurface *iface, RECT *S if(!(This->resource.usage & WINED3DUSAGE_OVERLAY)) { TRACE("(%p): Not an overlay surface\n", This); - return DDERR_NOTAOVERLAYSURFACE; + return WINEDDERR_NOTAOVERLAYSURFACE; } return WINED3D_OK; diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c index a61fc626346..4731608454c 100644 --- a/dlls/wined3d/surface_gdi.c +++ b/dlls/wined3d/surface_gdi.c @@ -459,7 +459,7 @@ _Blt_ColorFill(BYTE *buf, case 4: COLORFILL_ROW(DWORD) default: FIXME("Color fill not implemented for bpp %d!\n", bpp*8); - return DDERR_UNSUPPORTED; + return WINED3DERR_NOTAVAILABLE; } #undef COLORFILL_ROW @@ -471,7 +471,7 @@ _Blt_ColorFill(BYTE *buf, buf += lPitch; memcpy(buf, first, width * bpp); } - return DD_OK; + return WINED3D_OK; } /***************************************************************************** @@ -491,13 +491,13 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, - DDBLTFX *DDBltFx, + WINEDDBLTFX *DDBltFx, WINED3DTEXTUREFILTERTYPE Filter) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; IWineD3DSurfaceImpl *Src = (IWineD3DSurfaceImpl *) SrcSurface; RECT xdst,xsrc; - HRESULT ret = DD_OK; + HRESULT ret = WINED3D_OK; WINED3DLOCKED_RECT dlock, slock; WINED3DFORMAT dfmt = WINED3DFMT_UNKNOWN, sfmt = WINED3DFMT_UNKNOWN; int bpp, srcheight, srcwidth, dstheight, dstwidth, width; @@ -515,7 +515,7 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, #if 0 TRACE("\tflags: "); DDRAW_dump_DDBLT(Flags); - if (Flags & DDBLT_DDFX) + if (Flags & WINEDDBLT_DDFX) { TRACE("\tblitfx: "); DDRAW_dump_DDBLTFX(DDBltFx->dwDDFX); @@ -526,7 +526,7 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, if ( (This->Flags & SFLAG_LOCKED) || ((Src != NULL) && (Src->Flags & SFLAG_LOCKED))) { WARN(" Surface is busy, returning DDERR_SURFACEBUSY\n"); - return DDERR_SURFACEBUSY; + return WINEDDERR_SURFACEBUSY; } if(Filter != WINED3DTEXF_NONE) { @@ -556,14 +556,14 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, IWineD3DSurface_LockRect(iface, &dlock,NULL,0); } - if (!DDBltFx || !(DDBltFx->dwDDFX)) Flags &= ~DDBLT_DDFX; + if (!DDBltFx || !(DDBltFx->dwDDFX)) Flags &= ~WINEDDBLT_DDFX; if (sEntry->isFourcc && dEntry->isFourcc) { if (sfmt != dfmt) { FIXME("FOURCC->FOURCC copy only supported for the same type of surface\n"); - ret = DDERR_INVALIDPIXELFORMAT; + ret = WINED3DERR_WRONGTEXTUREFORMAT; goto release; } TRACE("Fourcc->Fourcc copy)\n"); @@ -619,7 +619,7 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, (xsrc.right < xsrc.left) || (xsrc.bottom < xsrc.top))) { WARN("Application gave us bad source rectangle for Blt.\n"); - ret = DDERR_INVALIDRECT; + ret = WINEDDERR_INVALIDRECT; goto release; } /* For the Destination rect, it can be out of bounds on the condition that a clipper @@ -633,7 +633,7 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, (xdst.right < xdst.left) || (xdst.bottom < xdst.top))) { WARN("Application gave us bad destination rectangle for Blt without a clipper set.\n"); - ret = DDERR_INVALIDRECT; + ret = WINEDDERR_INVALIDRECT; goto release; } @@ -677,7 +677,7 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, /* Now check if this is a special case or not... */ if ((((xdst.bottom - xdst.top ) != (xsrc.bottom - xsrc.top )) && clip_vert ) || (((xdst.right - xdst.left) != (xsrc.right - xsrc.left)) && clip_horiz) || - (Flags & DDBLT_DDFX)) + (Flags & WINEDDBLT_DDFX)) { WARN("Out of screen rectangle in special case. Not handled right now.\n"); goto release; @@ -730,41 +730,41 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, dbuf = (BYTE*)dlock.pBits+(xdst.top*dlock.Pitch)+(xdst.left*bpp); - if (Flags & DDBLT_WAIT) + if (Flags & WINEDDBLT_WAIT) { - Flags &= ~DDBLT_WAIT; + Flags &= ~WINEDDBLT_WAIT; } - if (Flags & DDBLT_ASYNC) + if (Flags & WINEDDBLT_ASYNC) { static BOOL displayed = FALSE; if (!displayed) - FIXME("Can't handle DDBLT_ASYNC flag right now.\n"); + FIXME("Can't handle WINEDDBLT_ASYNC flag right now.\n"); displayed = TRUE; - Flags &= ~DDBLT_ASYNC; + Flags &= ~WINEDDBLT_ASYNC; } - if (Flags & DDBLT_DONOTWAIT) + if (Flags & WINEDDBLT_DONOTWAIT) { - /* DDBLT_DONOTWAIT appeared in DX7 */ + /* WINEDDBLT_DONOTWAIT appeared in DX7 */ static BOOL displayed = FALSE; if (!displayed) - FIXME("Can't handle DDBLT_DONOTWAIT flag right now.\n"); + FIXME("Can't handle WINEDDBLT_DONOTWAIT flag right now.\n"); displayed = TRUE; - Flags &= ~DDBLT_DONOTWAIT; + Flags &= ~WINEDDBLT_DONOTWAIT; } /* First, all the 'source-less' blits */ - if (Flags & DDBLT_COLORFILL) + if (Flags & WINEDDBLT_COLORFILL) { ret = _Blt_ColorFill(dbuf, dstwidth, dstheight, bpp, dlock.Pitch, DDBltFx->u5.dwFillColor); - Flags &= ~DDBLT_COLORFILL; + Flags &= ~WINEDDBLT_COLORFILL; } - if (Flags & DDBLT_DEPTHFILL) + if (Flags & WINEDDBLT_DEPTHFILL) { FIXME("DDBLT_DEPTHFILL needs to be implemented!\n"); } - if (Flags & DDBLT_ROP) + if (Flags & WINEDDBLT_ROP) { /* Catch some degenerate cases here */ switch(DDBltFx->dwROP) @@ -783,9 +783,9 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, FIXME("Unsupported raster op: %08x Pattern: %p\n", DDBltFx->dwROP, DDBltFx->u5.lpDDSPattern); goto error; } - Flags &= ~DDBLT_ROP; + Flags &= ~WINEDDBLT_ROP; } - if (Flags & DDBLT_DDROPS) + if (Flags & WINEDDBLT_DDROPS) { FIXME("\tDdraw Raster Ops: %08x Pattern: %p\n", DDBltFx->dwDDROP, DDBltFx->u5.lpDDSPattern); } @@ -899,7 +899,7 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, } default: FIXME("Stretched blit not implemented for bpp %d!\n", bpp*8); - ret = DDERR_UNSUPPORTED; + ret = WINED3DERR_NOTAVAILABLE; goto error; } #undef STRETCH_ROW @@ -914,27 +914,27 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, LONG dstyinc = dlock.Pitch, dstxinc = bpp; DWORD keylow = 0xFFFFFFFF, keyhigh = 0, keymask = 0xFFFFFFFF; DWORD destkeylow = 0x0, destkeyhigh = 0xFFFFFFFF, destkeymask = 0xFFFFFFFF; - if (Flags & (DDBLT_KEYSRC | DDBLT_KEYDEST | DDBLT_KEYSRCOVERRIDE | DDBLT_KEYDESTOVERRIDE)) + if (Flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE)) { /* The color keying flags are checked for correctness in ddraw */ - if (Flags & DDBLT_KEYSRC) + if (Flags & WINEDDBLT_KEYSRC) { keylow = Src->SrcBltCKey.dwColorSpaceLowValue; keyhigh = Src->SrcBltCKey.dwColorSpaceHighValue; } - else if (Flags & DDBLT_KEYSRCOVERRIDE) + else if (Flags & WINEDDBLT_KEYSRCOVERRIDE) { keylow = DDBltFx->ddckSrcColorkey.dwColorSpaceLowValue; keyhigh = DDBltFx->ddckSrcColorkey.dwColorSpaceHighValue; } - if (Flags & DDBLT_KEYDEST) + if (Flags & WINEDDBLT_KEYDEST) { /* Destination color keys are taken from the source surface ! */ destkeylow = Src->DestBltCKey.dwColorSpaceLowValue; destkeyhigh = Src->DestBltCKey.dwColorSpaceHighValue; } - else if (Flags & DDBLT_KEYDESTOVERRIDE) + else if (Flags & WINEDDBLT_KEYDESTOVERRIDE) { destkeylow = DDBltFx->ddckDestColorkey.dwColorSpaceLowValue; destkeyhigh = DDBltFx->ddckDestColorkey.dwColorSpaceHighValue; @@ -950,10 +950,10 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, sEntry->greenMask | sEntry->blueMask; } - Flags &= ~(DDBLT_KEYSRC | DDBLT_KEYDEST | DDBLT_KEYSRCOVERRIDE | DDBLT_KEYDESTOVERRIDE); + Flags &= ~(WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE); } - if (Flags & DDBLT_DDFX) + if (Flags & WINEDDBLT_DDFX) { LPBYTE dTopLeft, dTopRight, dBottomLeft, dBottomRight, tmp; LONG tmpxy; @@ -962,12 +962,12 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, dBottomLeft = dTopLeft+((dstheight-1)*dlock.Pitch); dBottomRight = dBottomLeft+((dstwidth-1)*bpp); - if (DDBltFx->dwDDFX & DDBLTFX_ARITHSTRETCHY) + if (DDBltFx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) { /* I don't think we need to do anything about this flag */ - WARN("Flags=DDBLT_DDFX nothing done for DDBLTFX_ARITHSTRETCHY\n"); + WARN("Flags=DDBLT_DDFX nothing done for WINEDDBLTFX_ARITHSTRETCHY\n"); } - if (DDBltFx->dwDDFX & DDBLTFX_MIRRORLEFTRIGHT) + if (DDBltFx->dwDDFX & WINEDDBLTFX_MIRRORLEFTRIGHT) { tmp = dTopRight; dTopRight = dTopLeft; @@ -977,7 +977,7 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, dBottomLeft = tmp; dstxinc = dstxinc *-1; } - if (DDBltFx->dwDDFX & DDBLTFX_MIRRORUPDOWN) + if (DDBltFx->dwDDFX & WINEDDBLTFX_MIRRORUPDOWN) { tmp = dTopLeft; dTopLeft = dBottomLeft; @@ -987,12 +987,12 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, dBottomRight = tmp; dstyinc = dstyinc *-1; } - if (DDBltFx->dwDDFX & DDBLTFX_NOTEARING) + if (DDBltFx->dwDDFX & WINEDDBLTFX_NOTEARING) { /* I don't think we need to do anything about this flag */ - WARN("Flags=DDBLT_DDFX nothing done for DDBLTFX_NOTEARING\n"); + WARN("Flags=DDBLT_DDFX nothing done for WINEDDBLTFX_NOTEARING\n"); } - if (DDBltFx->dwDDFX & DDBLTFX_ROTATE180) + if (DDBltFx->dwDDFX & WINEDDBLTFX_ROTATE180) { tmp = dBottomRight; dBottomRight = dTopLeft; @@ -1003,7 +1003,7 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, dstxinc = dstxinc * -1; dstyinc = dstyinc * -1; } - if (DDBltFx->dwDDFX & DDBLTFX_ROTATE270) + if (DDBltFx->dwDDFX & WINEDDBLTFX_ROTATE270) { tmp = dTopLeft; dTopLeft = dBottomLeft; @@ -1015,7 +1015,7 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, dstyinc = tmpxy; dstxinc = dstxinc * -1; } - if (DDBltFx->dwDDFX & DDBLTFX_ROTATE90) + if (DDBltFx->dwDDFX & WINEDDBLTFX_ROTATE90) { tmp = dTopLeft; dTopLeft = dTopRight; @@ -1027,13 +1027,13 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, dstyinc = tmpxy; dstyinc = dstyinc * -1; } - if (DDBltFx->dwDDFX & DDBLTFX_ZBUFFERBASEDEST) + if (DDBltFx->dwDDFX & WINEDDBLTFX_ZBUFFERBASEDEST) { /* I don't think we need to do anything about this flag */ - WARN("Flags=DDBLT_DDFX nothing done for DDBLTFX_ZBUFFERBASEDEST\n"); + WARN("Flags=WINEDDBLT_DDFX nothing done for WINEDDBLTFX_ZBUFFERBASEDEST\n"); } dbuf = dTopLeft; - Flags &= ~(DDBLT_DDFX); + Flags &= ~(WINEDDBLT_DDFX); } #define COPY_COLORKEY_FX(type) { \ @@ -1085,8 +1085,8 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, } default: FIXME("%s color-keyed blit not implemented for bpp %d!\n", - (Flags & DDBLT_KEYSRC) ? "Source" : "Destination", bpp*8); - ret = DDERR_UNSUPPORTED; + (Flags & WINEDDBLT_KEYSRC) ? "Source" : "Destination", bpp*8); + ret = WINED3DERR_NOTAVAILABLE; goto error; #undef COPY_COLORKEY_FX } @@ -1136,7 +1136,7 @@ IWineGDISurfaceImpl_BltFast(IWineD3DSurface *iface, int bpp, w, h, x, y; WINED3DLOCKED_RECT dlock,slock; - HRESULT ret = DD_OK; + HRESULT ret = WINED3D_OK; RECT rsrc2; RECT lock_src, lock_dst, lock_union; BYTE *sbuf, *dbuf; @@ -1161,7 +1161,7 @@ IWineGDISurfaceImpl_BltFast(IWineD3DSurface *iface, ((Src != NULL) && (Src->Flags & SFLAG_LOCKED))) { WARN(" Surface is busy, returning DDERR_SURFACEBUSY\n"); - return DDERR_SURFACEBUSY; + return WINEDDERR_SURFACEBUSY; } if (!rsrc) @@ -1182,18 +1182,18 @@ IWineGDISurfaceImpl_BltFast(IWineD3DSurface *iface, (rsrc->right < rsrc->left) || (rsrc->bottom < rsrc->top)) { WARN("Application gave us bad source rectangle for BltFast.\n"); - return DDERR_INVALIDRECT; + return WINEDDERR_INVALIDRECT; } h = rsrc->bottom - rsrc->top; if (h > This->currentDesc.Height-dsty) h = This->currentDesc.Height-dsty; if (h > Src->currentDesc.Height-rsrc->top) h=Src->currentDesc.Height-rsrc->top; - if (h <= 0) return DDERR_INVALIDRECT; + if (h <= 0) return WINEDDERR_INVALIDRECT; w = rsrc->right - rsrc->left; if (w > This->currentDesc.Width-dstx) w = This->currentDesc.Width-dstx; if (w > Src->currentDesc.Width-rsrc->left) w = Src->currentDesc.Width-rsrc->left; - if (w <= 0) return DDERR_INVALIDRECT; + if (w <= 0) return WINEDDERR_INVALIDRECT; /* Now compute the locking rectangle... */ lock_src.left = rsrc->left; @@ -1255,7 +1255,7 @@ IWineGDISurfaceImpl_BltFast(IWineD3DSurface *iface, if (Src->resource.format != This->resource.format) { FIXME("FOURCC->FOURCC copy only supported for the same type of surface\n"); - ret = DDERR_INVALIDPIXELFORMAT; + ret = WINED3DERR_WRONGTEXTUREFORMAT; goto error; } /* FIXME: Watch out that the size is correct for FOURCC surfaces */ @@ -1271,11 +1271,11 @@ IWineGDISurfaceImpl_BltFast(IWineD3DSurface *iface, goto error; } - if (trans & (DDBLTFAST_SRCCOLORKEY | DDBLTFAST_DESTCOLORKEY)) + if (trans & (WINEDDBLTFAST_SRCCOLORKEY | WINEDDBLTFAST_DESTCOLORKEY)) { DWORD keylow, keyhigh; TRACE("Color keyed copy\n"); - if (trans & DDBLTFAST_SRCCOLORKEY) + if (trans & WINEDDBLTFAST_SRCCOLORKEY) { keylow = Src->SrcBltCKey.dwColorSpaceLowValue; keyhigh = Src->SrcBltCKey.dwColorSpaceHighValue; @@ -1283,7 +1283,7 @@ IWineGDISurfaceImpl_BltFast(IWineD3DSurface *iface, else { /* I'm not sure if this is correct */ - FIXME("DDBLTFAST_DESTCOLORKEY not fully supported yet.\n"); + FIXME("WINEDDBLTFAST_DESTCOLORKEY not fully supported yet.\n"); keylow = This->DestBltCKey.dwColorSpaceLowValue; keyhigh = This->DestBltCKey.dwColorSpaceHighValue; } @@ -1332,7 +1332,7 @@ IWineGDISurfaceImpl_BltFast(IWineD3DSurface *iface, } default: FIXME("Source color key blitting not supported for bpp %d\n",bpp*8); - ret = DDERR_UNSUPPORTED; + ret = WINED3DERR_NOTAVAILABLE; goto error; } #undef COPYBOX_COLORKEY diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 83506e96cec..e32423a0eb8 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -191,7 +191,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO if (This->presentParms.Windowed) { MapWindowPoints(NULL, This->win_handle, (LPPOINT)&destRect, 2); } - IWineD3DSurface_Blt(This->backBuffer[0], &destRect, (IWineD3DSurface *) &cursor, NULL, DDBLT_KEYSRC, NULL, WINED3DTEXF_NONE); + IWineD3DSurface_Blt(This->backBuffer[0], &destRect, (IWineD3DSurface *) &cursor, NULL, WINEDDBLT_KEYSRC, NULL, WINED3DTEXF_NONE); } if (pSourceRect || pDestRect) FIXME("Unhandled present options %p/%p\n", pSourceRect, pDestRect); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 0d3ef842fed..7aae5e522d1 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -38,7 +38,6 @@ #include "wine/unicode.h" #include "wined3d_private_types.h" -#include "ddraw.h" #include "wine/wined3d_interface.h" #include "wine/wined3d_caps.h" #include "wine/wined3d_gl.h" @@ -1056,13 +1055,13 @@ struct IWineD3DSurfaceImpl HDC hDC; /* Color keys for DDraw */ - DDCOLORKEY DestBltCKey; - DDCOLORKEY DestOverlayCKey; - DDCOLORKEY SrcOverlayCKey; - DDCOLORKEY SrcBltCKey; + WINEDDCOLORKEY DestBltCKey; + WINEDDCOLORKEY DestOverlayCKey; + WINEDDCOLORKEY SrcOverlayCKey; + WINEDDCOLORKEY SrcBltCKey; DWORD CKeyFlags; - DDCOLORKEY glCKey; + WINEDDCOLORKEY glCKey; struct list renderbuffers; renderbuffer_entry_t *current_renderbuffer; @@ -1093,7 +1092,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_Restore(IWineD3DSurface *iface); HRESULT WINAPI IWineD3DSurfaceImpl_SetPixelFormat(IWineD3DSurface *iface, WINED3DFORMAT Format, BYTE *Surface, DWORD Size); HRESULT WINAPI IWineD3DSurfaceImpl_GetPalette(IWineD3DSurface *iface, IWineD3DPalette **Pal); HRESULT WINAPI IWineD3DSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD3DPalette *Pal); -HRESULT WINAPI IWineD3DSurfaceImpl_SetColorKey(IWineD3DSurface *iface, DWORD Flags, DDCOLORKEY *CKey); +HRESULT WINAPI IWineD3DSurfaceImpl_SetColorKey(IWineD3DSurface *iface, DWORD Flags, WINEDDCOLORKEY *CKey); HRESULT WINAPI IWineD3DSurfaceImpl_CleanDirtyRect(IWineD3DSurface *iface); extern HRESULT WINAPI IWineD3DSurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, CONST RECT* pDirtyRect); HRESULT WINAPI IWineD3DSurfaceImpl_SetContainer(IWineD3DSurface *iface, IWineD3DBase *container); @@ -1101,7 +1100,7 @@ void WINAPI IWineD3DSurfaceImpl_SetGlTextureDesc(IWineD3DSurface *iface, UINT te void WINAPI IWineD3DSurfaceImpl_GetGlDesc(IWineD3DSurface *iface, glDescriptor **glDescription); const void *WINAPI IWineD3DSurfaceImpl_GetData(IWineD3DSurface *iface); HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format); -HRESULT WINAPI IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, DDBLTFX *DDBltFx, WINED3DTEXTUREFILTERTYPE Filter); +HRESULT WINAPI IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, WINEDDBLTFX *DDBltFx, WINED3DTEXTUREFILTERTYPE Filter); HRESULT WINAPI IWineGDISurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dstx, DWORD dsty, IWineD3DSurface *Source, RECT *rsrc, DWORD trans); HRESULT WINAPI IWineD3DSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD3DPalette *Pal); HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC); diff --git a/include/wine/wined3d_interface.h b/include/wine/wined3d_interface.h index 229bcc6d3ec..85653a4dcc0 100644 --- a/include/wine/wined3d_interface.h +++ b/include/wine/wined3d_interface.h @@ -28,9 +28,11 @@ # error You must include config.h to use this header #endif -#if !defined( __WINE_DDRAW_H) -#error You must include ddraw.h to use this header -#endif +#define COM_NO_WINDOWS_H +#include + +/* Stupid DDraw Struct references surfaces */ +struct IWineD3DSurface; #include "wined3d_types.h" /***************************************************************** @@ -71,6 +73,12 @@ #define WINED3DERR_INVALIDCALL MAKE_WINED3DHRESULT(2156) #define WINED3DERR_DRIVERINVALIDCALL MAKE_WINED3DHRESULT(2157) #define WINED3DERR_WASSTILLDRAWING MAKE_WINED3DHRESULT(540) +#define WINEDDERR_NOTAOVERLAYSURFACE MAKE_WINED3DHRESULT(580) +#define WINEDDERR_NODC MAKE_WINED3DHRESULT(586) +#define WINEDDERR_DCALREADYCREATED MAKE_WINED3DHRESULT(620) +#define WINEDDERR_NOTFLIPPABLE MAKE_WINED3DHRESULT(582) +#define WINEDDERR_SURFACEBUSY MAKE_WINED3DHRESULT(430) +#define WINEDDERR_INVALIDRECT MAKE_WINED3DHRESULT(150) #define WINED3DOK_NOAUTOGEN MAKE_WINED3DSTATUS(2159) /***************************************************************************** @@ -89,7 +97,6 @@ struct IWineD3DTexture; struct IWineD3DCubeTexture; struct IWineD3DVolumeTexture; struct IWineD3DStateBlock; -struct IWineD3DSurface; struct IWineD3DVolume; struct IWineD3DVertexDeclaration; struct IWineD3DBaseShader; @@ -1093,7 +1100,7 @@ DECLARE_INTERFACE_(IWineD3DSurface,IWineD3DResource) STDMETHOD(GetDC)(THIS_ HDC *pHdc) PURE; STDMETHOD(ReleaseDC)(THIS_ HDC hdc) PURE; STDMETHOD(Flip)(THIS_ IWineD3DSurface *Override, DWORD FLAGS) PURE; - STDMETHOD(Blt)(THIS_ RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, DDBLTFX *DDBltFx, WINED3DTEXTUREFILTERTYPE Filter) PURE; + STDMETHOD(Blt)(THIS_ RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, WINEDDBLTFX *DDBltFx, WINED3DTEXTUREFILTERTYPE Filter) PURE; STDMETHOD(GetBltStatus)(THIS_ DWORD Flags) PURE; STDMETHOD(GetFlipStatus)(THIS_ DWORD Flags) PURE; STDMETHOD(IsLost)(THIS) PURE; @@ -1102,7 +1109,7 @@ DECLARE_INTERFACE_(IWineD3DSurface,IWineD3DResource) STDMETHOD(GetPalette)(THIS_ struct IWineD3DPalette **Palette) PURE; STDMETHOD(SetPalette)(THIS_ struct IWineD3DPalette *Palette) PURE; STDMETHOD(RealizePalette)(THIS) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD Flags, DDCOLORKEY *CKey) PURE; + STDMETHOD(SetColorKey)(THIS_ DWORD Flags, WINEDDCOLORKEY *CKey) PURE; STDMETHOD_(DWORD,GetPitch)(THIS) PURE; STDMETHOD(SetMem)(THIS_ void *mem) PURE; STDMETHOD(SetOverlayPosition)(THIS_ LONG X, LONG Y) PURE; diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h index bd63f71deb7..0bd094bc5ba 100644 --- a/include/wine/wined3d_types.h +++ b/include/wine/wined3d_types.h @@ -223,6 +223,10 @@ typedef enum _WINED3DDEGREETYPE { WINED3DDEGREE_FORCE_DWORD = 0x7fffffff } WINED3DDEGREETYPE; +#define WINEMAKEFOURCC(ch0, ch1, ch2, ch3) \ + ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ + ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) + typedef enum _WINED3DFORMAT { WINED3DFMT_UNKNOWN = 0, @@ -260,16 +264,16 @@ typedef enum _WINED3DFORMAT { WINED3DFMT_W11V11U10 = 65, WINED3DFMT_A2W10V10U10 = 67, - WINED3DFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'), - WINED3DFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'), - WINED3DFMT_DXT1 = MAKEFOURCC('D', 'X', 'T', '1'), - WINED3DFMT_DXT2 = MAKEFOURCC('D', 'X', 'T', '2'), - WINED3DFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'), - WINED3DFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'), - WINED3DFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'), - WINED3DFMT_MULTI2_ARGB8 = MAKEFOURCC('M', 'E', 'T', '1'), - WINED3DFMT_G8R8_G8B8 = MAKEFOURCC('G', 'R', 'G', 'B'), - WINED3DFMT_R8G8_B8G8 = MAKEFOURCC('R', 'G', 'B', 'G'), + WINED3DFMT_UYVY = WINEMAKEFOURCC('U', 'Y', 'V', 'Y'), + WINED3DFMT_YUY2 = WINEMAKEFOURCC('Y', 'U', 'Y', '2'), + WINED3DFMT_DXT1 = WINEMAKEFOURCC('D', 'X', 'T', '1'), + WINED3DFMT_DXT2 = WINEMAKEFOURCC('D', 'X', 'T', '2'), + WINED3DFMT_DXT3 = WINEMAKEFOURCC('D', 'X', 'T', '3'), + WINED3DFMT_DXT4 = WINEMAKEFOURCC('D', 'X', 'T', '4'), + WINED3DFMT_DXT5 = WINEMAKEFOURCC('D', 'X', 'T', '5'), + WINED3DFMT_MULTI2_ARGB8 = WINEMAKEFOURCC('M', 'E', 'T', '1'), + WINED3DFMT_G8R8_G8B8 = WINEMAKEFOURCC('G', 'R', 'G', 'B'), + WINED3DFMT_R8G8_B8G8 = WINEMAKEFOURCC('R', 'G', 'B', 'G'), WINED3DFMT_D16_LOCKABLE = 70, WINED3DFMT_D32 = 71, @@ -1290,30 +1294,6 @@ typedef struct WineDirect3DVertexStridedData { } u; } WineDirect3DVertexStridedData; -typedef struct _WINEDDOVERLAYFX -{ - DWORD dwSize; /* size of structure */ - DWORD dwAlphaEdgeBlendBitDepth; /* Bit depth used to specify constant for alpha edge blend */ - DWORD dwAlphaEdgeBlend; /* Constant to use as alpha for edge blend */ - DWORD dwReserved; - DWORD dwAlphaDestConstBitDepth; /* Bit depth used to specify alpha constant for destination */ - union - { - DWORD dwAlphaDestConst; /* Constant to use as alpha channel for dest */ - LPDIRECTDRAWSURFACE lpDDSAlphaDest; /* Surface to use as alpha channel for dest */ - } DUMMYUNIONNAME1; - DWORD dwAlphaSrcConstBitDepth; /* Bit depth used to specify alpha constant for source */ - union - { - DWORD dwAlphaSrcConst; /* Constant to use as alpha channel for src */ - LPDIRECTDRAWSURFACE lpDDSAlphaSrc; /* Surface to use as alpha channel for src */ - } DUMMYUNIONNAME2; - DDCOLORKEY dckDestColorkey; /* DestColorkey override */ - DDCOLORKEY dckSrcColorkey; /* DestColorkey override */ - DWORD dwDDFX; /* Overlay FX */ - DWORD dwFlags; /* flags */ -} WINEDDOVERLAYFX; - typedef enum { WINED3DDECLUSAGE_POSITION = 0, WINED3DDECLUSAGE_BLENDWEIGHT = 1, @@ -1576,4 +1556,195 @@ typedef enum _WINED3DSURFTYPE { #define WINED3DCREATE_DISABLE_DRIVER_MANAGEMENT 0x00000100 #define WINED3DCREATE_ADAPTERGROUP_DEVICE 0x00000200 +/* DirectDraw types */ + +typedef struct _WINEDDCOLORKEY +{ + DWORD dwColorSpaceLowValue; /* low boundary of color space that is to + * be treated as Color Key, inclusive + */ + DWORD dwColorSpaceHighValue; /* high boundary of color space that is + * to be treated as Color Key, inclusive + */ +} WINEDDCOLORKEY,*LPWINEDDCOLORKEY; + +typedef struct _WINEDDBLTFX +{ + DWORD dwSize; /* size of structure */ + DWORD dwDDFX; /* FX operations */ + DWORD dwROP; /* Win32 raster operations */ + DWORD dwDDROP; /* Raster operations new for DirectDraw */ + DWORD dwRotationAngle; /* Rotation angle for blt */ + DWORD dwZBufferOpCode; /* ZBuffer compares */ + DWORD dwZBufferLow; /* Low limit of Z buffer */ + DWORD dwZBufferHigh; /* High limit of Z buffer */ + DWORD dwZBufferBaseDest; /* Destination base value */ + DWORD dwZDestConstBitDepth; /* Bit depth used to specify Z constant for destination */ + union + { + DWORD dwZDestConst; /* Constant to use as Z buffer for dest */ + struct IWineD3DSurface *lpDDSZBufferDest; /* Surface to use as Z buffer for dest */ + } DUMMYUNIONNAME1; + DWORD dwZSrcConstBitDepth; /* Bit depth used to specify Z constant for source */ + union + { + DWORD dwZSrcConst; /* Constant to use as Z buffer for src */ + struct IWineD3DSurface *lpDDSZBufferSrc;/* Surface to use as Z buffer for src */ + } DUMMYUNIONNAME2; + DWORD dwAlphaEdgeBlendBitDepth; /* Bit depth used to specify constant for alpha edge blend */ + DWORD dwAlphaEdgeBlend; /* Alpha for edge blending */ + DWORD dwReserved; + DWORD dwAlphaDestConstBitDepth; /* Bit depth used to specify alpha constant for destination */ + union + { + DWORD dwAlphaDestConst; /* Constant to use as Alpha Channel */ + struct IWineD3DSurface *lpDDSAlphaDest; /* Surface to use as Alpha Channel */ + } DUMMYUNIONNAME3; + DWORD dwAlphaSrcConstBitDepth; /* Bit depth used to specify alpha constant for source */ + union + { + DWORD dwAlphaSrcConst; /* Constant to use as Alpha Channel */ + struct IWineD3DSurface *lpDDSAlphaSrc; /* Surface to use as Alpha Channel */ + } DUMMYUNIONNAME4; + union + { + DWORD dwFillColor; /* color in RGB or Palettized */ + DWORD dwFillDepth; /* depth value for z-buffer */ + DWORD dwFillPixel; /* pixel val for RGBA or RGBZ */ + struct IWineD3DSurface *lpDDSPattern; /* Surface to use as pattern */ + } DUMMYUNIONNAME5; + WINEDDCOLORKEY ddckDestColorkey; /* DestColorkey override */ + WINEDDCOLORKEY ddckSrcColorkey; /* SrcColorkey override */ +} WINEDDBLTFX,*LPWINEDDBLTFX; + +typedef struct _WINEDDOVERLAYFX +{ + DWORD dwSize; /* size of structure */ + DWORD dwAlphaEdgeBlendBitDepth; /* Bit depth used to specify constant for alpha edge blend */ + DWORD dwAlphaEdgeBlend; /* Constant to use as alpha for edge blend */ + DWORD dwReserved; + DWORD dwAlphaDestConstBitDepth; /* Bit depth used to specify alpha constant for destination */ + union + { + DWORD dwAlphaDestConst; /* Constant to use as alpha channel for dest */ + struct IWineD3DSurface *lpDDSAlphaDest; /* Surface to use as alpha channel for dest */ + } DUMMYUNIONNAME1; + DWORD dwAlphaSrcConstBitDepth; /* Bit depth used to specify alpha constant for source */ + union + { + DWORD dwAlphaSrcConst; /* Constant to use as alpha channel for src */ + struct IWineD3DSurface *lpDDSAlphaSrc; /* Surface to use as alpha channel for src */ + } DUMMYUNIONNAME2; + WINEDDCOLORKEY dckDestColorkey; /* DestColorkey override */ + WINEDDCOLORKEY dckSrcColorkey; /* DestColorkey override */ + DWORD dwDDFX; /* Overlay FX */ + DWORD dwFlags; /* flags */ +} WINEDDOVERLAYFX; + +/* dwDDFX */ +/* arithmetic stretching along y axis */ +#define WINEDDBLTFX_ARITHSTRETCHY 0x00000001 +/* mirror on y axis */ +#define WINEDDBLTFX_MIRRORLEFTRIGHT 0x00000002 +/* mirror on x axis */ +#define WINEDDBLTFX_MIRRORUPDOWN 0x00000004 +/* do not tear */ +#define WINEDDBLTFX_NOTEARING 0x00000008 +/* 180 degrees clockwise rotation */ +#define WINEDDBLTFX_ROTATE180 0x00000010 +/* 270 degrees clockwise rotation */ +#define WINEDDBLTFX_ROTATE270 0x00000020 +/* 90 degrees clockwise rotation */ +#define WINEDDBLTFX_ROTATE90 0x00000040 +/* dwZBufferLow and dwZBufferHigh specify limits to the copied Z values */ +#define WINEDDBLTFX_ZBUFFERRANGE 0x00000080 +/* add dwZBufferBaseDest to every source z value before compare */ +#define WINEDDBLTFX_ZBUFFERBASEDEST 0x00000100 + +/* dwFlags for Blt* */ +#define WINEDDBLT_ALPHADEST 0x00000001 +#define WINEDDBLT_ALPHADESTCONSTOVERRIDE 0x00000002 +#define WINEDDBLT_ALPHADESTNEG 0x00000004 +#define WINEDDBLT_ALPHADESTSURFACEOVERRIDE 0x00000008 +#define WINEDDBLT_ALPHAEDGEBLEND 0x00000010 +#define WINEDDBLT_ALPHASRC 0x00000020 +#define WINEDDBLT_ALPHASRCCONSTOVERRIDE 0x00000040 +#define WINEDDBLT_ALPHASRCNEG 0x00000080 +#define WINEDDBLT_ALPHASRCSURFACEOVERRIDE 0x00000100 +#define WINEDDBLT_ASYNC 0x00000200 +#define WINEDDBLT_COLORFILL 0x00000400 +#define WINEDDBLT_DDFX 0x00000800 +#define WINEDDBLT_DDROPS 0x00001000 +#define WINEDDBLT_KEYDEST 0x00002000 +#define WINEDDBLT_KEYDESTOVERRIDE 0x00004000 +#define WINEDDBLT_KEYSRC 0x00008000 +#define WINEDDBLT_KEYSRCOVERRIDE 0x00010000 +#define WINEDDBLT_ROP 0x00020000 +#define WINEDDBLT_ROTATIONANGLE 0x00040000 +#define WINEDDBLT_ZBUFFER 0x00080000 +#define WINEDDBLT_ZBUFFERDESTCONSTOVERRIDE 0x00100000 +#define WINEDDBLT_ZBUFFERDESTOVERRIDE 0x00200000 +#define WINEDDBLT_ZBUFFERSRCCONSTOVERRIDE 0x00400000 +#define WINEDDBLT_ZBUFFERSRCOVERRIDE 0x00800000 +#define WINEDDBLT_WAIT 0x01000000 +#define WINEDDBLT_DEPTHFILL 0x02000000 +#define WINEDDBLT_DONOTWAIT 0x08000000 + +/* dwTrans for BltFast */ +#define WINEDDBLTFAST_NOCOLORKEY 0x00000000 +#define WINEDDBLTFAST_SRCCOLORKEY 0x00000001 +#define WINEDDBLTFAST_DESTCOLORKEY 0x00000002 +#define WINEDDBLTFAST_WAIT 0x00000010 +#define WINEDDBLTFAST_DONOTWAIT 0x00000020 + +/* DDCAPS.dwPalCaps */ +#define WINEDDPCAPS_4BIT 0x00000001 +#define WINEDDPCAPS_8BITENTRIES 0x00000002 +#define WINEDDPCAPS_8BIT 0x00000004 +#define WINEDDPCAPS_INITIALIZE 0x00000008 +#define WINEDDPCAPS_PRIMARYSURFACE 0x00000010 +#define WINEDDPCAPS_PRIMARYSURFACELEFT 0x00000020 +#define WINEDDPCAPS_ALLOW256 0x00000040 +#define WINEDDPCAPS_VSYNC 0x00000080 +#define WINEDDPCAPS_1BIT 0x00000100 +#define WINEDDPCAPS_2BIT 0x00000200 +#define WINEDDPCAPS_ALPHA 0x00000400 + +/* DDSURFACEDESC.dwFlags */ +#define WINEDDSD_CAPS 0x00000001 +#define WINEDDSD_HEIGHT 0x00000002 +#define WINEDDSD_WIDTH 0x00000004 +#define WINEDDSD_PITCH 0x00000008 +#define WINEDDSD_BACKBUFFERCOUNT 0x00000020 +#define WINEDDSD_ZBUFFERBITDEPTH 0x00000040 +#define WINEDDSD_ALPHABITDEPTH 0x00000080 +#define WINEDDSD_LPSURFACE 0x00000800 +#define WINEDDSD_PIXELFORMAT 0x00001000 +#define WINEDDSD_CKDESTOVERLAY 0x00002000 +#define WINEDDSD_CKDESTBLT 0x00004000 +#define WINEDDSD_CKSRCOVERLAY 0x00008000 +#define WINEDDSD_CKSRCBLT 0x00010000 +#define WINEDDSD_MIPMAPCOUNT 0x00020000 +#define WINEDDSD_REFRESHRATE 0x00040000 +#define WINEDDSD_LINEARSIZE 0x00080000 +#define WINEDDSD_TEXTURESTAGE 0x00100000 +#define WINEDDSD_FVF 0x00200000 +#define WINEDDSD_SRCVBHANDLE 0x00400000 +#define WINEDDSD_ALL 0x007ff9ee + +/* Set/Get Colour Key Flags */ +#define WINEDDCKEY_COLORSPACE 0x00000001 /* Struct is single colour space */ +#define WINEDDCKEY_DESTBLT 0x00000002 /* To be used as dest for blt */ +#define WINEDDCKEY_DESTOVERLAY 0x00000004 /* To be used as dest for CK overlays */ +#define WINEDDCKEY_SRCBLT 0x00000008 /* To be used as src for blt */ +#define WINEDDCKEY_SRCOVERLAY 0x00000010 /* To be used as src for CK overlays */ + +/* dwFlags for GetBltStatus */ +#define WINEDDGBS_CANBLT 0x00000001 +#define WINEDDGBS_ISBLTDONE 0x00000002 + +/* dwFlags for GetFlipStatus */ +#define WINEDDGFS_CANFLIP 1L +#define WINEDDGFS_ISFLIPDONE 2L + #endif