(menu_dialog.c) Cleanups

This commit is contained in:
twinaphex 2020-03-04 22:21:18 +01:00
parent 8d3b22091c
commit bea4f8aad3
4 changed files with 3 additions and 28 deletions

View File

@ -148,7 +148,7 @@ static int generic_menu_iterate(void *data,
{ {
case ITERATE_TYPE_HELP: case ITERATE_TYPE_HELP:
ret = menu_dialog_iterate( ret = menu_dialog_iterate(
menu->menu_state_msg, sizeof(menu->menu_state_msg), label, menu->menu_state_msg, sizeof(menu->menu_state_msg),
current_time); current_time);
#ifdef HAVE_ACCESSIBILITY #ifdef HAVE_ACCESSIBILITY
@ -168,10 +168,7 @@ static int generic_menu_iterate(void *data,
pop_stack = true; pop_stack = true;
if (pop_stack) if (pop_stack)
{
BIT64_SET(menu->state, MENU_STATE_POP_STACK); BIT64_SET(menu->state, MENU_STATE_POP_STACK);
menu_dialog_set_active(false);
}
} }
break; break;
case ITERATE_TYPE_BIND: case ITERATE_TYPE_BIND:
@ -302,7 +299,6 @@ static int generic_menu_iterate(void *data,
{ {
BIT64_SET(menu->state, MENU_STATE_POP_STACK); BIT64_SET(menu->state, MENU_STATE_POP_STACK);
} }
menu_dialog_set_active(false);
break; break;
case ITERATE_TYPE_DEFAULT: case ITERATE_TYPE_DEFAULT:
{ {

View File

@ -35,12 +35,11 @@
#include "../../performance_counters.h" #include "../../performance_counters.h"
static bool menu_dialog_pending_push = false; static bool menu_dialog_pending_push = false;
static bool menu_dialog_active = false;
static unsigned menu_dialog_current_id = 0; static unsigned menu_dialog_current_id = 0;
static enum menu_dialog_type menu_dialog_current_type = MENU_DIALOG_NONE; static enum menu_dialog_type menu_dialog_current_type = MENU_DIALOG_NONE;
static enum msg_hash_enums menu_dialog_current_msg = MSG_UNKNOWN; static enum msg_hash_enums menu_dialog_current_msg = MSG_UNKNOWN;
int menu_dialog_iterate(char *s, size_t len, const char *label, int menu_dialog_iterate(char *s, size_t len,
retro_time_t current_time) retro_time_t current_time)
{ {
#ifdef HAVE_CHEEVOS #ifdef HAVE_CHEEVOS
@ -258,7 +257,6 @@ bool menu_dialog_push_pending(bool push, enum menu_dialog_type type)
#endif #endif
menu_dialog_pending_push = push; menu_dialog_pending_push = push;
menu_dialog_current_type = type; menu_dialog_current_type = type;
menu_dialog_active = true;
return true; return true;
} }
@ -296,13 +294,3 @@ void menu_dialog_reset(void)
menu_dialog_current_type = MENU_DIALOG_NONE; menu_dialog_current_type = MENU_DIALOG_NONE;
menu_dialog_current_msg = MSG_UNKNOWN; menu_dialog_current_msg = MSG_UNKNOWN;
} }
void menu_dialog_set_active(bool on)
{
menu_dialog_active = on;
}
enum menu_dialog_type menu_dialog_get_current_type(void)
{
return menu_dialog_current_type;
}

View File

@ -54,7 +54,7 @@ bool menu_dialog_push_pending(
bool push, enum menu_dialog_type type); bool push, enum menu_dialog_type type);
int menu_dialog_iterate( int menu_dialog_iterate(
char *s, size_t len, const char *label, char *s, size_t len,
retro_time_t current_time); retro_time_t current_time);
void menu_dialog_unset_pending_push(void); void menu_dialog_unset_pending_push(void);
@ -65,10 +65,6 @@ void menu_dialog_reset(void);
void menu_dialog_set_current_id(unsigned id); void menu_dialog_set_current_id(unsigned id);
void menu_dialog_set_active(bool on);
enum menu_dialog_type menu_dialog_get_current_type(void);
RETRO_END_DECLS RETRO_END_DECLS
#endif #endif

View File

@ -16861,12 +16861,7 @@ static void menu_input_pointer_close_messagebox(void)
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_HELP_AUDIO_VIDEO_TROUBLESHOOTING)) || string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_HELP_AUDIO_VIDEO_TROUBLESHOOTING)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_HELP_SEND_DEBUG_INFO)) || string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_HELP_SEND_DEBUG_INFO)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CHEEVOS_DESCRIPTION))) string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CHEEVOS_DESCRIPTION)))
{
/* Have to set this to false, apparently...
* (c.f. generic_menu_iterate()) */
menu_dialog_set_active(false);
pop_stack = true; pop_stack = true;
}
/* Pop stack, if required */ /* Pop stack, if required */
if (pop_stack) if (pop_stack)