From 7c1f24c861b36ac787a2b2f976b11dc30454df30 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 18 Jan 2014 21:13:08 +0100 Subject: [PATCH] (D3D) set_resize function bound to D3D context driver --- gfx/d3d9/d3d9_pc.cpp | 12 ++++++++---- gfx/d3d9/render_chain.cpp | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gfx/d3d9/d3d9_pc.cpp b/gfx/d3d9/d3d9_pc.cpp index 710d3c33d2..dcd63d0aec 100644 --- a/gfx/d3d9/d3d9_pc.cpp +++ b/gfx/d3d9/d3d9_pc.cpp @@ -35,9 +35,13 @@ static void *dinput; extern bool d3d_restore(void *data); -static void d3d_resize(void *data, unsigned new_width, unsigned new_height) +static void d3d_resize(unsigned new_width, unsigned new_height) { - D3DVideo *d3d = reinterpret_cast(data); +#ifdef _XBOX + D3DVideo *d3d = reinterpret_cast(driver.video_data); +#else + D3DVideo *d3d = reinterpret_cast(curD3D); +#endif if (!d3d->dev) return; @@ -79,7 +83,7 @@ LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, new_height = HIWORD(lParam); if (new_width && new_height) - d3d_resize(curD3D, new_width, new_height); + d3d_resize(new_width, new_height); return 0; } if (dinput_handle_message(dinput, message, wParam, lParam)) @@ -575,7 +579,7 @@ const gfx_ctx_driver_t gfx_ctx_d3d9 = { NULL, gfx_ctx_d3d_update_title, gfx_ctx_d3d_check_window, - NULL, // gfx_ctx_set_resize + d3d_resize, gfx_ctx_d3d_has_focus, gfx_ctx_d3d_swap_buffers, gfx_ctx_d3d_input_driver, diff --git a/gfx/d3d9/render_chain.cpp b/gfx/d3d9/render_chain.cpp index 96529a1415..db81878589 100644 --- a/gfx/d3d9/render_chain.cpp +++ b/gfx/d3d9/render_chain.cpp @@ -109,7 +109,7 @@ void RenderChain::clear() luts.clear(); } -void RenderChain::set_final_viewport(const D3DVIEWPORT9& final_viewport) +void RenderChain::set_final_viewport(const D3DVIEWPORT& final_viewport) { this->final_viewport = final_viewport; }