[PATCH 2/5] ddraw: Clear DDSD_LINEARSIZE on uncompressed surfaces.
Henri Verbeet
hverbeet at codeweavers.com
Thu Jun 12 04:52:28 CDT 2014
---
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 3f230a2..a326404 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 df74488..c5198f5 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 2ca7047..f07a1bd 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 ec53ae6..b515acc 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 c90d89b..7ed2f00 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);
--
1.7.10.4
More information about the wine-patches
mailing list