From 64a5dc11bf20b8a4b8a581657912bea3d713598e Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 12 Jun 2014 11:52:28 +0200 Subject: [PATCH] ddraw: Clear DDSD_LINEARSIZE on uncompressed surfaces. --- dlls/ddraw/surface.c | 3 ++- dlls/ddraw/tests/ddraw1.c | 4 +++- dlls/ddraw/tests/ddraw2.c | 4 +++- dlls/ddraw/tests/ddraw4.c | 10 +++++++++- dlls/ddraw/tests/ddraw7.c | 10 +++++++++- 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 3f230a2cbe0..a326404a009 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -6127,6 +6127,7 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, s else if (!(desc->dwFlags & DDSD_LPSURFACE)) { desc->dwFlags |= DDSD_PITCH; + desc->dwFlags &= ~DDSD_LINEARSIZE; desc->u1.lPitch = wined3d_surface_get_pitch(wined3d_surface); } @@ -6147,7 +6148,7 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, s return hr; } - desc->dwFlags &= ~DDSD_LPSURFACE; + desc->dwFlags &= ~(DDSD_LPSURFACE | DDSD_LINEARSIZE); } wined3d_surface_incref(wined3d_surface); diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index df74488e112..c5198f5d25f 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -4522,12 +4522,14 @@ static void test_create_surface_pitch(void) DDSD_PITCH, 0x100, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH | DDSD_LINEARSIZE, 0, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, 0, 0, 0 }, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, 0, 0, 0 }, }; - DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE; + DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE | DDSD_LINEARSIZE; window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 2ca704739d6..f07a1bd469c 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -5598,12 +5598,14 @@ static void test_create_surface_pitch(void) DDSD_PITCH, 0x100, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH | DDSD_LINEARSIZE, 0, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, 0, 0, 0 }, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, 0, 0, 0 }, }; - DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE; + DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE | DDSD_LINEARSIZE; window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index ec53ae667f2..b515acc0c14 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -6493,6 +6493,8 @@ static void test_create_surface_pitch(void) DDSD_PITCH, 0x100, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH | DDSD_LINEARSIZE, 0, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, 0, 0, 0 }, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DD_OK, @@ -6503,8 +6505,14 @@ static void test_create_surface_pitch(void) DDSD_PITCH, 0x0fc, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0f8, DDERR_INVALIDPARAMS, 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_LINEARSIZE, 0x100, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_LINEARSIZE, 0x3f00, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH | DDSD_LINEARSIZE, 0x100, DD_OK, + DDSD_PITCH, 0x100, 0x100}, }; - DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE; + DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE | DDSD_LINEARSIZE; window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index c90d89b3dc6..7ed2f001a1a 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -6316,6 +6316,8 @@ static void test_create_surface_pitch(void) DDSD_PITCH, 0x100, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH | DDSD_LINEARSIZE, 0, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, 0, 0, 0 }, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DD_OK, @@ -6326,8 +6328,14 @@ static void test_create_surface_pitch(void) DDSD_PITCH, 0x0fc, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0f8, DDERR_INVALIDPARAMS, 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_LINEARSIZE, 0x100, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_LINEARSIZE, 0x3f00, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH | DDSD_LINEARSIZE, 0x100, DD_OK, + DDSD_PITCH, 0x100, 0x100}, }; - DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE; + DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE | DDSD_LINEARSIZE; window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0);