From 1f49ed0438caab4dd48d8f13840fe0d0ffeea792 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 10 Nov 2015 22:23:49 +0100 Subject: [PATCH] Move d3d_set_viewport up --- gfx/d3d/d3d.cpp | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/gfx/d3d/d3d.cpp b/gfx/d3d/d3d.cpp index 776fa8c887..b9a77ec0d6 100644 --- a/gfx/d3d/d3d.cpp +++ b/gfx/d3d/d3d.cpp @@ -269,6 +269,29 @@ static bool d3d_init_base(void *data, const video_info_t *info) return true; } +static void d3d_set_viewport(d3d_video_t *d3d, int x, int y, + unsigned width, unsigned height) +{ + D3DVIEWPORT viewport; + + /* D3D doesn't support negative X/Y viewports ... */ + if (x < 0) + x = 0; + if (y < 0) + y = 0; + + viewport.X = x; + viewport.Y = y; + viewport.Width = width; + viewport.Height = height; + viewport.MinZ = 0.0f; + viewport.MaxZ = 1.0f; + + d3d->final_viewport = viewport; + + d3d_set_font_rect(d3d, NULL); +} + static void d3d_set_viewport_wrap(void *data, unsigned width, unsigned height, bool force_full, @@ -421,28 +444,6 @@ static bool d3d_initialize(d3d_video_t *d3d, const video_info_t *info) return true; } -static void d3d_set_viewport(d3d_video_t *d3d, int x, int y, - unsigned width, unsigned height) -{ - D3DVIEWPORT viewport; - - /* D3D doesn't support negative X/Y viewports ... */ - if (x < 0) - x = 0; - if (y < 0) - y = 0; - - viewport.X = x; - viewport.Y = y; - viewport.Width = width; - viewport.Height = height; - viewport.MinZ = 0.0f; - viewport.MaxZ = 1.0f; - - d3d->final_viewport = viewport; - - d3d_set_font_rect(d3d, NULL); -} bool d3d_restore(d3d_video_t *d3d)