ddraw/tests: Skip the overlay tests in test_block_formats_creation() if overlays are not supported.
This commit is contained in:
parent
cf5023bfff
commit
82780d6ba6
|
@ -4043,6 +4043,8 @@ static void test_block_formats_creation(void)
|
||||||
DWORD supported_fmts = 0, supported_overlay_fmts = 0;
|
DWORD supported_fmts = 0, supported_overlay_fmts = 0;
|
||||||
DWORD num_fourcc_codes = 0, *fourcc_codes;
|
DWORD num_fourcc_codes = 0, *fourcc_codes;
|
||||||
DDSURFACEDESC2 ddsd;
|
DDSURFACEDESC2 ddsd;
|
||||||
|
DDCAPS hal_caps;
|
||||||
|
|
||||||
static const struct
|
static const struct
|
||||||
{
|
{
|
||||||
DWORD fourcc;
|
DWORD fourcc;
|
||||||
|
@ -4132,12 +4134,19 @@ static void test_block_formats_creation(void)
|
||||||
}
|
}
|
||||||
HeapFree(GetProcessHeap(), 0, fourcc_codes);
|
HeapFree(GetProcessHeap(), 0, fourcc_codes);
|
||||||
|
|
||||||
|
memset(&hal_caps, 0, sizeof(hal_caps));
|
||||||
|
hal_caps.dwSize = sizeof(hal_caps);
|
||||||
|
hr = IDirectDraw4_GetCaps(ddraw, &hal_caps, NULL);
|
||||||
|
ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr);
|
||||||
|
|
||||||
for (i = 0; i < sizeof(formats) / sizeof(*formats); i++)
|
for (i = 0; i < sizeof(formats) / sizeof(*formats); i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < sizeof(types) / sizeof(*types); j++)
|
for (j = 0; j < sizeof(types) / sizeof(*types); j++)
|
||||||
{
|
{
|
||||||
BOOL support;
|
BOOL support;
|
||||||
if (formats[i].overlay != types[j].overlay)
|
|
||||||
|
if (formats[i].overlay != types[j].overlay
|
||||||
|
|| (types[j].overlay && !(hal_caps.dwCaps & DDCAPS_OVERLAY)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (formats[i].overlay)
|
if (formats[i].overlay)
|
||||||
|
|
|
@ -3850,6 +3850,8 @@ static void test_block_formats_creation(void)
|
||||||
DWORD supported_fmts = 0, supported_overlay_fmts = 0;
|
DWORD supported_fmts = 0, supported_overlay_fmts = 0;
|
||||||
DWORD num_fourcc_codes = 0, *fourcc_codes;
|
DWORD num_fourcc_codes = 0, *fourcc_codes;
|
||||||
DDSURFACEDESC2 ddsd;
|
DDSURFACEDESC2 ddsd;
|
||||||
|
DDCAPS hal_caps;
|
||||||
|
|
||||||
static const struct
|
static const struct
|
||||||
{
|
{
|
||||||
DWORD fourcc;
|
DWORD fourcc;
|
||||||
|
@ -3939,12 +3941,19 @@ static void test_block_formats_creation(void)
|
||||||
}
|
}
|
||||||
HeapFree(GetProcessHeap(), 0, fourcc_codes);
|
HeapFree(GetProcessHeap(), 0, fourcc_codes);
|
||||||
|
|
||||||
|
memset(&hal_caps, 0, sizeof(hal_caps));
|
||||||
|
hal_caps.dwSize = sizeof(hal_caps);
|
||||||
|
hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, NULL);
|
||||||
|
ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr);
|
||||||
|
|
||||||
for (i = 0; i < sizeof(formats) / sizeof(*formats); i++)
|
for (i = 0; i < sizeof(formats) / sizeof(*formats); i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < sizeof(types) / sizeof(*types); j++)
|
for (j = 0; j < sizeof(types) / sizeof(*types); j++)
|
||||||
{
|
{
|
||||||
BOOL support;
|
BOOL support;
|
||||||
if (formats[i].overlay != types[j].overlay)
|
|
||||||
|
if (formats[i].overlay != types[j].overlay
|
||||||
|
|| (types[j].overlay && !(hal_caps.dwCaps & DDCAPS_OVERLAY)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (formats[i].overlay)
|
if (formats[i].overlay)
|
||||||
|
|
Loading…
Reference in New Issue