(menu widgets) No longer use video_driver_get_size

This commit is contained in:
twinaphex 2019-08-13 16:47:56 +02:00
parent 0254cb91d7
commit 7d10c1a9ff
3 changed files with 15 additions and 20 deletions

View File

@ -806,7 +806,7 @@ static void menu_widgets_hourglass_tick(void *userdata)
menu_animation_push(&entry);
}
void menu_widgets_iterate(void)
void menu_widgets_iterate(unsigned width, unsigned height)
{
size_t i;
settings_t *settings = config_get_ptr();
@ -891,12 +891,11 @@ void menu_widgets_iterate(void)
if (screenshot_filename[0] != '\0')
{
menu_timer_ctx_entry_t timer;
unsigned width;
video_driver_texture_unload(&screenshot_texture);
menu_display_reset_textures_list(screenshot_filename, "", &screenshot_texture, TEXTURE_FILTER_MIPMAP_LINEAR, &screenshot_texture_width, &screenshot_texture_height);
video_driver_get_size(&width, NULL);
menu_display_reset_textures_list(screenshot_filename,
"", &screenshot_texture, TEXTURE_FILTER_MIPMAP_LINEAR,
&screenshot_texture_width, &screenshot_texture_height);
screenshot_height = settings->floats.video_font_size * 4;
screenshot_width = width;
@ -1755,27 +1754,21 @@ err:
menu_widgets_free();
}
void menu_widgets_context_reset(bool is_threaded)
void menu_widgets_context_reset(bool is_threaded,
unsigned width, unsigned height)
{
int i;
char xmb_path[PATH_MAX_LENGTH];
char monochrome_png_path[PATH_MAX_LENGTH];
char menu_widgets_path[PATH_MAX_LENGTH];
char theme_path[PATH_MAX_LENGTH];
int i;
char monochrome_png_path[PATH_MAX_LENGTH];
char ozone_path[PATH_MAX_LENGTH];
char font_path[PATH_MAX_LENGTH];
settings_t *settings = config_get_ptr();
unsigned video_info_width;
if (!menu_widgets_inited)
return;
video_driver_get_size(&video_info_width, NULL);
/* Textures paths */
fill_pathname_join(
menu_widgets_path,
@ -1863,7 +1856,7 @@ void menu_widgets_context_reset(bool is_threaded)
}
msg_queue_text_scale_factor = 0.69f;
msg_queue_base_width = video_info_width / 4;
msg_queue_base_width = width / 4;
msg_queue_spacing = msg_queue_height / 3;
msg_queue_glyph_width = glyph_width * msg_queue_text_scale_factor;
msg_queue_rect_start_x = msg_queue_spacing + msg_queue_icon_size_x;

View File

@ -53,7 +53,7 @@ bool menu_widgets_volume_update_and_show(void);
bool menu_widgets_set_fps_text(char *fps_text);
void menu_widgets_iterate(void);
void menu_widgets_iterate(unsigned width, unsigned height);
bool menu_widgets_set_paused(bool is_paused);
bool menu_widgets_set_fast_forward(bool is_fast_forward);
@ -69,7 +69,8 @@ void menu_widgets_screenshot_taken(const char *shotname, const char *filename);
void menu_widgets_start_load_content_animation(const char *content_name, bool remove_extension);
void menu_widgets_cleanup_load_content_animation(void);
void menu_widgets_context_reset(bool is_threaded);
void menu_widgets_context_reset(bool is_threaded,
unsigned width, unsigned height);
void menu_widgets_context_destroy(void);

View File

@ -19648,7 +19648,8 @@ static void drivers_init(int flags)
&& video_driver_has_widgets())
{
menu_widgets_init(video_is_threaded);
menu_widgets_context_reset(video_is_threaded);
menu_widgets_context_reset(video_is_threaded,
video_driver_width, video_driver_height);
}
#endif
@ -23234,7 +23235,7 @@ static enum runloop_state runloop_check_state(void)
if (menu_widgets_ready())
{
runloop_msg_queue_lock();
menu_widgets_iterate();
menu_widgets_iterate(video_driver_width, video_driver_height);
runloop_msg_queue_unlock();
}
#endif