Module: wine
Branch: master
Commit: 8ca711f4286343fb4e5a8116722771a1334f60e2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8ca711f4286343fb4e5a81167…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Wed May 7 15:16:38 2014 +0200
ddraw/tests: Test palette alpha behavior.
What I care about here is that setting peFlags != 0 doesn't cause errors
either during ddraw palette creation or DIB section creation. peFlags
isn't an alpha channel, but P8 textures abuse it that way, hence the
name of the test. It probably has deeper meaning in DDSCL_NORMAL when
the X server is running in 8 bit paletteindexed mode, but I don't think
we really care about this.
---
dlls/ddraw/tests/ddraw1.c | 158 ++++++++++++++++++++++++++++++++++++++++++
dlls/ddraw/tests/ddraw2.c | 166 +++++++++++++++++++++++++++++++++++++++++++++
dlls/ddraw/tests/ddraw4.c | 154 +++++++++++++++++++++++++++++++++++++++++
dlls/ddraw/tests/ddraw7.c | 154 +++++++++++++++++++++++++++++++++++++++++
4 files changed, 632 insertions(+)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=8ca711f4286343fb4e5a8…
Module: wine
Branch: master
Commit: 19f45af19cd0c1162f15d6779506431d1cd99d8c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=19f45af19cd0c1162f15d6779…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Wed May 7 15:16:34 2014 +0200
wined3d: Copy the DIB to sysmem when PIN_SYSMEM is set.
---
dlls/wined3d/surface.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index cd3b5a2..dc8c595 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3234,8 +3234,19 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
surface->resource.map_count--;
surface->flags &= ~SFLAG_DCINUSE;
- if (surface->map_binding == WINED3D_LOCATION_USER_MEMORY)
- surface_load_location(surface, WINED3D_LOCATION_USER_MEMORY);
+ if (surface->map_binding == WINED3D_LOCATION_USER_MEMORY || (surface->flags & SFLAG_PIN_SYSMEM
+ && surface->map_binding != WINED3D_LOCATION_DIB))
+ {
+ /* The game Salammbo modifies the surface contents without mapping the surface between
+ * a GetDC/ReleaseDC operation and flipping the surface. If the DIB remains the active
+ * copy and is copied to the screen, this update, which draws the mouse pointer, is lost.
+ * Do not only copy the DIB to the map location, but also make sure the map location is
+ * copied back to the DIB in the next getdc call.
+ *
+ * The same consideration applies to user memory surfaces. */
+ surface_load_location(surface, surface->map_binding);
+ surface_invalidate_location(surface, WINED3D_LOCATION_DIB);
+ }
return WINED3D_OK;
}