From 08dc9e003de52c7e2e187dec1abd0d025e227419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 9 May 2006 18:47:28 +0200 Subject: [PATCH] wined3d: Implement IWineD3DSurface::IsLost and Restore. --- dlls/wined3d/surface.c | 14 ++++++++++---- dlls/wined3d/wined3d_private.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index bb5d07076e7..e6fc8cce4a7 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1698,13 +1698,19 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetFlipStatus(IWineD3DSurface *iface, DWORD F } HRESULT WINAPI IWineD3DSurfaceImpl_IsLost(IWineD3DSurface *iface) { - FIXME("This is unimplemented for now(d3d7 merge)\n"); - return WINED3DERR_INVALIDCALL; + IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; + TRACE("(%p)\n", This); + + return This->Flags & SFLAG_LOST ? DDERR_SURFACELOST : WINED3D_OK; } HRESULT WINAPI IWineD3DSurfaceImpl_Restore(IWineD3DSurface *iface) { - FIXME("This is unimplemented for now(d3d7 merge)\n"); - return WINED3DERR_INVALIDCALL; + IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; + TRACE("(%p)\n", This); + + /* So far we don't lose anything :) */ + This->Flags &= ~SFLAG_LOST; + return WINED3D_OK; } HRESULT WINAPI IWineD3DSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dstx, DWORD dsty, IWineD3DSurface *Source, RECT *rsrc, DWORD trans) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 980ad32a3dc..efdafd10f53 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -855,6 +855,7 @@ extern const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl; #define SFLAG_DYNCHANGE 0x1800 /* Surface contents are changed very often, implies DYNLOCK */ #define SFLAG_DCINUSE 0x2000 /* Set between GetDC and ReleaseDC calls */ #define SFLAG_NEWDC 0x4000 /* To inform LockRect about a new dc */ +#define SFLAG_LOST 0x8000 /* Surface lost flag for DDraw */ /* In some conditions the surface memory must not be freed: * SFLAG_OVERSIZE: Not all data can be kept in GL