mirror of
https://github.com/libretro/RetroArch
synced 2025-02-09 18:40:31 +00:00
(Zarch) Nits
This commit is contained in:
parent
9ee5931c5e
commit
4c2d754b06
@ -173,36 +173,34 @@ static float zarch_zui_strwidth(void *fb_buf, const char *text, float scale)
|
|||||||
return font_driver_get_message_width(fb_buf, text, strlen(text), scale);
|
return font_driver_get_message_width(fb_buf, text, strlen(text), scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int16_t zarch_zui_input_state(zui_t *zui, enum zarch_zui_input_state state)
|
static int16_t zarch_zui_input_state(zui_t *zui, enum zarch_zui_input_state state)
|
||||||
{
|
{
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case MENU_ZARCH_MOUSE_X:
|
case MENU_ZARCH_MOUSE_X:
|
||||||
return menu_input_mouse_state(MENU_MOUSE_X_AXIS);
|
return menu_input_mouse_state(MENU_MOUSE_X_AXIS);
|
||||||
case MENU_ZARCH_MOUSE_Y:
|
case MENU_ZARCH_MOUSE_Y:
|
||||||
return menu_input_mouse_state(MENU_MOUSE_Y_AXIS);
|
return menu_input_mouse_state(MENU_MOUSE_Y_AXIS);
|
||||||
case MENU_POINTER_ZARCH_X:
|
case MENU_POINTER_ZARCH_X:
|
||||||
return menu_input_pointer_state(MENU_POINTER_X_AXIS);
|
return menu_input_pointer_state(MENU_POINTER_X_AXIS);
|
||||||
case MENU_POINTER_ZARCH_Y:
|
case MENU_POINTER_ZARCH_Y:
|
||||||
return menu_input_pointer_state(MENU_POINTER_Y_AXIS);
|
return menu_input_pointer_state(MENU_POINTER_Y_AXIS);
|
||||||
case MENU_ZARCH_PRESSED:
|
case MENU_ZARCH_PRESSED:
|
||||||
if ( menu_input_mouse_state(MENU_MOUSE_LEFT_BUTTON)
|
if ( menu_input_mouse_state(MENU_MOUSE_LEFT_BUTTON)
|
||||||
|| menu_input_pointer_state(MENU_POINTER_PRESSED))
|
|| menu_input_pointer_state(MENU_POINTER_PRESSED))
|
||||||
return 1;
|
return 1;
|
||||||
if (zui->action == MENU_ACTION_OK)
|
if (zui->action == MENU_ACTION_OK)
|
||||||
return 1;
|
return 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool zarch_zui_check_button_down(zui_t *zui,
|
static bool zarch_zui_check_button_down(zui_t *zui,
|
||||||
unsigned id, int x1, int y1, int x2, int y2)
|
unsigned id, int x1, int y1, int x2, int y2)
|
||||||
{
|
{
|
||||||
menu_input_ctx_hitbox_t hitbox;
|
menu_input_ctx_hitbox_t hitbox;
|
||||||
bool result = false;
|
|
||||||
|
|
||||||
hitbox.x1 = x1;
|
hitbox.x1 = x1;
|
||||||
hitbox.x2 = x2;
|
hitbox.x2 = x2;
|
||||||
@ -215,11 +213,11 @@ static bool zarch_zui_check_button_down(zui_t *zui,
|
|||||||
if ( zui->item.hot == id
|
if ( zui->item.hot == id
|
||||||
&& zarch_zui_input_state(zui, MENU_ZARCH_PRESSED))
|
&& zarch_zui_input_state(zui, MENU_ZARCH_PRESSED))
|
||||||
{
|
{
|
||||||
result = true;
|
|
||||||
zui->item.active = id;
|
zui->item.active = id;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool zarch_zui_check_button_up(zui_t *zui,
|
static bool zarch_zui_check_button_up(zui_t *zui,
|
||||||
@ -328,9 +326,7 @@ static bool zarch_zui_list_item(zui_t *zui, struct zui_tabbed *tab, int x1, int
|
|||||||
frame_count = video_driver_get_frame_count_ptr();
|
frame_count = video_driver_get_frame_count_ptr();
|
||||||
|
|
||||||
if (tab->active_id != tab->prev_id)
|
if (tab->active_id != tab->prev_id)
|
||||||
{
|
|
||||||
tab->prev_id = tab->active_id;
|
tab->prev_id = tab->active_id;
|
||||||
}
|
|
||||||
|
|
||||||
if (selected)
|
if (selected)
|
||||||
{
|
{
|
||||||
@ -398,9 +394,7 @@ static bool zarch_zui_tab(zui_t *zui, struct zui_tabbed *tab,
|
|||||||
if (zui->item.active == id || tab->active_id == ~0U || !tab->inited)
|
if (zui->item.active == id || tab->active_id == ~0U || !tab->inited)
|
||||||
tab->active_id = id;
|
tab->active_id = id;
|
||||||
else if (id > tab->active_id)
|
else if (id > tab->active_id)
|
||||||
{
|
|
||||||
tab->next_id = id;
|
tab->next_id = id;
|
||||||
}
|
|
||||||
|
|
||||||
if (!tab->inited)
|
if (!tab->inited)
|
||||||
tab->inited = true;
|
tab->inited = true;
|
||||||
@ -850,9 +844,7 @@ static void zarch_frame(void *data)
|
|||||||
menu_display_ctx_coord_draw_t coord_draw;
|
menu_display_ctx_coord_draw_t coord_draw;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
zui_t *zui = (zui_t*)data;
|
zui_t *zui = (zui_t*)data;
|
||||||
video_coord_array_t *ca = NULL;
|
video_coord_array_t *ca = menu_display_get_coords_array();
|
||||||
|
|
||||||
ca = menu_display_get_coords_array();
|
|
||||||
|
|
||||||
if (!zui)
|
if (!zui)
|
||||||
return;
|
return;
|
||||||
@ -1127,8 +1119,8 @@ static int zarch_iterate(void *data, void *userdata, enum menu_action action)
|
|||||||
static bool zarch_menu_init_list(void *data)
|
static bool zarch_menu_init_list(void *data)
|
||||||
{
|
{
|
||||||
menu_displaylist_info_t info = {0};
|
menu_displaylist_info_t info = {0};
|
||||||
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
||||||
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
|
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
|
||||||
|
|
||||||
strlcpy(info.label,
|
strlcpy(info.label,
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB), sizeof(info.label));
|
msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB), sizeof(info.label));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user