diff --git a/gfx/context/d3d_ctx.cpp b/gfx/context/d3d_ctx.cpp index 3ed67d7f55..3a1549091d 100644 --- a/gfx/context/d3d_ctx.cpp +++ b/gfx/context/d3d_ctx.cpp @@ -49,7 +49,6 @@ extern bool d3d_restore(void *data); static void d3d_resize(void *data, unsigned new_width, unsigned new_height) { (void)data; -#ifndef _XBOX d3d_video_t *d3d = (d3d_video_t*)curD3D; LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev; if (!d3dr) @@ -63,7 +62,6 @@ static void d3d_resize(void *data, unsigned new_width, unsigned new_height) d3d->video_info.height = d3d->screen_height = new_height; d3d_restore(d3d); } -#endif } #ifdef HAVE_WINDOW diff --git a/gfx/d3d9/d3d.cpp b/gfx/d3d9/d3d.cpp index fa94b5922f..feac8a2ca8 100644 --- a/gfx/d3d9/d3d.cpp +++ b/gfx/d3d9/d3d.cpp @@ -500,8 +500,12 @@ static bool d3d_initialize(void *data, const video_info_t *info) bool d3d_restore(void *data) { d3d_video_t *d3d = (d3d_video_t*)data; +#ifdef _XBOX + d3d->needs_restore = false; +#else d3d_deinitialize(d3d); d3d->needs_restore = !d3d_initialize(d3d, &d3d->video_info); +#endif if (d3d->needs_restore) RARCH_ERR("[D3D]: Restore error.\n"); @@ -698,13 +702,12 @@ static bool d3d_frame(void *data, const void *frame, // We cannot recover in fullscreen. if (d3d->needs_restore && IsIconic(d3d->hWnd)) return true; - +#endif if (d3d->needs_restore && !d3d_restore(d3d)) { RARCH_ERR("[D3D]: Failed to restore.\n"); return false; } -#endif if (d3d->should_resize) { diff --git a/xdk/xdk_d3d.cpp b/xdk/xdk_d3d.cpp index eea28c18c9..62f6a2fb76 100644 --- a/xdk/xdk_d3d.cpp +++ b/xdk/xdk_d3d.cpp @@ -751,19 +751,22 @@ static bool d3d_initialize(void *data, const video_info_t *info) return true; } -#ifndef _XBOX + bool d3d_restore(void *data) { d3d_video_t *d3d = (d3d_video_t*)data; +#ifdef _XBOX d3d_deinitialize(d3d); d3d->needs_restore = !d3d_initialize(d3d, &d3d->video_info); +#else + d3d->needs_restore = false; +#endif if (d3d->needs_restore) RARCH_ERR("[D3D]: Restore error.\n"); return !d3d->needs_restore; } -#endif static void d3d_set_viewport(void *data, int x, int y, unsigned width, unsigned height) { @@ -847,13 +850,12 @@ static bool d3d_frame(void *data, const void *frame, // We cannot recover in fullscreen. if (d3d->needs_restore && IsIconic(d3d->hWnd)) return true; - +#endif if (d3d->needs_restore && !d3d_restore(d3d)) { RARCH_ERR("[D3D]: Failed to restore.\n"); return false; } -#endif if (d3d->should_resize) {