Module: wine Branch: master Commit: 4d94a1e651a286ab495895724c24794b2ab3cc4f URL: http://source.winehq.org/git/wine.git/?a=commit;h=4d94a1e651a286ab495895724c...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Mon Jan 25 23:18:33 2016 +0100
ddraw: DDSCAPS_ALLOCONLOAD requires DDSCAPS_TEXTURE.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ddraw/surface.c | 5 +++-- dlls/ddraw/tests/ddraw1.c | 7 +++++++ dlls/ddraw/tests/ddraw2.c | 7 +++++++ dlls/ddraw/tests/ddraw4.c | 7 +++++++ dlls/ddraw/tests/ddraw7.c | 7 +++++++ 5 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index f43eb30..d8754a3 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -5733,9 +5733,10 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ return DDERR_INVALIDCAPS; }
- if ((desc->ddsCaps.dwCaps & DDSCAPS_MIPMAP) && !(desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)) + if ((desc->ddsCaps.dwCaps & (DDSCAPS_ALLOCONLOAD | DDSCAPS_MIPMAP)) + && !(desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)) { - WARN("DDSCAPS_MIPMAP requested without DDSCAPS_TEXTURE.\n"); + WARN("Caps %#x require DDSCAPS_TEXTURE.\n", desc->ddsCaps.dwCaps); HeapFree(GetProcessHeap(), 0, texture); return DDERR_INVALIDCAPS; } diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 4784c15..dcadaf5 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -4930,15 +4930,22 @@ static void test_create_surface_pitch(void) DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, 0, 0, 0 }, /* 10 */ + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 }, {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 }, + /* 15 */ {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, 0, 0, 0 }, diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index f8d19b4..62f1974 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -5972,15 +5972,22 @@ static void test_create_surface_pitch(void) DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, 0, 0, 0 }, /* 10 */ + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 }, {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 }, + /* 15 */ {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, 0, 0, 0 }, diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index dd1b666..9239930 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -7512,12 +7512,19 @@ static void test_create_surface_pitch(void) {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, DDSD_LPSURFACE | DDSD_PITCH | DDSD_LINEARSIZE, 0x100, DD_OK, DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 }, {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, + /* 20 */ {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 }, diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index d5b6145..34167c1 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -7360,12 +7360,19 @@ static void test_create_surface_pitch(void) {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN, DDSD_LPSURFACE | DDSD_PITCH | DDSD_LINEARSIZE, 0x100, DD_OK, DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 }, {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, + 0, 0, DDERR_INVALIDCAPS, + 0, 0, 0 }, + /* 20 */ {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 },