From 332bcc7f9e5355304e8c12cd9f63acd6b574dd42 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 3 Aug 2020 15:48:08 +0200 Subject: [PATCH] Remove dxgi_update_title --- gfx/common/dxgi_common.c | 19 ------------------- gfx/common/dxgi_common.h | 2 -- gfx/common/win32_common.c | 27 ++++++++++++--------------- gfx/common/x11_common.c | 18 ++++++++---------- gfx/drivers/d3d10.c | 17 ++++++++++++++++- gfx/drivers/d3d11.c | 17 ++++++++++++++++- gfx/drivers/d3d12.c | 17 ++++++++++++++++- 7 files changed, 68 insertions(+), 49 deletions(-) diff --git a/gfx/common/dxgi_common.c b/gfx/common/dxgi_common.c index 846fc7468d..de282eb368 100644 --- a/gfx/common/dxgi_common.c +++ b/gfx/common/dxgi_common.c @@ -297,25 +297,6 @@ void dxgi_copy( #pragma warning(default : 4293) #endif -void dxgi_update_title(void) -{ -#ifndef __WINRT__ - const ui_window_t* window = ui_companion_driver_get_window_ptr(); - - if (window) - { - char title[128]; - - title[0] = '\0'; - - video_driver_get_window_title(title, sizeof(title)); - - if (title[0]) - window->set_title(&main_window, title); - } -#endif -} - DXGI_FORMAT glslang_format_to_dxgi(glslang_format fmt) { #undef FMT_ diff --git a/gfx/common/dxgi_common.h b/gfx/common/dxgi_common.h index 2a391a9da7..0ed843f294 100644 --- a/gfx/common/dxgi_common.h +++ b/gfx/common/dxgi_common.h @@ -830,8 +830,6 @@ void dxgi_copy( int dst_pitch, void* dst_data); -void dxgi_update_title(void); - DXGI_FORMAT glslang_format_to_dxgi(glslang_format fmt); RETRO_END_DECLS diff --git a/gfx/common/win32_common.c b/gfx/common/win32_common.c index b4d8469c11..3e013fe448 100644 --- a/gfx/common/win32_common.c +++ b/gfx/common/win32_common.c @@ -277,20 +277,6 @@ typedef REASON_CONTEXT POWER_REQUEST_CONTEXT, *PPOWER_REQUEST_CONTEXT, *LPPOWER_ #define INT_PTR_COMPAT INT_PTR #endif - -/* TODO/FIXME - globals */ -bool g_win32_restore_desktop = false; -static bool taskbar_is_created = false; -bool g_win32_inited = false; - -unsigned g_win32_resize_width = 0; -unsigned g_win32_resize_height = 0; - -ui_window_win32_t main_window; - -static HMONITOR win32_monitor_last; -static HMONITOR win32_monitor_all[MAX_MONITORS]; - typedef struct win32_common_state { int pos_x; @@ -303,6 +289,18 @@ typedef struct win32_common_state bool resized; } win32_common_state_t; +/* TODO/FIXME - globals */ +bool g_win32_restore_desktop = false; +bool g_win32_inited = false; +unsigned g_win32_resize_width = 0; +unsigned g_win32_resize_height = 0; +ui_window_win32_t main_window; + +/* TODO/FIXME - static globals */ +static bool taskbar_is_created = false; +static HMONITOR win32_monitor_last; +static HMONITOR win32_monitor_all[MAX_MONITORS]; + static win32_common_state_t win32_st = { CW_USEDEFAULT, /* pos_x */ @@ -315,7 +313,6 @@ static win32_common_state_t win32_st = false /* resized */ }; - bool win32_taskbar_is_created(void) { return taskbar_is_created; diff --git a/gfx/common/x11_common.c b/gfx/common/x11_common.c index 93c6e60c9a..6f6b619576 100644 --- a/gfx/common/x11_common.c +++ b/gfx/common/x11_common.c @@ -57,25 +57,23 @@ #define MOVERESIZE_X_SHIFT 8 #define MOVERESIZE_Y_SHIFT 9 -#define V_DBLSCAN 0x20 +#define V_DBLSCAN 0x20 /* TODO/FIXME - globals */ +bool g_x11_entered = false; +Display *g_x11_dpy = NULL; +unsigned g_x11_screen = 0; +Window g_x11_win = None; +Colormap g_x11_cmap; + +/* TODO/FIXME - static globals */ static XF86VidModeModeInfo desktop_mode; static bool xdg_screensaver_available = true; -bool g_x11_entered = false; static bool g_x11_has_focus = false; static bool g_x11_true_full = false; -Display *g_x11_dpy = NULL; - -unsigned g_x11_screen = 0; - -Colormap g_x11_cmap; -Window g_x11_win = None; - static Atom XA_NET_WM_STATE; static Atom XA_NET_WM_STATE_FULLSCREEN; static Atom XA_NET_MOVERESIZE_WINDOW; - static Atom g_x11_quit_atom; static XIM g_x11_xim; static XIC g_x11_xic; diff --git a/gfx/drivers/d3d10.c b/gfx/drivers/d3d10.c index 36091a401d..aaea336ada 100644 --- a/gfx/drivers/d3d10.c +++ b/gfx/drivers/d3d10.c @@ -1519,7 +1519,22 @@ static bool d3d10_gfx_frame( D3D10SetBlendState(d3d10->device, d3d10->blend_enable, NULL, D3D10_DEFAULT_SAMPLE_MASK); D3D10SetVertexBuffer(d3d10->device, 0, d3d10->sprites.vbo, sizeof(d3d10_sprite_t), 0); font_driver_render_msg(d3d10, msg, NULL, NULL); - dxgi_update_title(); +#ifndef __WINRT__ + { + const ui_window_t* window = ui_companion_driver_get_window_ptr(); + if (window) + { + char title[128]; + + title[0] = '\0'; + + video_driver_get_window_title(title, sizeof(title)); + + if (title[0]) + window->set_title(&main_window, title); + } + } +#endif } d3d10->sprites.enabled = false; diff --git a/gfx/drivers/d3d11.c b/gfx/drivers/d3d11.c index dba1c399d6..c78eeac4a7 100644 --- a/gfx/drivers/d3d11.c +++ b/gfx/drivers/d3d11.c @@ -1594,7 +1594,22 @@ static bool d3d11_gfx_frame( D3D11SetBlendState(d3d11->context, d3d11->blend_enable, NULL, D3D11_DEFAULT_SAMPLE_MASK); D3D11SetVertexBuffer(context, 0, d3d11->sprites.vbo, sizeof(d3d11_sprite_t), 0); font_driver_render_msg(d3d11, msg, NULL, NULL); - dxgi_update_title(); +#ifndef __WINRT__ + { + const ui_window_t* window = ui_companion_driver_get_window_ptr(); + if (window) + { + char title[128]; + + title[0] = '\0'; + + video_driver_get_window_title(title, sizeof(title)); + + if (title[0]) + window->set_title(&main_window, title); + } + } +#endif } d3d11->sprites.enabled = false; diff --git a/gfx/drivers/d3d12.c b/gfx/drivers/d3d12.c index 35b3779933..dd891b5960 100644 --- a/gfx/drivers/d3d12.c +++ b/gfx/drivers/d3d12.c @@ -1584,7 +1584,22 @@ static bool d3d12_gfx_frame( D3D12IASetVertexBuffers(d3d12->queue.cmd, 0, 1, &d3d12->sprites.vbo_view); font_driver_render_msg(d3d12, msg, NULL, NULL); - dxgi_update_title(); +#ifndef __WINRT__ + { + const ui_window_t* window = ui_companion_driver_get_window_ptr(); + if (window) + { + char title[128]; + + title[0] = '\0'; + + video_driver_get_window_title(title, sizeof(title)); + + if (title[0]) + window->set_title(&main_window, title); + } + } +#endif } d3d12->sprites.enabled = false;