This commit is contained in:
twinaphex 2016-02-04 21:27:58 +01:00
parent 050cf545bf
commit 3a5ddf15cf
3 changed files with 42 additions and 21 deletions

View File

@ -163,7 +163,8 @@ static const char *menu_video_get_ident(void)
return video_driver_get_ident();
}
static bool menu_display_check_compatibility(enum menu_display_driver_type type)
static bool menu_display_check_compatibility(
enum menu_display_driver_type type)
{
const char *video_driver = menu_video_get_ident();
@ -191,7 +192,8 @@ bool menu_display_driver_init_first(void)
for (i = 0; menu_display_ctx_drivers[i]; i++)
{
if (!menu_display_check_compatibility(menu_display_ctx_drivers[i]->type))
if (!menu_display_check_compatibility(
menu_display_ctx_drivers[i]->type))
continue;
RARCH_LOG("Found menu display driver: \"%s\".\n",
@ -308,7 +310,8 @@ bool menu_display_ctl(enum menu_display_ctl_state state, void *data)
return true;
case MENU_DISPLAY_CTL_LIBRETRO_RUNNING:
if (!settings->menu.pause_libretro)
if (rarch_ctl(RARCH_CTL_IS_INITED, NULL) && !rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
if (rarch_ctl(RARCH_CTL_IS_INITED, NULL)
&& !rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
return true;
break;
case MENU_DISPLAY_CTL_LIBRETRO:
@ -316,7 +319,8 @@ bool menu_display_ctl(enum menu_display_ctl_state state, void *data)
if (menu_display_ctl(MENU_DISPLAY_CTL_LIBRETRO_RUNNING, NULL))
{
bool libretro_input_is_blocked = input_driver_ctl(RARCH_INPUT_CTL_IS_LIBRETRO_INPUT_BLOCKED, NULL);
bool libretro_input_is_blocked =
input_driver_ctl(RARCH_INPUT_CTL_IS_LIBRETRO_INPUT_BLOCKED, NULL);
if (!libretro_input_is_blocked)
input_driver_ctl(RARCH_INPUT_CTL_SET_LIBRETRO_INPUT_BLOCKED, NULL);
@ -534,7 +538,8 @@ void menu_display_timedate(char *s, size_t len, unsigned time_mode)
}
}
void menu_display_msg_queue_push(const char *msg, unsigned prio, unsigned duration,
void menu_display_msg_queue_push(const char *msg,
unsigned prio, unsigned duration,
bool flush)
{
runloop_msg_queue_push(msg, prio, duration, flush);
@ -542,8 +547,10 @@ void menu_display_msg_queue_push(const char *msg, unsigned prio, unsigned durati
void menu_display_matrix_4x4_rotate_z(math_matrix_4x4 *matrix, float rotation,
float scale_x, float scale_y, float scale_z, bool scale_enable)
void menu_display_matrix_4x4_rotate_z(
math_matrix_4x4 *matrix, float rotation,
float scale_x, float scale_y, float scale_z,
bool scale_enable)
{
math_matrix_4x4 matrix_rotated, matrix_scaled;
math_matrix_4x4 *b = NULL;
@ -586,11 +593,13 @@ void menu_display_draw(float x, float y,
enum menu_display_prim_type prim_type
)
{
menu_display_ctx_driver_t *menu_disp = menu_display_context_get_ptr();
menu_display_ctx_driver_t *menu_disp =
menu_display_context_get_ptr();
if (!menu_disp || !menu_disp->draw)
return;
menu_disp->draw(x, y, width, height, coords, matrix_data, texture, prim_type);
menu_disp->draw(x, y, width, height,
coords, matrix_data, texture, prim_type);
}
void menu_display_draw_bg(
@ -610,7 +619,8 @@ void menu_display_draw_bg(
if (!menu_disp || !menu_disp->draw_bg)
return;
menu_disp->draw_bg(width, height, texture, handle_alpha, force_transparency, color,
menu_disp->draw_bg(width, height, texture, handle_alpha,
force_transparency, color,
color2, vertex, tex_coord, vertex_count, prim_type);
}
@ -641,7 +651,8 @@ const float *menu_display_get_tex_coords(void)
return menu_disp->get_tex_coords();
}
void menu_display_handle_wallpaper_upload(void *task_data, void *user_data, const char *err)
void menu_display_handle_wallpaper_upload(void *task_data,
void *user_data, const char *err)
{
struct texture_image *img = (struct texture_image*)task_data;
menu_driver_load_image(img, MENU_IMAGE_WALLPAPER);
@ -649,7 +660,8 @@ void menu_display_handle_wallpaper_upload(void *task_data, void *user_data, cons
free(img);
}
void menu_display_handle_boxart_upload(void *task_data, void *user_data, const char *err)
void menu_display_handle_boxart_upload(void *task_data,
void *user_data, const char *err)
{
struct texture_image *img = (struct texture_image*)task_data;
menu_driver_load_image(img, MENU_IMAGE_BOXART);

View File

@ -121,7 +121,8 @@ bool menu_navigation_ctl(enum menu_navigation_ctl_state state, void *data)
if (!scroll_speed)
return false;
if (selection == 0 && !settings->menu.navigation.wraparound.enable)
if (selection == 0
&& !settings->menu.navigation.wraparound.enable)
return false;
if (selection >= *scroll_speed)
@ -146,7 +147,8 @@ bool menu_navigation_ctl(enum menu_navigation_ctl_state state, void *data)
case MENU_NAVIGATION_CTL_SET_LAST:
{
size_t new_selection = menu_list_size - 1;
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &new_selection);
menu_navigation_ctl(
MENU_NAVIGATION_CTL_SET_SELECTION, &new_selection);
menu_driver_ctl(RARCH_MENU_CTL_NAVIGATION_SET_LAST, NULL);
}
return true;
@ -190,7 +192,8 @@ bool menu_navigation_ctl(enum menu_navigation_ctl_state state, void *data)
i--;
*ptr_out = nav->scroll.indices.list[i - 1];
menu_driver_ctl(RARCH_MENU_CTL_NAVIGATION_DESCEND_ALPHABET, ptr_out);
menu_driver_ctl(
RARCH_MENU_CTL_NAVIGATION_DESCEND_ALPHABET, ptr_out);
}
return true;
case MENU_NAVIGATION_CTL_GET_SELECTION:

View File

@ -104,12 +104,14 @@ void menu_shader_manager_init(menu_handle_t *menu)
const char *shader_dir = *settings->video.shader_dir ?
settings->video.shader_dir : settings->system_directory;
fill_pathname_join(preset_path, shader_dir, "menu.glslp", sizeof(preset_path));
fill_pathname_join(preset_path, shader_dir,
"menu.glslp", sizeof(preset_path));
conf = config_file_new(preset_path);
if (!conf)
{
fill_pathname_join(preset_path, shader_dir, "menu.cgp", sizeof(preset_path));
fill_pathname_join(preset_path, shader_dir,
"menu.cgp", sizeof(preset_path));
conf = config_file_new(preset_path);
}
@ -169,7 +171,8 @@ void menu_shader_manager_set_preset(struct video_shader *shader,
if (!conf)
return;
RARCH_LOG("Setting Menu shader: %s.\n", preset_path ? preset_path : "N/A (stock)");
RARCH_LOG("Setting Menu shader: %s.\n", preset_path
? preset_path : "N/A (stock)");
if (video_shader_read_conf_cgp(conf, shader))
{
@ -193,7 +196,8 @@ void menu_shader_manager_save_preset(
const char *basename, bool apply)
{
#ifdef HAVE_SHADER_MANAGER
char buffer[PATH_MAX_LENGTH], config_directory[PATH_MAX_LENGTH], preset_path[PATH_MAX_LENGTH];
char buffer[PATH_MAX_LENGTH], config_directory[PATH_MAX_LENGTH],
preset_path[PATH_MAX_LENGTH];
unsigned d, type = RARCH_SHADER_NONE;
const char *dirs[3] = {0};
config_file_t *conf = NULL;
@ -205,7 +209,8 @@ void menu_shader_manager_save_preset(
if (!menu)
{
RARCH_ERR("Cannot save shader preset, menu handle is not initialized.\n");
RARCH_ERR("Cannot save shader preset, menu handle"
" is not initialized.\n");
return;
}
@ -279,7 +284,8 @@ void menu_shader_manager_save_preset(
config_file_free(conf);
if (!ret)
RARCH_ERR("Failed to save shader preset. Make sure config directory and/or shader dir are writable.\n");
RARCH_ERR("Failed to save shader preset. Make sure config directory"
" and/or shader dir are writable.\n");
#endif
}