mirror of
https://github.com/libretro/RetroArch
synced 2025-02-11 06:40:48 +00:00
(RGUI) Rename rgui->directory_ptr to rgui->selection_ptr
This commit is contained in:
parent
8601102cdd
commit
a7e651fe0c
@ -147,7 +147,7 @@ struct rgui_handle
|
|||||||
|
|
||||||
rgui_list_t *path_stack;
|
rgui_list_t *path_stack;
|
||||||
rgui_list_t *folder_buf;
|
rgui_list_t *folder_buf;
|
||||||
int directory_ptr;
|
int selection_ptr;
|
||||||
bool need_refresh;
|
bool need_refresh;
|
||||||
bool msg_force;
|
bool msg_force;
|
||||||
|
|
||||||
@ -386,10 +386,10 @@ static void render_text(rgui_handle_t *rgui)
|
|||||||
&& !rgui->msg_force)
|
&& !rgui->msg_force)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
size_t begin = rgui->directory_ptr >= TERM_HEIGHT / 2 ?
|
size_t begin = rgui->selection_ptr >= TERM_HEIGHT / 2 ?
|
||||||
rgui->directory_ptr - TERM_HEIGHT / 2 : 0;
|
rgui->selection_ptr - TERM_HEIGHT / 2 : 0;
|
||||||
size_t end = rgui->directory_ptr + TERM_HEIGHT <= rgui->folder_buf->size ?
|
size_t end = rgui->selection_ptr + TERM_HEIGHT <= rgui->folder_buf->size ?
|
||||||
rgui->directory_ptr + TERM_HEIGHT : rgui->folder_buf->size;
|
rgui->selection_ptr + TERM_HEIGHT : rgui->folder_buf->size;
|
||||||
|
|
||||||
if (end - begin > TERM_HEIGHT)
|
if (end - begin > TERM_HEIGHT)
|
||||||
end = begin + TERM_HEIGHT;
|
end = begin + TERM_HEIGHT;
|
||||||
@ -566,13 +566,13 @@ static void render_text(rgui_handle_t *rgui)
|
|||||||
}
|
}
|
||||||
|
|
||||||
snprintf(message, sizeof(message), "%c %-*.*s %-*s\n",
|
snprintf(message, sizeof(message), "%c %-*.*s %-*s\n",
|
||||||
i == rgui->directory_ptr ? '>' : ' ',
|
i == rgui->selection_ptr ? '>' : ' ',
|
||||||
TERM_WIDTH - (w + 1 + 2), TERM_WIDTH - (w + 1 + 2),
|
TERM_WIDTH - (w + 1 + 2), TERM_WIDTH - (w + 1 + 2),
|
||||||
entry_title,
|
entry_title,
|
||||||
w,
|
w,
|
||||||
type_str);
|
type_str);
|
||||||
|
|
||||||
blit_line(rgui, x, y, message, i == rgui->directory_ptr);
|
blit_line(rgui, x, y, message, i == rgui->selection_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GEKKO
|
#ifdef GEKKO
|
||||||
@ -1167,7 +1167,7 @@ static int rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
|||||||
unsigned type = 0;
|
unsigned type = 0;
|
||||||
const char *label = 0;
|
const char *label = 0;
|
||||||
if (action != RGUI_ACTION_REFRESH)
|
if (action != RGUI_ACTION_REFRESH)
|
||||||
rgui_list_get_at_offset(rgui->folder_buf, rgui->directory_ptr, &label, &type, NULL);
|
rgui_list_get_at_offset(rgui->folder_buf, rgui->selection_ptr, &label, &type, NULL);
|
||||||
#ifdef HAVE_LIBRETRO_MANAGEMENT
|
#ifdef HAVE_LIBRETRO_MANAGEMENT
|
||||||
if (type == RGUI_SETTINGS_CORE)
|
if (type == RGUI_SETTINGS_CORE)
|
||||||
label = default_paths.core_dir;
|
label = default_paths.core_dir;
|
||||||
@ -1183,17 +1183,17 @@ static int rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
|||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case RGUI_ACTION_UP:
|
case RGUI_ACTION_UP:
|
||||||
if (rgui->directory_ptr > 0)
|
if (rgui->selection_ptr > 0)
|
||||||
rgui->directory_ptr--;
|
rgui->selection_ptr--;
|
||||||
else
|
else
|
||||||
rgui->directory_ptr = rgui->folder_buf->size - 1;
|
rgui->selection_ptr = rgui->folder_buf->size - 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGUI_ACTION_DOWN:
|
case RGUI_ACTION_DOWN:
|
||||||
if (rgui->directory_ptr + 1 < rgui->folder_buf->size)
|
if (rgui->selection_ptr + 1 < rgui->folder_buf->size)
|
||||||
rgui->directory_ptr++;
|
rgui->selection_ptr++;
|
||||||
else
|
else
|
||||||
rgui->directory_ptr = 0;
|
rgui->selection_ptr = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGUI_ACTION_CANCEL:
|
case RGUI_ACTION_CANCEL:
|
||||||
@ -1201,7 +1201,7 @@ static int rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
|||||||
if (rgui->path_stack->size > 1)
|
if (rgui->path_stack->size > 1)
|
||||||
{
|
{
|
||||||
rgui_list_pop(rgui->path_stack);
|
rgui_list_pop(rgui->path_stack);
|
||||||
rgui->directory_ptr = directory_ptr;
|
rgui->selection_ptr = directory_ptr;
|
||||||
rgui->need_refresh = true;
|
rgui->need_refresh = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1217,13 +1217,13 @@ static int rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
|||||||
)
|
)
|
||||||
&& action == RGUI_ACTION_OK)
|
&& action == RGUI_ACTION_OK)
|
||||||
{
|
{
|
||||||
rgui_list_push(rgui->path_stack, label, type, rgui->directory_ptr);
|
rgui_list_push(rgui->path_stack, label, type, rgui->selection_ptr);
|
||||||
rgui->directory_ptr = 0;
|
rgui->selection_ptr = 0;
|
||||||
rgui->need_refresh = true;
|
rgui->need_refresh = true;
|
||||||
}
|
}
|
||||||
else if (type == RGUI_SETTINGS_CUSTOM_VIEWPORT && action == RGUI_ACTION_OK)
|
else if (type == RGUI_SETTINGS_CUSTOM_VIEWPORT && action == RGUI_ACTION_OK)
|
||||||
{
|
{
|
||||||
rgui_list_push(rgui->path_stack, "", type, rgui->directory_ptr);
|
rgui_list_push(rgui->path_stack, "", type, rgui->selection_ptr);
|
||||||
g_settings.video.aspect_ratio_idx = ASPECT_RATIO_CUSTOM;
|
g_settings.video.aspect_ratio_idx = ASPECT_RATIO_CUSTOM;
|
||||||
|
|
||||||
if (driver.video_poke->set_aspect_ratio)
|
if (driver.video_poke->set_aspect_ratio)
|
||||||
@ -1231,7 +1231,7 @@ static int rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
|||||||
}
|
}
|
||||||
else if (type == RGUI_SETTINGS_OPEN_FILEBROWSER && action == RGUI_ACTION_OK)
|
else if (type == RGUI_SETTINGS_OPEN_FILEBROWSER && action == RGUI_ACTION_OK)
|
||||||
{
|
{
|
||||||
rgui_list_push(rgui->path_stack, rgui->base_path, RGUI_FILE_DIRECTORY, rgui->directory_ptr);
|
rgui_list_push(rgui->path_stack, rgui->base_path, RGUI_FILE_DIRECTORY, rgui->selection_ptr);
|
||||||
rgui->need_refresh = true;
|
rgui->need_refresh = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1244,7 +1244,7 @@ static int rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case RGUI_ACTION_REFRESH:
|
case RGUI_ACTION_REFRESH:
|
||||||
rgui->directory_ptr = 0;
|
rgui->selection_ptr = 0;
|
||||||
rgui->need_refresh = true;
|
rgui->need_refresh = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1294,38 +1294,38 @@ int rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
|||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case RGUI_ACTION_UP:
|
case RGUI_ACTION_UP:
|
||||||
if (rgui->directory_ptr > 0)
|
if (rgui->selection_ptr > 0)
|
||||||
rgui->directory_ptr--;
|
rgui->selection_ptr--;
|
||||||
else
|
else
|
||||||
rgui->directory_ptr = rgui->folder_buf->size - 1;
|
rgui->selection_ptr = rgui->folder_buf->size - 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGUI_ACTION_DOWN:
|
case RGUI_ACTION_DOWN:
|
||||||
if (rgui->directory_ptr + 1 < rgui->folder_buf->size)
|
if (rgui->selection_ptr + 1 < rgui->folder_buf->size)
|
||||||
rgui->directory_ptr++;
|
rgui->selection_ptr++;
|
||||||
else
|
else
|
||||||
rgui->directory_ptr = 0;
|
rgui->selection_ptr = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGUI_ACTION_LEFT:
|
case RGUI_ACTION_LEFT:
|
||||||
if (rgui->directory_ptr - 8 > 0)
|
if (rgui->selection_ptr - 8 > 0)
|
||||||
rgui->directory_ptr -= 8;
|
rgui->selection_ptr -= 8;
|
||||||
else
|
else
|
||||||
rgui->directory_ptr = 0;
|
rgui->selection_ptr = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGUI_ACTION_RIGHT:
|
case RGUI_ACTION_RIGHT:
|
||||||
if (rgui->directory_ptr + 8 < rgui->folder_buf->size)
|
if (rgui->selection_ptr + 8 < rgui->folder_buf->size)
|
||||||
rgui->directory_ptr += 8;
|
rgui->selection_ptr += 8;
|
||||||
else
|
else
|
||||||
rgui->directory_ptr = rgui->folder_buf->size - 1;
|
rgui->selection_ptr = rgui->folder_buf->size - 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGUI_ACTION_CANCEL:
|
case RGUI_ACTION_CANCEL:
|
||||||
if (rgui->path_stack->size > 1)
|
if (rgui->path_stack->size > 1)
|
||||||
{
|
{
|
||||||
rgui->need_refresh = true;
|
rgui->need_refresh = true;
|
||||||
rgui->directory_ptr = directory_ptr;
|
rgui->selection_ptr = directory_ptr;
|
||||||
rgui_list_pop(rgui->path_stack);
|
rgui_list_pop(rgui->path_stack);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1337,7 +1337,7 @@ int rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
|||||||
|
|
||||||
const char *path = 0;
|
const char *path = 0;
|
||||||
unsigned type = 0;
|
unsigned type = 0;
|
||||||
rgui_list_get_at_offset(rgui->folder_buf, rgui->directory_ptr, &path, &type, NULL);
|
rgui_list_get_at_offset(rgui->folder_buf, rgui->selection_ptr, &path, &type, NULL);
|
||||||
|
|
||||||
if (type == RGUI_FILE_DIRECTORY)
|
if (type == RGUI_FILE_DIRECTORY)
|
||||||
{
|
{
|
||||||
@ -1346,20 +1346,20 @@ int rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
|||||||
|
|
||||||
if (strcmp(path, "..") == 0)
|
if (strcmp(path, "..") == 0)
|
||||||
{
|
{
|
||||||
rgui->directory_ptr = directory_ptr;
|
rgui->selection_ptr = directory_ptr;
|
||||||
rgui_list_pop(rgui->path_stack);
|
rgui_list_pop(rgui->path_stack);
|
||||||
}
|
}
|
||||||
else if (strcmp(path, ".") != 0)
|
else if (strcmp(path, ".") != 0)
|
||||||
{
|
{
|
||||||
rgui_list_push(rgui->path_stack, cat_path, RGUI_FILE_DIRECTORY, rgui->directory_ptr);
|
rgui_list_push(rgui->path_stack, cat_path, RGUI_FILE_DIRECTORY, rgui->selection_ptr);
|
||||||
rgui->directory_ptr = 0;
|
rgui->selection_ptr = 0;
|
||||||
}
|
}
|
||||||
rgui->need_refresh = true;
|
rgui->need_refresh = true;
|
||||||
}
|
}
|
||||||
else if (type == RGUI_FILE_DEVICE)
|
else if (type == RGUI_FILE_DEVICE)
|
||||||
{
|
{
|
||||||
rgui_list_push(rgui->path_stack, path, RGUI_FILE_DEVICE, rgui->directory_ptr);
|
rgui_list_push(rgui->path_stack, path, RGUI_FILE_DEVICE, rgui->selection_ptr);
|
||||||
rgui->directory_ptr = 0;
|
rgui->selection_ptr = 0;
|
||||||
rgui->need_refresh = true;
|
rgui->need_refresh = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1368,7 +1368,7 @@ int rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
|||||||
if (menu_type == RGUI_SETTINGS_CORE)
|
if (menu_type == RGUI_SETTINGS_CORE)
|
||||||
{
|
{
|
||||||
strlcpy(g_settings.libretro, path, sizeof(g_settings.libretro));
|
strlcpy(g_settings.libretro, path, sizeof(g_settings.libretro));
|
||||||
rgui->directory_ptr = directory_ptr;
|
rgui->selection_ptr = directory_ptr;
|
||||||
rgui->need_refresh = true;
|
rgui->need_refresh = true;
|
||||||
rgui_list_pop(rgui->path_stack);
|
rgui_list_pop(rgui->path_stack);
|
||||||
|
|
||||||
@ -1396,7 +1396,7 @@ int rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case RGUI_ACTION_REFRESH:
|
case RGUI_ACTION_REFRESH:
|
||||||
rgui->directory_ptr = 0;
|
rgui->selection_ptr = 0;
|
||||||
rgui->need_refresh = true;
|
rgui->need_refresh = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1404,15 +1404,15 @@ int rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
|
|||||||
#ifdef HAVE_LIBRETRO_MANAGEMENT
|
#ifdef HAVE_LIBRETRO_MANAGEMENT
|
||||||
if (menu_type == RGUI_SETTINGS_CORE)
|
if (menu_type == RGUI_SETTINGS_CORE)
|
||||||
{
|
{
|
||||||
rgui->directory_ptr = directory_ptr;
|
rgui->selection_ptr = directory_ptr;
|
||||||
rgui->need_refresh = true;
|
rgui->need_refresh = true;
|
||||||
rgui_list_pop(rgui->path_stack);
|
rgui_list_pop(rgui->path_stack);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
rgui_list_push(rgui->path_stack, "", RGUI_SETTINGS, rgui->directory_ptr);
|
rgui_list_push(rgui->path_stack, "", RGUI_SETTINGS, rgui->selection_ptr);
|
||||||
rgui->directory_ptr = 0;
|
rgui->selection_ptr = 0;
|
||||||
}
|
}
|
||||||
return rgui_settings_iterate(rgui, RGUI_ACTION_REFRESH);
|
return rgui_settings_iterate(rgui, RGUI_ACTION_REFRESH);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user