diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index ce9edf6a2d3..fce1c22caea 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -28,9 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw); -static struct wined3d_display_mode original_mode; static const struct ddraw *exclusive_ddraw; -static BOOL restore_mode; /* Device identifier. Don't relay it to WineD3D */ static const DDDEVICEIDENTIFIER2 deviceidentifier = @@ -684,11 +682,8 @@ static HRESULT WINAPI ddraw7_RestoreDisplayMode(IDirectDraw7 *iface) return DDERR_NOEXCLUSIVEMODE; } - if (SUCCEEDED(hr = wined3d_set_adapter_display_mode(ddraw->wined3d, WINED3DADAPTER_DEFAULT, &original_mode))) - { + if (SUCCEEDED(hr = wined3d_set_adapter_display_mode(ddraw->wined3d, WINED3DADAPTER_DEFAULT, NULL))) ddraw->flags &= ~DDRAW_RESTORE_MODE; - restore_mode = FALSE; - } wined3d_mutex_unlock(); @@ -1097,10 +1092,6 @@ static HRESULT WINAPI ddraw7_SetDisplayMode(IDirectDraw7 *iface, DWORD width, DW return DD_OK; } - if (!restore_mode && FAILED(hr = wined3d_get_adapter_display_mode(ddraw->wined3d, - WINED3DADAPTER_DEFAULT, &original_mode, NULL))) - ERR("Failed to get current display mode, hr %#x.\n", hr); - switch (bpp) { case 8: format = WINED3DFMT_P8_UINT; break; @@ -1121,10 +1112,7 @@ static HRESULT WINAPI ddraw7_SetDisplayMode(IDirectDraw7 *iface, DWORD width, DW * can't be changed if a surface is locked or some drawing is in progress. */ /* TODO: Lose the primary surface. */ if (SUCCEEDED(hr = wined3d_set_adapter_display_mode(ddraw->wined3d, WINED3DADAPTER_DEFAULT, &mode))) - { ddraw->flags |= DDRAW_RESTORE_MODE; - restore_mode = TRUE; - } wined3d_mutex_unlock(); diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index e48dbab9f12..6ab51fad0e7 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -2410,13 +2410,13 @@ static void test_coop_level_mode_set(void) ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; - todo_wine ok(screen_size.cx == registry_mode.dmPelsWidth + ok(screen_size.cx == registry_mode.dmPelsWidth && screen_size.cy == registry_mode.dmPelsHeight, "Expected screen size %ux%u, got %ux%u.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, screen_size.cx, screen_size.cy); GetWindowRect(window, &r); - todo_wine ok(EqualRect(&r, ®istry_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.\n", + ok(EqualRect(&r, ®istry_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.\n", registry_rect.left, registry_rect.top, registry_rect.right, registry_rect.bottom, r.left, r.top, r.right, r.bottom); @@ -2584,7 +2584,7 @@ static void test_coop_level_mode_set(void) ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode); ok(ret, "Failed to get display mode.\n"); - todo_wine ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth + ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth && devmode.dmPelsHeight == registry_mode.dmPelsHeight, "Expected resolution %ux%u, got %ux%u.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, @@ -2740,7 +2740,7 @@ static void test_coop_level_mode_set(void) ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode); ok(ret, "Failed to get display mode.\n"); - todo_wine ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth + ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth && devmode.dmPelsHeight == registry_mode.dmPelsHeight, "Expected resolution %ux%u, got %ux%u.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index b4c3da539fc..b79aed6c065 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -2616,13 +2616,13 @@ static void test_coop_level_mode_set(void) ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; - todo_wine ok(screen_size.cx == registry_mode.dmPelsWidth + ok(screen_size.cx == registry_mode.dmPelsWidth && screen_size.cy == registry_mode.dmPelsHeight, "Expected screen size %ux%u, got %ux%u.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, screen_size.cx, screen_size.cy); GetWindowRect(window, &r); - todo_wine ok(EqualRect(&r, ®istry_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.\n", + ok(EqualRect(&r, ®istry_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.\n", registry_rect.left, registry_rect.top, registry_rect.right, registry_rect.bottom, r.left, r.top, r.right, r.bottom); @@ -2790,7 +2790,7 @@ static void test_coop_level_mode_set(void) ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode); ok(ret, "Failed to get display mode.\n"); - todo_wine ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth + ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth && devmode.dmPelsHeight == registry_mode.dmPelsHeight, "Expected resolution %ux%u, got %ux%u.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, @@ -2946,7 +2946,7 @@ static void test_coop_level_mode_set(void) ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode); ok(ret, "Failed to get display mode.\n"); - todo_wine ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth + ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth && devmode.dmPelsHeight == registry_mode.dmPelsHeight, "Expected resolution %ux%u, got %ux%u.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 7e4d046e8ab..fb20d702a87 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -2803,13 +2803,13 @@ static void test_coop_level_mode_set(void) ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; - todo_wine ok(screen_size.cx == registry_mode.dmPelsWidth + ok(screen_size.cx == registry_mode.dmPelsWidth && screen_size.cy == registry_mode.dmPelsHeight, "Expected screen size %ux%u, got %ux%u.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, screen_size.cx, screen_size.cy); GetWindowRect(window, &r); - todo_wine ok(EqualRect(&r, ®istry_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.\n", + ok(EqualRect(&r, ®istry_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.\n", registry_rect.left, registry_rect.top, registry_rect.right, registry_rect.bottom, r.left, r.top, r.right, r.bottom); @@ -2970,7 +2970,7 @@ static void test_coop_level_mode_set(void) ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode); ok(ret, "Failed to get display mode.\n"); - todo_wine ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth + ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth && devmode.dmPelsHeight == registry_mode.dmPelsHeight, "Expected resolution %ux%u, got %ux%u.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, @@ -3126,7 +3126,7 @@ static void test_coop_level_mode_set(void) ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode); ok(ret, "Failed to get display mode.\n"); - todo_wine ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth + ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth && devmode.dmPelsHeight == registry_mode.dmPelsHeight, "Expected resolution %ux%u, got %ux%u.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index f1f394a341d..9263e1ec0cf 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -2480,13 +2480,13 @@ static void test_coop_level_mode_set(void) ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message); expect_messages = NULL; - todo_wine ok(screen_size.cx == registry_mode.dmPelsWidth + ok(screen_size.cx == registry_mode.dmPelsWidth && screen_size.cy == registry_mode.dmPelsHeight, "Expected screen size %ux%u, got %ux%u.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, screen_size.cx, screen_size.cy); GetWindowRect(window, &r); - todo_wine ok(EqualRect(&r, ®istry_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.\n", + ok(EqualRect(&r, ®istry_rect), "Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.\n", registry_rect.left, registry_rect.top, registry_rect.right, registry_rect.bottom, r.left, r.top, r.right, r.bottom); @@ -2647,7 +2647,7 @@ static void test_coop_level_mode_set(void) ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode); ok(ret, "Failed to get display mode.\n"); - todo_wine ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth + ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth && devmode.dmPelsHeight == registry_mode.dmPelsHeight, "Expected resolution %ux%u, got %ux%u.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, @@ -2803,7 +2803,7 @@ static void test_coop_level_mode_set(void) ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode); ok(ret, "Failed to get display mode.\n"); - todo_wine ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth + ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth && devmode.dmPelsHeight == registry_mode.dmPelsHeight, "Expected resolution %ux%u, got %ux%u.\n", registry_mode.dmPelsWidth, registry_mode.dmPelsHeight,