mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
move prevent_populate to menu_driver_ctl
This commit is contained in:
parent
ce9be72757
commit
5ec501f934
@ -240,12 +240,11 @@ static int action_left_cheat_num_passes(unsigned type, const char *label,
|
||||
bool wraparound)
|
||||
{
|
||||
unsigned new_size = 0;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
|
||||
if (cheat_manager_get_size())
|
||||
new_size = cheat_manager_get_size() - 1;
|
||||
menu_entries_set_refresh(false);
|
||||
menu->prevent_populate = true;
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
||||
cheat_manager_realloc(new_size);
|
||||
|
||||
return 0;
|
||||
@ -267,7 +266,7 @@ static int action_left_shader_num_passes(unsigned type, const char *label,
|
||||
if (shader->passes)
|
||||
shader->passes--;
|
||||
menu_entries_set_refresh(false);
|
||||
menu->prevent_populate = true;
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
||||
video_shader_resolve_parameters(NULL, menu->shader);
|
||||
|
||||
#endif
|
||||
|
@ -257,11 +257,10 @@ static int action_right_cheat_num_passes(unsigned type, const char *label,
|
||||
bool wraparound)
|
||||
{
|
||||
unsigned new_size = 0;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
|
||||
new_size = cheat_manager_get_size() + 1;
|
||||
menu_entries_set_refresh(false);
|
||||
menu->prevent_populate = true;
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
||||
cheat_manager_realloc(new_size);
|
||||
|
||||
return 0;
|
||||
@ -283,7 +282,7 @@ static int action_right_shader_num_passes(unsigned type, const char *label,
|
||||
if ((shader->passes < GFX_MAX_SHADERS))
|
||||
shader->passes++;
|
||||
menu_entries_set_refresh(false);
|
||||
menu->prevent_populate = true;
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
||||
video_shader_resolve_parameters(NULL, menu->shader);
|
||||
|
||||
#endif
|
||||
|
@ -1139,7 +1139,7 @@ static void xmb_refresh_horizontal_list(xmb_handle_t *xmb,
|
||||
free(xmb->horizontal_list);
|
||||
xmb->horizontal_list = NULL;
|
||||
|
||||
menu->prevent_populate = true;
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
||||
|
||||
xmb_init_horizontal_list(menu, xmb);
|
||||
xmb_context_reset_horizontal_list(xmb, menu, themepath);
|
||||
@ -1232,10 +1232,10 @@ static void xmb_populate_entries(const char *path,
|
||||
if (!xmb)
|
||||
return;
|
||||
|
||||
if (menu->prevent_populate)
|
||||
if (menu_driver_ctl(RARCH_MENU_CTL_IS_PREVENT_POPULATE, NULL))
|
||||
{
|
||||
xmb_selection_pointer_changed(false);
|
||||
menu->prevent_populate = false;
|
||||
menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL);
|
||||
if (settings->menu.boxart_enable)
|
||||
xmb_update_boxart_image(xmb);
|
||||
return;
|
||||
@ -1984,7 +1984,7 @@ static void *xmb_init(void)
|
||||
xmb->depth = 1;
|
||||
xmb->old_depth = 1;
|
||||
xmb->alpha = 0;
|
||||
menu->prevent_populate = false;
|
||||
menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL);
|
||||
|
||||
/* TODO/FIXME - we don't use framebuffer at all
|
||||
* for XMB, we should refactor this dependency
|
||||
@ -2565,6 +2565,7 @@ static void xmb_context_destroy(void)
|
||||
|
||||
static void xmb_toggle(bool menu_on)
|
||||
{
|
||||
bool tmp = false;
|
||||
xmb_handle_t *xmb = NULL;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
|
||||
@ -2587,7 +2588,12 @@ static void xmb_toggle(bool menu_on)
|
||||
menu_animation_push(XMB_DELAY, 1.0f,
|
||||
&xmb->alpha, EASING_IN_OUT_QUAD, -1, NULL);
|
||||
|
||||
menu->prevent_populate = !menu_entries_needs_refresh();
|
||||
tmp = !menu_entries_needs_refresh();
|
||||
|
||||
if (tmp)
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
||||
else
|
||||
menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL);
|
||||
|
||||
xmb_toggle_horizontal_list(xmb, menu);
|
||||
}
|
||||
|
@ -627,6 +627,7 @@ error:
|
||||
|
||||
bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
||||
{
|
||||
static bool menu_driver_prevent_populate = false;
|
||||
static bool menu_driver_load_no_content = false;
|
||||
static bool menu_driver_alive = false;
|
||||
static bool menu_driver_data_own = false;
|
||||
@ -635,10 +636,11 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
||||
switch (state)
|
||||
{
|
||||
case RARCH_MENU_CTL_DESTROY:
|
||||
menu_driver_load_no_content = false;
|
||||
menu_driver_alive = false;
|
||||
menu_driver_data_own = false;
|
||||
menu_driver_ctx = NULL;
|
||||
menu_driver_prevent_populate = false;
|
||||
menu_driver_load_no_content = false;
|
||||
menu_driver_alive = false;
|
||||
menu_driver_data_own = false;
|
||||
menu_driver_ctx = NULL;
|
||||
break;
|
||||
case RARCH_MENU_CTL_FRAME:
|
||||
if (!menu_driver_alive)
|
||||
@ -646,6 +648,14 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
||||
if (driver->frame)
|
||||
driver->frame();
|
||||
break;
|
||||
case RARCH_MENU_CTL_SET_PREVENT_POPULATE:
|
||||
menu_driver_prevent_populate = true;
|
||||
break;
|
||||
case RARCH_MENU_CTL_UNSET_PREVENT_POPULATE:
|
||||
menu_driver_prevent_populate = false;
|
||||
break;
|
||||
case RARCH_MENU_CTL_IS_PREVENT_POPULATE:
|
||||
return menu_driver_prevent_populate;
|
||||
case RARCH_MENU_CTL_SET_TOGGLE:
|
||||
menu_driver_toggle(true);
|
||||
break;
|
||||
|
@ -96,6 +96,9 @@ enum rarch_menu_ctl_state
|
||||
RARCH_MENU_CTL_NONE = 0,
|
||||
RARCH_MENU_CTL_DEINIT,
|
||||
RARCH_MENU_CTL_FRAME,
|
||||
RARCH_MENU_CTL_SET_PREVENT_POPULATE,
|
||||
RARCH_MENU_CTL_UNSET_PREVENT_POPULATE,
|
||||
RARCH_MENU_CTL_IS_PREVENT_POPULATE,
|
||||
RARCH_MENU_CTL_SET_TEXTURE,
|
||||
RARCH_MENU_CTL_SET_TOGGLE,
|
||||
RARCH_MENU_CTL_UNSET_TOGGLE,
|
||||
@ -245,8 +248,6 @@ typedef struct
|
||||
|
||||
content_playlist_t *playlist;
|
||||
char db_playlist_file[PATH_MAX_LENGTH];
|
||||
|
||||
bool prevent_populate; /* xmb hack */
|
||||
} menu_handle_t;
|
||||
|
||||
typedef struct menu_ctx_driver
|
||||
|
Loading…
x
Reference in New Issue
Block a user