Remove gfx_display_{set/get}_driver_id

This commit is contained in:
twinaphex 2020-09-26 19:58:15 +02:00
parent 3e55f067ed
commit 14c9ccfda8
4 changed files with 17 additions and 30 deletions

View File

@ -253,19 +253,6 @@ static bool gfx_display_check_compatibility(
return false; return false;
} }
void gfx_display_set_driver_id(enum menu_driver_id_type type)
{
gfx_display_t *p_disp = disp_get_ptr();
p_disp->menu_driver_id = type;
}
enum menu_driver_id_type gfx_display_get_driver_id(void)
{
gfx_display_t *p_disp = disp_get_ptr();
return p_disp->menu_driver_id;
}
static float gfx_display_get_dpi_scale_internal(unsigned width, unsigned height) static float gfx_display_get_dpi_scale_internal(unsigned width, unsigned height)
{ {
float dpi; float dpi;

View File

@ -338,10 +338,6 @@ bool gfx_display_reset_textures_list_buffer(
int gfx_display_osk_ptr_at_pos(void *data, int x, int y, int gfx_display_osk_ptr_at_pos(void *data, int x, int y,
unsigned width, unsigned height); unsigned width, unsigned height);
enum menu_driver_id_type gfx_display_get_driver_id(void);
void gfx_display_set_driver_id(enum menu_driver_id_type type);
float gfx_display_get_dpi_scale(unsigned width, unsigned height); float gfx_display_get_dpi_scale(unsigned width, unsigned height);
float gfx_display_get_widget_dpi_scale( float gfx_display_get_widget_dpi_scale(

View File

@ -823,7 +823,9 @@ void gfx_widgets_iterate(
* factor have changed */ * factor have changed */
float scale_factor = 0.0f; float scale_factor = 0.0f;
#ifdef HAVE_XMB #ifdef HAVE_XMB
if (gfx_display_get_driver_id() == MENU_DRIVER_ID_XMB) gfx_display_t *p_disp = disp_get_ptr();
enum menu_driver_id_type type = p_disp->menu_driver_id;
if (type == MENU_DRIVER_ID_XMB)
scale_factor = gfx_display_get_widget_pixel_scale(width, height, fullscreen); scale_factor = gfx_display_get_widget_pixel_scale(width, height, fullscreen);
else else
#endif #endif
@ -1900,7 +1902,9 @@ static void gfx_widgets_context_reset(
p_dispwidget->last_video_width = width; p_dispwidget->last_video_width = width;
p_dispwidget->last_video_height = height; p_dispwidget->last_video_height = height;
#ifdef HAVE_XMB #ifdef HAVE_XMB
if (gfx_display_get_driver_id() == MENU_DRIVER_ID_XMB) gfx_display_t *p_disp = disp_get_ptr();
enum menu_driver_id_type type = p_disp->menu_driver_id;
if (type == MENU_DRIVER_ID_XMB)
p_dispwidget->last_scale_factor = gfx_display_get_widget_pixel_scale( p_dispwidget->last_scale_factor = gfx_display_get_widget_pixel_scale(
p_dispwidget->last_video_width, p_dispwidget->last_video_width,
p_dispwidget->last_video_height, fullscreen); p_dispwidget->last_video_height, fullscreen);

View File

@ -6772,8 +6772,9 @@ bool menu_driver_list_cache(menu_ctx_list_t *list)
static void menu_driver_set_id(struct rarch_state *p_rarch) static void menu_driver_set_id(struct rarch_state *p_rarch)
{ {
const char *driver_name = NULL; const char *driver_name = NULL;
gfx_display_t *p_disp = &p_rarch->dispgfx;
gfx_display_set_driver_id(MENU_DRIVER_ID_UNKNOWN); p_disp->menu_driver_id = MENU_DRIVER_ID_UNKNOWN;
if (!p_rarch->menu_driver_ctx || !p_rarch->menu_driver_ctx->ident) if (!p_rarch->menu_driver_ctx || !p_rarch->menu_driver_ctx->ident)
return; return;
@ -6784,17 +6785,15 @@ static void menu_driver_set_id(struct rarch_state *p_rarch)
return; return;
if (string_is_equal(driver_name, "rgui")) if (string_is_equal(driver_name, "rgui"))
gfx_display_set_driver_id(MENU_DRIVER_ID_RGUI); p_disp->menu_driver_id = MENU_DRIVER_ID_RGUI;
else if (string_is_equal(driver_name, "ozone")) else if (string_is_equal(driver_name, "ozone"))
gfx_display_set_driver_id(MENU_DRIVER_ID_OZONE); p_disp->menu_driver_id = MENU_DRIVER_ID_OZONE;
else if (string_is_equal(driver_name, "glui")) else if (string_is_equal(driver_name, "glui"))
gfx_display_set_driver_id(MENU_DRIVER_ID_GLUI); p_disp->menu_driver_id = MENU_DRIVER_ID_GLUI;
else if (string_is_equal(driver_name, "xmb")) else if (string_is_equal(driver_name, "xmb"))
gfx_display_set_driver_id(MENU_DRIVER_ID_XMB); p_disp->menu_driver_id = MENU_DRIVER_ID_XMB;
else if (string_is_equal(driver_name, "xui"))
gfx_display_set_driver_id(MENU_DRIVER_ID_XUI);
else if (string_is_equal(driver_name, "stripes")) else if (string_is_equal(driver_name, "stripes"))
gfx_display_set_driver_id(MENU_DRIVER_ID_STRIPES); p_disp->menu_driver_id = MENU_DRIVER_ID_STRIPES;
} }
static bool generic_menu_init_list(void *data) static bool generic_menu_init_list(void *data)
@ -6866,6 +6865,7 @@ static bool menu_driver_init_internal(
bool menu_driver_init(bool video_is_threaded) bool menu_driver_init(bool video_is_threaded)
{ {
struct rarch_state *p_rarch = &rarch_st; struct rarch_state *p_rarch = &rarch_st;
gfx_display_t *p_disp = &p_rarch->dispgfx;
command_event(CMD_EVENT_CORE_INFO_INIT, NULL); command_event(CMD_EVENT_CORE_INFO_INIT, NULL);
command_event(CMD_EVENT_LOAD_CORE_PERSIST, NULL); command_event(CMD_EVENT_LOAD_CORE_PERSIST, NULL);
@ -6885,7 +6885,7 @@ bool menu_driver_init(bool video_is_threaded)
/* If driver initialisation failed, must reset /* If driver initialisation failed, must reset
* driver id to 'unknown' */ * driver id to 'unknown' */
gfx_display_set_driver_id(MENU_DRIVER_ID_UNKNOWN); p_disp->menu_driver_id = MENU_DRIVER_ID_UNKNOWN;
return false; return false;
} }
@ -7586,6 +7586,7 @@ static bool driver_ctl_find_index(driver_ctx_info_t *drv)
bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data) bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
{ {
struct rarch_state *p_rarch = &rarch_st; struct rarch_state *p_rarch = &rarch_st;
gfx_display_t *p_disp = &p_rarch->dispgfx;
struct menu_state *menu_st = &p_rarch->menu_driver_state; struct menu_state *menu_st = &p_rarch->menu_driver_state;
switch (state) switch (state)
@ -7683,8 +7684,7 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
if (p_rarch->menu_userdata) if (p_rarch->menu_userdata)
free(p_rarch->menu_userdata); free(p_rarch->menu_userdata);
p_rarch->menu_userdata = NULL; p_rarch->menu_userdata = NULL;
p_disp->menu_driver_id = MENU_DRIVER_ID_UNKNOWN;
gfx_display_set_driver_id(MENU_DRIVER_ID_UNKNOWN);
#ifndef HAVE_DYNAMIC #ifndef HAVE_DYNAMIC
if (frontend_driver_has_fork()) if (frontend_driver_has_fork())