Turn scroll.mode into enum

This commit is contained in:
libretroadmin 2022-11-17 19:44:42 +01:00
parent 5402b781fe
commit a50f9bae85
2 changed files with 15 additions and 15 deletions

View File

@ -237,12 +237,6 @@ struct key_desc key_descriptors[RARCH_MAX_KEYS] =
{RETROK_OEM_102, "OEM-102"}
};
enum menu_scroll_mode
{
MENU_SCROLL_PAGE = 0,
MENU_SCROLL_START_LETTER
};
static void *null_menu_init(void **userdata, bool video_is_threaded)
{
menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu));
@ -1209,17 +1203,17 @@ float menu_input_get_dpi(
* Note: DPI is a fixed hardware property. To minimise performance
* overheads we therefore only call video_context_driver_get_metrics()
* on first run, or when the current video resolution changes */
if (!dpi_cached ||
(video_width != last_video_width) ||
(video_height != last_video_height))
if ( (!dpi_cached)
|| (video_width != last_video_width)
|| (video_height != last_video_height))
{
gfx_ctx_metrics_t mets;
/* Note: If video_context_driver_get_metrics() fails,
* we don't know what happened to dpi - so ensure it
* is reset to a sane value */
mets.type = DISPLAY_METRIC_DPI;
mets.value = &dpi;
mets.type = DISPLAY_METRIC_DPI;
mets.value = &dpi;
if (!video_context_driver_get_metrics(&mets))
dpi = 0.0f;

View File

@ -476,6 +476,12 @@ enum menu_state_flags
MENU_ST_FLAG_SCREENSAVER_ACTIVE = (1 << 11)
};
enum menu_scroll_mode
{
MENU_SCROLL_PAGE = 0,
MENU_SCROLL_START_LETTER
};
struct menu_state
{
/* Timers */
@ -514,7 +520,7 @@ struct menu_state
size_t index_list[SCROLL_INDEX_SIZE];
unsigned index_size;
unsigned acceleration;
bool mode;
enum menu_scroll_mode mode;
} scroll;
/* unsigned alignment */
@ -528,6 +534,9 @@ struct menu_state
menu_input_pointer_hw_state_t input_pointer_hw_state;
uint16_t flags;
#ifdef HAVE_OVERLAY
uint16_t overlay_types;
#endif
/* When generating a menu list in menu_displaylist_build_list(),
* the entry with a label matching 'pending_selection' will
@ -549,9 +558,6 @@ struct menu_state
#endif
unsigned char kb_key_state[RETROK_LAST];
#ifdef HAVE_OVERLAY
uint16_t overlay_types;
#endif
};
typedef struct menu_content_ctx_defer_info