Create CHEEVOS_CTL_POPULATE_MENU

This commit is contained in:
twinaphex 2016-02-13 06:15:38 +01:00
parent 6c06ffbf1d
commit 3fab9843fd
3 changed files with 10 additions and 7 deletions

View File

@ -2086,7 +2086,7 @@ static bool cheevos_load(const void *data)
}
#ifdef HAVE_MENU
void cheevos_populate_menu(void *data)
static void cheevos_populate_menu(void *data)
{
unsigned i;
const cheevo_t *end = NULL;
@ -2210,6 +2210,11 @@ bool cheevos_ctl(enum cheevos_ctl_state state, void *data)
cheevos_test_cheevo_set(&cheevos_locals.unofficial);
}
break;
case CHEEVOS_CTL_POPULATE_MENU:
#ifdef HAVE_MENU
cheevos_populate_menu(data);
#endif
break;
case CHEEVOS_CTL_SET_CHEATS:
cheevos_globals.cheats_were_enabled =
cheevos_globals.cheats_are_enabled;

View File

@ -30,12 +30,10 @@ enum cheevos_ctl_state
/* Load the achievements into memory if
* the game has content. */
CHEEVOS_CTL_SET_CHEATS
};
CHEEVOS_CTL_SET_CHEATS,
#ifdef HAVE_MENU
void cheevos_populate_menu(void *data);
#endif
CHEEVOS_CTL_POPULATE_MENU
};
void cheevos_get_description(unsigned idx, char *str, size_t len);

View File

@ -3176,7 +3176,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
#ifdef HAVE_CHEEVOS
case DISPLAYLIST_ACHIEVEMENT_LIST:
cheevos_populate_menu(info);
cheevos_ctl(CHEEVOS_CTL_POPULATE_MENU, info);
info->need_push = true;
info->need_refresh = true;
break;