Commit 3529560c authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Add WINED3DUSAGE_OVERLAY.

parent 2bcacf22
......@@ -337,7 +337,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateTexture(LPDIRECT3DDEVICE8 iface
object->lpVtbl = &Direct3DTexture8_Vtbl;
object->ref = 1;
hrc = IWineD3DDevice_CreateTexture(This->WineD3DDevice, Width, Height, Levels, Usage,
hrc = IWineD3DDevice_CreateTexture(This->WineD3DDevice, Width, Height, Levels, Usage & WINED3DUSAGE_MASK,
(WINED3DFORMAT)Format, (WINED3DPOOL) Pool, &object->wineD3DTexture, NULL, (IUnknown *)object, D3D8CB_CreateSurface);
if (FAILED(hrc)) {
......@@ -375,7 +375,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(LPDIRECT3DDEVICE8
object->lpVtbl = &Direct3DVolumeTexture8_Vtbl;
object->ref = 1;
hrc = IWineD3DDevice_CreateVolumeTexture(This->WineD3DDevice, Width, Height, Depth, Levels, Usage,
hrc = IWineD3DDevice_CreateVolumeTexture(This->WineD3DDevice, Width, Height, Depth, Levels, Usage & WINED3DUSAGE_MASK,
(WINED3DFORMAT)Format, (WINED3DPOOL) Pool, &object->wineD3DVolumeTexture, NULL,
(IUnknown *)object, D3D8CB_CreateVolume);
......@@ -414,7 +414,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateCubeTexture(LPDIRECT3DDEVICE8 i
object->lpVtbl = &Direct3DCubeTexture8_Vtbl;
object->ref = 1;
hr = IWineD3DDevice_CreateCubeTexture(This->WineD3DDevice, EdgeLength, Levels, Usage,
hr = IWineD3DDevice_CreateCubeTexture(This->WineD3DDevice, EdgeLength, Levels, Usage & WINED3DUSAGE_MASK,
(WINED3DFORMAT)Format, (WINED3DPOOL) Pool, &object->wineD3DCubeTexture, NULL, (IUnknown*)object,
D3D8CB_CreateSurface);
......@@ -450,7 +450,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexBuffer(LPDIRECT3DDEVICE8
object->lpVtbl = &Direct3DVertexBuffer8_Vtbl;
object->ref = 1;
hrc = IWineD3DDevice_CreateVertexBuffer(This->WineD3DDevice, Size, Usage, FVF, (WINED3DPOOL) Pool, &(object->wineD3DVertexBuffer), NULL, (IUnknown *)object);
hrc = IWineD3DDevice_CreateVertexBuffer(This->WineD3DDevice, Size, Usage & WINED3DUSAGE_MASK, FVF, (WINED3DPOOL) Pool, &(object->wineD3DVertexBuffer), NULL, (IUnknown *)object);
if (D3D_OK != hrc) {
......@@ -483,7 +483,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateIndexBuffer(LPDIRECT3DDEVICE8 i
object->lpVtbl = &Direct3DIndexBuffer8_Vtbl;
object->ref = 1;
TRACE("Calling wined3d create index buffer\n");
hrc = IWineD3DDevice_CreateIndexBuffer(This->WineD3DDevice, Length, Usage, Format, (WINED3DPOOL) Pool, &object->wineD3DIndexBuffer, NULL, (IUnknown *)object);
hrc = IWineD3DDevice_CreateIndexBuffer(This->WineD3DDevice, Length, Usage & WINED3DUSAGE_MASK, Format, (WINED3DPOOL) Pool, &object->wineD3DIndexBuffer, NULL, (IUnknown *)object);
if (D3D_OK != hrc) {
......@@ -533,7 +533,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateSurface(LPDIRECT3DDEVICE8 iface
TRACE("(%p) : w(%d) h(%d) fmt(%d) surf@%p\n", This, Width, Height, Format, *ppSurface);
hrc = IWineD3DDevice_CreateSurface(This->WineD3DDevice, Width, Height, Format, Lockable, Discard, Level, &object->wineD3DSurface, Type, Usage, (WINED3DPOOL) Pool,MultiSample,MultisampleQuality, NULL, SURFACE_OPENGL, (IUnknown *)object);
hrc = IWineD3DDevice_CreateSurface(This->WineD3DDevice, Width, Height, Format, Lockable, Discard, Level, &object->wineD3DSurface, Type, Usage & WINED3DUSAGE_MASK, (WINED3DPOOL) Pool,MultiSample,MultisampleQuality, NULL, SURFACE_OPENGL, (IUnknown *)object);
if (hrc != D3D_OK || NULL == object->wineD3DSurface) {
/* free up object */
FIXME("(%p) call to IWineD3DDevice_CreateSurface failed\n", This);
......
......@@ -274,7 +274,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9 ifac
TRACE("(%p) : w(%d) h(%d) fmt(%d) surf@%p\n", This, Width, Height, Format, *ppSurface);
hrc = IWineD3DDevice_CreateSurface(This->WineD3DDevice, Width, Height, Format, Lockable, Discard, Level, &object->wineD3DSurface, Type, Usage, (WINED3DPOOL) Pool,MultiSample,MultisampleQuality,pSharedHandle,SURFACE_OPENGL,(IUnknown *)object);
hrc = IWineD3DDevice_CreateSurface(This->WineD3DDevice, Width, Height, Format, Lockable, Discard, Level, &object->wineD3DSurface, Type, Usage & WINED3DUSAGE_MASK, (WINED3DPOOL) Pool,MultiSample,MultisampleQuality,pSharedHandle,SURFACE_OPENGL,(IUnknown *)object);
if (hrc != D3D_OK || NULL == object->wineD3DSurface) {
......
......@@ -175,7 +175,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateIndexBuffer(LPDIRECT3DDEVICE9 iface,
object->lpVtbl = &Direct3DIndexBuffer9_Vtbl;
object->ref = 1;
TRACE("Calling wined3d create index buffer\n");
hrc = IWineD3DDevice_CreateIndexBuffer(This->WineD3DDevice, Length, Usage, Format, (WINED3DPOOL) Pool, &object->wineD3DIndexBuffer, pSharedHandle, (IUnknown *)object);
hrc = IWineD3DDevice_CreateIndexBuffer(This->WineD3DDevice, Length, Usage & WINED3DUSAGE_MASK, Format, (WINED3DPOOL) Pool, &object->wineD3DIndexBuffer, pSharedHandle, (IUnknown *)object);
if (hrc != D3D_OK) {
/* free up object */
......
......@@ -256,7 +256,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateTexture(LPDIRECT3DDEVICE9 iface, UIN
object->lpVtbl = &Direct3DTexture9_Vtbl;
object->ref = 1;
hrc = IWineD3DDevice_CreateTexture(This->WineD3DDevice, Width, Height, Levels, Usage,
hrc = IWineD3DDevice_CreateTexture(This->WineD3DDevice, Width, Height, Levels, Usage & WINED3DUSAGE_MASK,
(WINED3DFORMAT)Format, (WINED3DPOOL) Pool, &object->wineD3DTexture, pSharedHandle, (IUnknown *)object, D3D9CB_CreateSurface);
if (FAILED(hrc)) {
......
......@@ -174,7 +174,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexBuffer(LPDIRECT3DDEVICE9 iface,
object->lpVtbl = &Direct3DVertexBuffer9_Vtbl;
object->ref = 1;
hrc = IWineD3DDevice_CreateVertexBuffer(This->WineD3DDevice, Size, Usage, FVF, (WINED3DPOOL) Pool, &(object->wineD3DVertexBuffer), pSharedHandle, (IUnknown *)object);
hrc = IWineD3DDevice_CreateVertexBuffer(This->WineD3DDevice, Size, Usage & WINED3DUSAGE_MASK, FVF, (WINED3DPOOL) Pool, &(object->wineD3DVertexBuffer), pSharedHandle, (IUnknown *)object);
if (hrc != D3D_OK) {
......
......@@ -219,7 +219,7 @@ HRESULT WINAPI D3D9CB_CreateVolume(IUnknown *pDevice, UINT Width, UINT Height,
object->lpVtbl = &Direct3DVolume9_Vtbl;
object->ref = 1;
hrc = IWineD3DDevice_CreateVolume(This->WineD3DDevice, Width, Height, Depth, Usage, Format,
hrc = IWineD3DDevice_CreateVolume(This->WineD3DDevice, Width, Height, Depth, Usage & WINED3DUSAGE_MASK, Format,
Pool, &object->wineD3DVolume, pSharedHandle, (IUnknown *)object);
if (hrc != D3D_OK) {
/* free up object */
......
......@@ -258,7 +258,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVolumeTexture(LPDIRECT3DDEVICE9 ifac
object->lpVtbl = &Direct3DVolumeTexture9_Vtbl;
object->ref = 1;
hrc = IWineD3DDevice_CreateVolumeTexture(This->WineD3DDevice, Width, Height, Depth, Levels, Usage,
hrc = IWineD3DDevice_CreateVolumeTexture(This->WineD3DDevice, Width, Height, Depth, Levels, Usage & WINED3DUSAGE_MASK,
(WINED3DFORMAT)Format, (WINED3DPOOL) Pool, &object->wineD3DVolumeTexture, pSharedHandle,
(IUnknown *)object, D3D9CB_CreateVolume);
......
......@@ -1806,6 +1806,10 @@ IDirectDrawImpl_CreateNewSurface(IDirectDrawImpl *This,
DDSCAPS_VISIBLE |
DDSCAPS_LOCALVIDMEM;
}
if (pDDSD->ddsCaps.dwCaps & (DDSCAPS_OVERLAY))
{
Usage |= WINED3DUSAGE_OVERLAY;
}
if(This->depthstencil)
{
/* The depth stencil creation callback sets this flag.
......
......@@ -3076,6 +3076,12 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetOverlayPosition(IWineD3DSurface *iface, LO
FIXME("(%p)->(%d,%d) Stub!\n", This, X, Y);
if(!(This->resource.usage & WINED3DUSAGE_OVERLAY))
{
TRACE("(%p): Not an overlay surface\n", This);
return DDERR_NOTAOVERLAYSURFACE;
}
return WINED3D_OK;
}
......@@ -3084,6 +3090,12 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetOverlayPosition(IWineD3DSurface *iface, LO
FIXME("(%p)->(%p,%p) Stub!\n", This, X, Y);
if(!(This->resource.usage & WINED3DUSAGE_OVERLAY))
{
TRACE("(%p): Not an overlay surface\n", This);
return DDERR_NOTAOVERLAYSURFACE;
}
return WINED3D_OK;
}
......@@ -3093,6 +3105,12 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UpdateOverlayZOrder(IWineD3DSurface *iface, D
FIXME("(%p)->(%08x,%p) Stub!\n", This, Flags, RefImpl);
if(!(This->resource.usage & WINED3DUSAGE_OVERLAY))
{
TRACE("(%p): Not an overlay surface\n", This);
return DDERR_NOTAOVERLAYSURFACE;
}
return WINED3D_OK;
}
......@@ -3101,6 +3119,12 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UpdateOverlay(IWineD3DSurface *iface, RECT *S
IWineD3DSurfaceImpl *Dst = (IWineD3DSurfaceImpl *) DstSurface;
FIXME("(%p)->(%p, %p, %p, %08x, %p)\n", This, SrcRect, Dst, DstRect, Flags, FX);
if(!(This->resource.usage & WINED3DUSAGE_OVERLAY))
{
TRACE("(%p): Not an overlay surface\n", This);
return DDERR_NOTAOVERLAYSURFACE;
}
return WINED3D_OK;
}
......
......@@ -1509,6 +1509,11 @@ IWineGDISurfaceImpl_PrivateSetup(IWineD3DSurface *iface)
HDC hdc;
long oldsize = This->resource.size;
if(This->resource.usage & WINED3DUSAGE_OVERLAY)
{
ERR("(%p) Overlays not yet supported by GDI surfaces\n", This);
return WINED3DERR_INVALIDCALL;
}
/* Sysmem textures have memory already allocated -
* release it, this avoids an unnecessary memcpy
*/
......
......@@ -1053,6 +1053,7 @@ typedef enum _WINED3DSAMPLER_TEXTURE_TYPE {
#define WINED3DUSAGE_AUTOGENMIPMAP 0x00000400L
#define WINED3DUSAGE_DMAP 0x00004000L
#define WINED3DUSAGE_MASK 0x00004FFFL
#define WINED3DUSAGE_OVERLAY 0x00010000L
#define WINED3DUSAGE_QUERY_LEGACYBUMPMAP 0x00008000L
#define WINED3DUSAGE_QUERY_FILTER 0x00020000L
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment