[PATCH] WineD3D: Update the overlay when the destination was =

Stefan Doesinger stefan at codeweavers.com
Tue Jul 29 11:17:13 CDT 2008


drawn to=0A=
=0A=
---=0A=
 dlls/wined3d/surface.c |   17 +++++++++++++++++=0A=
 1 files changed, 17 insertions(+), 0 deletions(-)=0A=
=0A=
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c=0A=
index 38ceb25..6d44dd4 100644=0A=
--- a/dlls/wined3d/surface.c=0A=
+++ b/dlls/wined3d/surface.c=0A=
@@ -4075,6 +4075,7 @@ void surface_load_ds_location(IWineD3DSurface =
*iface, DWORD location) {=0A=
 static void WINAPI IWineD3DSurfaceImpl_ModifyLocation(IWineD3DSurface =
*iface, DWORD flag, BOOL persistent) {=0A=
     IWineD3DSurfaceImpl *This =3D (IWineD3DSurfaceImpl *) iface;=0A=
     IWineD3DBaseTexture *texture;=0A=
+    IWineD3DSurfaceImpl *overlay;=0A=
 =0A=
     TRACE("(%p)->(%s, %s)\n", iface,=0A=
           flag =3D=3D SFLAG_INSYSMEM ? "SFLAG_INSYSMEM" : flag =3D=3D =
SFLAG_INDRAWABLE ? "SFLAG_INDRAWABLE" : "SFLAG_INTEXTURE",=0A=
@@ -4103,6 +4104,13 @@ static void WINAPI =
IWineD3DSurfaceImpl_ModifyLocation(IWineD3DSurface *iface, DW=0A=
         }=0A=
         This->Flags &=3D ~SFLAG_LOCATIONS;=0A=
         This->Flags |=3D flag;=0A=
+=0A=
+        /* Redraw emulated overlays, if any */=0A=
+        if(flag & SFLAG_INDRAWABLE && !list_empty(&This->overlays)) {=0A=
+            LIST_FOR_EACH_ENTRY(overlay, &This->overlays, =
IWineD3DSurfaceImpl, overlay_entry) {=0A=
+                IWineD3DSurface_DrawOverlay((IWineD3DSurface *) =
overlay);=0A=
+            }=0A=
+        }=0A=
     } else {=0A=
         if((This->Flags & SFLAG_INTEXTURE) && (flag & SFLAG_INTEXTURE)) =
{=0A=
             if (IWineD3DSurface_GetContainer(iface, =
&IID_IWineD3DBaseTexture, (void **)&texture) =3D=3D WINED3D_OK) {=0A=
@@ -4550,13 +4558,22 @@ static WINED3DSURFTYPE WINAPI =
IWineD3DSurfaceImpl_GetImplType(IWineD3DSurface *i=0A=
 static HRESULT WINAPI IWineD3DSurfaceImpl_DrawOverlay(IWineD3DSurface =
*iface) {=0A=
     IWineD3DSurfaceImpl *This =3D (IWineD3DSurfaceImpl *) iface;=0A=
     HRESULT hr;=0A=
+    static BOOL recursive =3D FALSE;=0A=
 =0A=
     /* If there's no destination surface there is nothing to do */=0A=
     if(!This->overlay_dest) return WINED3D_OK;=0A=
 =0A=
+    /* Blt calls ModifyLocation on the dest surface, which in turn =
calls DrawOverlay to=0A=
+     * update the overlay. Prevent an endless recursion=0A=
+     */=0A=
+    if(recursive) {=0A=
+        return WINED3D_OK;=0A=
+    }=0A=
+    recursive =3D TRUE;=0A=
     hr =3D IWineD3DSurfaceImpl_Blt((IWineD3DSurface *) =
This->overlay_dest, &This->overlay_destrect,=0A=
                                  iface, &This->overlay_srcrect, =
WINEDDBLT_WAIT,=0A=
                                  NULL, WINED3DTEXF_LINEAR);=0A=
+    recursive =3D FALSE;=0A=
 =0A=
     return hr;=0A=
 }=0A=
-- =0A=
1.5.4.5=0A=
=0A=

------=_NextPart_000_0005_01C901F1.878F9590--




More information about the wine-patches mailing list