ddraw: Clear DDSD_LINEARSIZE on uncompressed surfaces.

oldstable
Henri Verbeet 2014-06-12 11:52:28 +02:00 committed by Alexandre Julliard
parent 7e33bc7a47
commit 64a5dc11bf
5 changed files with 26 additions and 5 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);