mirror of
https://github.com/libretro/RetroArch
synced 2025-03-22 16:20:58 +00:00
Move framebuffer is dirty and other menu-related state flags
to menu_handle_t
This commit is contained in:
parent
1a152677a3
commit
a014f2db88
@ -1091,9 +1091,15 @@ bool event_command(enum event_command cmd)
|
|||||||
input_driver_poll();
|
input_driver_poll();
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
runloop->frames.video.current.menu.framebuf.dirty = true;
|
{
|
||||||
if (runloop->is_menu)
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
event_command(EVENT_CMD_VIDEO_SET_BLOCKING_STATE);
|
|
||||||
|
if (menu)
|
||||||
|
menu->framebuf.dirty = true;
|
||||||
|
|
||||||
|
if (runloop->is_menu)
|
||||||
|
event_command(EVENT_CMD_VIDEO_SET_BLOCKING_STATE);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case EVENT_CMD_CHEATS_DEINIT:
|
case EVENT_CMD_CHEATS_DEINIT:
|
||||||
|
@ -368,9 +368,8 @@ static void glui_frame(void)
|
|||||||
menu->navigation.selection_ptr,
|
menu->navigation.selection_ptr,
|
||||||
global->video_data.width, glui->line_height, 1, 1, 1, 0.1);
|
global->video_data.width, glui->line_height, 1, 1, 1, 0.1);
|
||||||
|
|
||||||
runloop->frames.video.current.menu.animation.is_active = true;
|
menu->animation_is_active = true;
|
||||||
runloop->frames.video.current.menu.label.is_updated = false;
|
menu->label.is_updated = false;
|
||||||
runloop->frames.video.current.menu.framebuf.dirty = false;
|
|
||||||
|
|
||||||
glui_render_quad(gl, 0, 0, global->video_data.width,
|
glui_render_quad(gl, 0, 0, global->video_data.width,
|
||||||
menu->header_height, 0.2, 0.2, 0.2, 1);
|
menu->header_height, 0.2, 0.2, 0.2, 1);
|
||||||
|
@ -356,9 +356,9 @@ static void rgui_render(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* ensures the framebuffer will be rendered on the screen */
|
/* ensures the framebuffer will be rendered on the screen */
|
||||||
runloop->frames.video.current.menu.framebuf.dirty = true;
|
menu->framebuf.dirty = true;
|
||||||
runloop->frames.video.current.menu.animation.is_active = false;
|
menu->animation_is_active = false;
|
||||||
runloop->frames.video.current.menu.label.is_updated = false;
|
menu->label.is_updated = false;
|
||||||
|
|
||||||
if (settings->menu.pointer.enable)
|
if (settings->menu.pointer.enable)
|
||||||
{
|
{
|
||||||
@ -571,10 +571,10 @@ static void rgui_set_texture(void)
|
|||||||
|
|
||||||
if (!menu)
|
if (!menu)
|
||||||
return;
|
return;
|
||||||
if (!runloop->frames.video.current.menu.framebuf.dirty)
|
if (!menu->framebuf.dirty)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
runloop->frames.video.current.menu.framebuf.dirty = false;
|
menu->framebuf.dirty = false;
|
||||||
|
|
||||||
video_driver_set_texture_frame(
|
video_driver_set_texture_frame(
|
||||||
menu->frame_buf.data, false,
|
menu->frame_buf.data, false,
|
||||||
|
@ -1164,9 +1164,8 @@ static void xmb_render(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
runloop->frames.video.current.menu.animation.is_active = false;
|
menu->animation_is_active = false;
|
||||||
runloop->frames.video.current.menu.label.is_updated = false;
|
menu->label.is_updated = false;
|
||||||
runloop->frames.video.current.menu.framebuf.dirty = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xmb_frame(void)
|
static void xmb_frame(void)
|
||||||
|
@ -171,7 +171,7 @@ void *menu_init(const void *data)
|
|||||||
|
|
||||||
rarch_assert(menu->msg_queue = msg_queue_new(8));
|
rarch_assert(menu->msg_queue = msg_queue_new(8));
|
||||||
|
|
||||||
runloop->frames.video.current.menu.framebuf.dirty = true;
|
menu->framebuf.dirty = true;
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
error:
|
error:
|
||||||
@ -349,7 +349,7 @@ int menu_iterate(retro_input_t input,
|
|||||||
|
|
||||||
if (menu->cur_time - last_clock_update > 1000000 && settings->menu.timedate_enable)
|
if (menu->cur_time - last_clock_update > 1000000 && settings->menu.timedate_enable)
|
||||||
{
|
{
|
||||||
runloop->frames.video.current.menu.label.is_updated = true;
|
menu->label.is_updated = true;
|
||||||
last_clock_update = menu->cur_time;
|
last_clock_update = menu->cur_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,7 +439,7 @@ bool menu_animation_update(animation_t *animation, float dt)
|
|||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
unsigned active_tweens = 0;
|
unsigned active_tweens = 0;
|
||||||
runloop_t *runloop = rarch_main_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
for(i = 0; i < animation->size; i++)
|
for(i = 0; i < animation->size; i++)
|
||||||
menu_animation_iterate(&animation->list[i], dt, &active_tweens);
|
menu_animation_iterate(&animation->list[i], dt, &active_tweens);
|
||||||
@ -450,7 +450,7 @@ bool menu_animation_update(animation_t *animation, float dt)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
runloop->frames.video.current.menu.animation.is_active = true;
|
menu->animation_is_active = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -473,7 +473,7 @@ void menu_animation_ticker_line(char *buf, size_t len, uint64_t idx,
|
|||||||
unsigned phase_left_moving, phase_right_stop;
|
unsigned phase_left_moving, phase_right_stop;
|
||||||
unsigned left_offset, right_offset;
|
unsigned left_offset, right_offset;
|
||||||
size_t str_len = strlen(str);
|
size_t str_len = strlen(str);
|
||||||
runloop_t *runloop = rarch_main_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (str_len <= len)
|
if (str_len <= len)
|
||||||
{
|
{
|
||||||
@ -514,5 +514,5 @@ void menu_animation_ticker_line(char *buf, size_t len, uint64_t idx,
|
|||||||
else
|
else
|
||||||
strlcpy(buf, str + right_offset, len + 1);
|
strlcpy(buf, str + right_offset, len + 1);
|
||||||
|
|
||||||
runloop->frames.video.current.menu.animation.is_active = true;
|
menu->animation_is_active = true;
|
||||||
}
|
}
|
||||||
|
@ -24,12 +24,10 @@
|
|||||||
|
|
||||||
bool menu_display_update_pending(void)
|
bool menu_display_update_pending(void)
|
||||||
{
|
{
|
||||||
runloop_t *runloop = rarch_main_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
if (runloop)
|
if (menu)
|
||||||
{
|
{
|
||||||
if (runloop->frames.video.current.menu.animation.is_active ||
|
if (menu->animation_is_active || menu->label.is_updated || menu->framebuf.dirty)
|
||||||
runloop->frames.video.current.menu.label.is_updated ||
|
|
||||||
runloop->frames.video.current.menu.framebuf.dirty)
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -210,12 +210,29 @@ typedef struct
|
|||||||
unsigned idx;
|
unsigned idx;
|
||||||
} keyboard;
|
} keyboard;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
bool is_updated;
|
||||||
|
} label;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
bool dirty;
|
||||||
|
} framebuf;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
bool active;
|
||||||
|
} action;
|
||||||
|
|
||||||
rarch_setting_t *list_settings;
|
rarch_setting_t *list_settings;
|
||||||
animation_t *animation;
|
animation_t *animation;
|
||||||
|
bool animation_is_active;
|
||||||
|
|
||||||
content_playlist_t *db_playlist;
|
content_playlist_t *db_playlist;
|
||||||
char db_playlist_file[PATH_MAX_LENGTH];
|
char db_playlist_file[PATH_MAX_LENGTH];
|
||||||
database_info_handle_t *db;
|
database_info_handle_t *db;
|
||||||
|
|
||||||
} menu_handle_t;
|
} menu_handle_t;
|
||||||
|
|
||||||
typedef struct menu_file_list_cbs
|
typedef struct menu_file_list_cbs
|
||||||
|
@ -388,10 +388,10 @@ static void menu_action_setting_disp_set_label_perf_counters(
|
|||||||
const char *path,
|
const char *path,
|
||||||
char *path_buf, size_t path_buf_size)
|
char *path_buf, size_t path_buf_size)
|
||||||
{
|
{
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
const struct retro_perf_counter **counters =
|
const struct retro_perf_counter **counters =
|
||||||
(const struct retro_perf_counter **)perf_counters_rarch;
|
(const struct retro_perf_counter **)perf_counters_rarch;
|
||||||
unsigned offset = type - MENU_SETTINGS_PERF_COUNTERS_BEGIN;
|
unsigned offset = type - MENU_SETTINGS_PERF_COUNTERS_BEGIN;
|
||||||
runloop_t *runloop = rarch_main_get_ptr();
|
|
||||||
|
|
||||||
*type_str = '\0';
|
*type_str = '\0';
|
||||||
*w = 19;
|
*w = 19;
|
||||||
@ -412,7 +412,7 @@ static void menu_action_setting_disp_set_label_perf_counters(
|
|||||||
(unsigned long long)counters[offset]->call_cnt),
|
(unsigned long long)counters[offset]->call_cnt),
|
||||||
(unsigned long long)counters[offset]->call_cnt);
|
(unsigned long long)counters[offset]->call_cnt);
|
||||||
|
|
||||||
runloop->frames.video.current.menu.label.is_updated = true;
|
menu->label.is_updated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void menu_action_setting_disp_set_label_libretro_perf_counters(
|
static void menu_action_setting_disp_set_label_libretro_perf_counters(
|
||||||
@ -424,10 +424,10 @@ static void menu_action_setting_disp_set_label_libretro_perf_counters(
|
|||||||
const char *path,
|
const char *path,
|
||||||
char *path_buf, size_t path_buf_size)
|
char *path_buf, size_t path_buf_size)
|
||||||
{
|
{
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
const struct retro_perf_counter **counters =
|
const struct retro_perf_counter **counters =
|
||||||
(const struct retro_perf_counter **)perf_counters_libretro;
|
(const struct retro_perf_counter **)perf_counters_libretro;
|
||||||
unsigned offset = type - MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN;
|
unsigned offset = type - MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN;
|
||||||
runloop_t *runloop = rarch_main_get_ptr();
|
|
||||||
|
|
||||||
*type_str = '\0';
|
*type_str = '\0';
|
||||||
*w = 19;
|
*w = 19;
|
||||||
@ -448,7 +448,7 @@ static void menu_action_setting_disp_set_label_libretro_perf_counters(
|
|||||||
(unsigned long long)counters[offset]->call_cnt),
|
(unsigned long long)counters[offset]->call_cnt),
|
||||||
(unsigned long long)counters[offset]->call_cnt);
|
(unsigned long long)counters[offset]->call_cnt);
|
||||||
|
|
||||||
runloop->frames.video.current.menu.label.is_updated = true;
|
menu->label.is_updated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void menu_action_setting_disp_set_label_menu_more(
|
static void menu_action_setting_disp_set_label_menu_more(
|
||||||
|
@ -359,7 +359,7 @@ int menu_entry_iterate(unsigned action)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (action != MENU_ACTION_NOOP || menu->need_refresh || menu_display_update_pending())
|
if (action != MENU_ACTION_NOOP || menu->need_refresh || menu_display_update_pending())
|
||||||
runloop->frames.video.current.menu.framebuf.dirty = true;
|
menu->framebuf.dirty = true;
|
||||||
|
|
||||||
cbs = (menu_file_list_cbs_t*)menu_list_get_last_stack_actiondata(menu_list);
|
cbs = (menu_file_list_cbs_t*)menu_list_get_last_stack_actiondata(menu_list);
|
||||||
|
|
||||||
|
@ -657,7 +657,7 @@ static int menu_input_mouse(unsigned *action)
|
|||||||
|| menu->mouse.wheelup || menu->mouse.wheeldown
|
|| menu->mouse.wheelup || menu->mouse.wheeldown
|
||||||
|| menu->mouse.hwheelup || menu->mouse.hwheeldown
|
|| menu->mouse.hwheelup || menu->mouse.hwheeldown
|
||||||
|| menu->mouse.scrollup || menu->mouse.scrolldown)
|
|| menu->mouse.scrollup || menu->mouse.scrolldown)
|
||||||
runloop->frames.video.current.menu.animation.is_active = true;
|
menu->animation_is_active = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -699,7 +699,7 @@ static int menu_input_pointer(unsigned *action)
|
|||||||
if (menu->pointer.pressed[0] || menu->pointer.oldpressed[0]
|
if (menu->pointer.pressed[0] || menu->pointer.oldpressed[0]
|
||||||
|| menu->pointer.back || menu->pointer.dragging
|
|| menu->pointer.back || menu->pointer.dragging
|
||||||
|| menu->pointer.dy != 0 || menu->pointer.dx != 0)
|
|| menu->pointer.dy != 0 || menu->pointer.dx != 0)
|
||||||
runloop->frames.video.current.menu.animation.is_active = true;
|
menu->animation_is_active = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
25
runloop.h
25
runloop.h
@ -55,31 +55,6 @@ typedef struct runloop
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
unsigned max;
|
unsigned max;
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
bool is_updated;
|
|
||||||
} label;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
bool is_active;
|
|
||||||
} animation;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
bool dirty;
|
|
||||||
} framebuf;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
bool active;
|
|
||||||
} action;
|
|
||||||
} menu;
|
|
||||||
} current;
|
|
||||||
} video;
|
} video;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
|
@ -1145,7 +1145,14 @@ static void setting_get_string_representation_st_float_video_refresh_rate_auto(v
|
|||||||
|
|
||||||
snprintf(type_str, type_str_size, "%.3f Hz (%.1f%% dev, %u samples)",
|
snprintf(type_str, type_str_size, "%.3f Hz (%.1f%% dev, %u samples)",
|
||||||
video_refresh_rate, 100.0 * deviation, sample_points);
|
video_refresh_rate, 100.0 * deviation, sample_points);
|
||||||
runloop->frames.video.current.menu.label.is_updated = true;
|
#ifdef HAVE_MENU
|
||||||
|
{
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
|
if (menu)
|
||||||
|
menu->label.is_updated = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
strlcpy(type_str, "N/A", type_str_size);
|
strlcpy(type_str, "N/A", type_str_size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user