Henri Verbeet : ddraw: Require DDSCAPS_FLIP and DDSCAPS_COMPLEX to be used together.
Alexandre Julliard
julliard at winehq.org
Thu Dec 5 12:49:16 CST 2013
Module: wine
Branch: master
Commit: 23f47b573e3836e6e19729b75bd823e696e9f3f4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=23f47b573e3836e6e19729b75bd823e696e9f3f4
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Thu Dec 5 10:34:14 2013 +0100
ddraw: Require DDSCAPS_FLIP and DDSCAPS_COMPLEX to be used together.
---
dlls/ddraw/surface.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 79d5b31..7cb18a1 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -5629,6 +5629,8 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
if (desc->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
{
+ DWORD flippable = desc->ddsCaps.dwCaps & (DDSCAPS_FLIP | DDSCAPS_COMPLEX);
+
if (desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)
{
WARN("Tried to create a primary surface with DDSCAPS_TEXTURE.\n");
@@ -5636,11 +5638,21 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
return DDERR_INVALIDCAPS;
}
- if ((desc->ddsCaps.dwCaps & DDSCAPS_FLIP) && !(ddraw->cooperative_level & DDSCL_EXCLUSIVE))
+ if (flippable)
{
- WARN("Tried to create a flippable primary surface without DDSCL_EXCLUSIVE.\n");
- HeapFree(GetProcessHeap(), 0, texture);
- return DDERR_NOEXCLUSIVEMODE;
+ if (flippable != (DDSCAPS_FLIP | DDSCAPS_COMPLEX))
+ {
+ WARN("Tried to create a flippable primary surface without both DDSCAPS_FLIP and DDSCAPS_COMPLEX.\n");
+ HeapFree(GetProcessHeap(), 0, texture);
+ return DDERR_INVALIDCAPS;
+ }
+
+ if (!(ddraw->cooperative_level & DDSCL_EXCLUSIVE))
+ {
+ WARN("Tried to create a flippable primary surface without DDSCL_EXCLUSIVE.\n");
+ HeapFree(GetProcessHeap(), 0, texture);
+ return DDERR_NOEXCLUSIVEMODE;
+ }
}
}
More information about the wine-cvs
mailing list