-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2014-04-04 13:57, schrieb Patrick Rudolph:
- static struct
- {
const char *name;
DDPIXELFORMAT fmt;
- }
- formats[] =
You can make this const.
/* 6: Test maximum surface height */
{DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT, DDSCAPS_OFFSCREENPLAIN, 1, 0x10000, DDERR_INVALIDPARAMS},
/* 7: Test maximum surface width */
{DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT, DDSCAPS_OFFSCREENPLAIN, 0x10000, 1, DDERR_INVALIDPARAMS},
These tests fail on Wine. Please include your patch that introduces the size check in this patch or in a separate patch to apply before this one, or mark them todo_wine.
/* 8: Test OUTOFVIDEOMEMORY */
{DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT, DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY,
0xffff, 0xffff, DDERR_OUTOFVIDEOMEMORY},
This also fails on Wine. You'll have to move the adapter_adjust_memory() call in dlls/wined3d/resource.c, resource_init() ahead of the memory allocation call.
/* 9: Test OUTOFMEMORY */
{DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT, DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY,
0xffff, 0xffff, DDERR_OUTOFMEMORY},
This test still fails in 64 bit on my Windows 7 test machine with D3DFMT_P8. The failure happens because CreateSurface succeeds although the test expects it to fail. I'd suggest to remove this test for the same reason as test 10.
- /* does the hardware support videomemory ? */
- if (!(ddcaps.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
- {
tests[8].hr = DDERR_NODIRECTDRAWHW;
- }
You can remove the curly brackets here.
for (i = 0; i < sizeof(tests) / sizeof(*tests); i ++)
{
if (surface)
{
IDirectDrawSurface_Release(surface);
surface = NULL;
}
memset(&surfacedesc, 0, sizeof(surfacedesc));
surfacedesc.dwSize = sizeof(surfacedesc);
surfacedesc.dwFlags = tests[i].dwFlags | DDSD_PIXELFORMAT;
surfacedesc.ddsCaps.dwCaps = tests[i].dwCaps;
surfacedesc.dwWidth = tests[i].dwWidth;
surfacedesc.dwHeight = tests[i].dwHeight;
surfacedesc.ddpfPixelFormat = formats[j].fmt;
hr = IDirectDraw_CreateSurface(ddraw, &surfacedesc, &surface, NULL);
ok(hr == tests[i].hr, "Pixelformat %s, test %d returned %08x\n", formats[j].name, i, hr);
}
Why is the surface release before the create call? You're potentially leaking surfaces here.