mirror of
https://github.com/libretro/RetroArch
synced 2025-01-27 03:35:22 +00:00
(PS3) Added aspect ratio settings/options
This commit is contained in:
parent
2c61f2b1e7
commit
766bdf727c
@ -125,7 +125,7 @@ static void set_default_settings(void)
|
|||||||
strlcpy(g_console.default_savestate_dir, usrDirPath, sizeof(g_console.default_savestate_dir));
|
strlcpy(g_console.default_savestate_dir, usrDirPath, sizeof(g_console.default_savestate_dir));
|
||||||
strlcpy(g_console.default_sram_dir, usrDirPath, sizeof(g_console.default_sram_dir));
|
strlcpy(g_console.default_sram_dir, usrDirPath, sizeof(g_console.default_sram_dir));
|
||||||
g_console.aspect_ratio_index = 0;
|
g_console.aspect_ratio_index = 0;
|
||||||
strlcpy(g_console.aspect_ratio_name, "4/3", sizeof(g_console.aspect_ratio_name));
|
strlcpy(g_console.aspect_ratio_name, "4:3", sizeof(g_console.aspect_ratio_name));
|
||||||
|
|
||||||
// g_extern
|
// g_extern
|
||||||
g_extern.state_slot = 0;
|
g_extern.state_slot = 0;
|
||||||
@ -167,6 +167,7 @@ static void init_settings(void)
|
|||||||
CONFIG_GET_INT_CONSOLE(aspect_ratio_index, "aspect_ratio_index");
|
CONFIG_GET_INT_CONSOLE(aspect_ratio_index, "aspect_ratio_index");
|
||||||
CONFIG_GET_INT_CONSOLE(current_resolution_id, "current_resolution_id");
|
CONFIG_GET_INT_CONSOLE(current_resolution_id, "current_resolution_id");
|
||||||
CONFIG_GET_INT_CONSOLE(screen_orientation, "screen_orientation");
|
CONFIG_GET_INT_CONSOLE(screen_orientation, "screen_orientation");
|
||||||
|
CONFIG_GET_STRING_CONSOLE(aspect_ratio_name, "aspect_ratio_name");
|
||||||
CONFIG_GET_STRING_CONSOLE(default_rom_startup_dir, "default_rom_startup_dir");
|
CONFIG_GET_STRING_CONSOLE(default_rom_startup_dir, "default_rom_startup_dir");
|
||||||
|
|
||||||
// g_extern
|
// g_extern
|
||||||
@ -208,6 +209,7 @@ static void save_settings(void)
|
|||||||
config_set_int(conf, "aspect_ratio_index", g_console.aspect_ratio_index);
|
config_set_int(conf, "aspect_ratio_index", g_console.aspect_ratio_index);
|
||||||
config_set_int(conf, "current_resolution_id", g_console.current_resolution_id);
|
config_set_int(conf, "current_resolution_id", g_console.current_resolution_id);
|
||||||
config_set_int(conf, "screen_orientation", g_console.screen_orientation);
|
config_set_int(conf, "screen_orientation", g_console.screen_orientation);
|
||||||
|
config_set_string(conf, "aspect_ratio_name", g_console.aspect_ratio_name);
|
||||||
config_set_string(conf, "default_rom_startup_dir", g_console.default_rom_startup_dir);
|
config_set_string(conf, "default_rom_startup_dir", g_console.default_rom_startup_dir);
|
||||||
|
|
||||||
// g_extern
|
// g_extern
|
||||||
|
33
ps3/menu.c
33
ps3/menu.c
@ -361,6 +361,11 @@ static void set_setting_label(menu * menu_obj, int currentsetting)
|
|||||||
case SETTING_FONT_SIZE:
|
case SETTING_FONT_SIZE:
|
||||||
break;
|
break;
|
||||||
case SETTING_KEEP_ASPECT_RATIO:
|
case SETTING_KEEP_ASPECT_RATIO:
|
||||||
|
if(g_console.aspect_ratio_index == ASPECT_RATIO_4_3)
|
||||||
|
menu_obj->items[currentsetting].text_color = GREEN;
|
||||||
|
else
|
||||||
|
menu_obj->items[currentsetting].text_color = ORANGE;
|
||||||
|
snprintf(menu_obj->items[currentsetting].setting_text, sizeof(menu_obj->items[currentsetting].setting_text), g_console.aspect_ratio_name);
|
||||||
break;
|
break;
|
||||||
case SETTING_HW_TEXTURE_FILTER:
|
case SETTING_HW_TEXTURE_FILTER:
|
||||||
if(g_settings.video.smooth)
|
if(g_settings.video.smooth)
|
||||||
@ -975,6 +980,8 @@ static void producesettingentry(menu * menu_obj, uint64_t switchvalue)
|
|||||||
if(CTRL_START(state))
|
if(CTRL_START(state))
|
||||||
{
|
{
|
||||||
gl_cg_load_shader(1, DEFAULT_SHADER_FILE);
|
gl_cg_load_shader(1, DEFAULT_SHADER_FILE);
|
||||||
|
strlcpy(g_settings.video.cg_shader_path, DEFAULT_SHADER_FILE, sizeof(g_settings.video.cg_shader_path));
|
||||||
|
menu_reinit_settings();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SETTING_SHADER_2:
|
case SETTING_SHADER_2:
|
||||||
@ -989,11 +996,37 @@ static void producesettingentry(menu * menu_obj, uint64_t switchvalue)
|
|||||||
if(CTRL_START(state))
|
if(CTRL_START(state))
|
||||||
{
|
{
|
||||||
gl_cg_load_shader(2, DEFAULT_SHADER_FILE);
|
gl_cg_load_shader(2, DEFAULT_SHADER_FILE);
|
||||||
|
strlcpy(g_settings.video.second_pass_shader, DEFAULT_SHADER_FILE, sizeof(g_settings.video.second_pass_shader));
|
||||||
|
menu_reinit_settings();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SETTING_FONT_SIZE:
|
case SETTING_FONT_SIZE:
|
||||||
break;
|
break;
|
||||||
case SETTING_KEEP_ASPECT_RATIO:
|
case SETTING_KEEP_ASPECT_RATIO:
|
||||||
|
if(CTRL_LEFT(state) || CTRL_LSTICK_LEFT(state))
|
||||||
|
{
|
||||||
|
if(g_console.aspect_ratio_index > 0)
|
||||||
|
{
|
||||||
|
g_console.aspect_ratio_index--;
|
||||||
|
ps3graphics_set_aspect_ratio(g_console.aspect_ratio_index);
|
||||||
|
set_text_message("", 7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(CTRL_RIGHT(state) || CTRL_LSTICK_RIGHT(state))
|
||||||
|
{
|
||||||
|
if(g_console.aspect_ratio_index < LAST_ASPECT_RATIO)
|
||||||
|
{
|
||||||
|
g_console.aspect_ratio_index++;
|
||||||
|
ps3graphics_set_aspect_ratio(g_console.aspect_ratio_index);
|
||||||
|
set_text_message("", 7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(CTRL_START(state))
|
||||||
|
{
|
||||||
|
g_console.aspect_ratio_index = ASPECT_RATIO_4_3;
|
||||||
|
ps3graphics_set_aspect_ratio(g_console.aspect_ratio_index);
|
||||||
|
set_text_message("", 7);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SETTING_HW_TEXTURE_FILTER:
|
case SETTING_HW_TEXTURE_FILTER:
|
||||||
if(CTRL_LEFT(state) || CTRL_LSTICK_LEFT(state) || CTRL_RIGHT(state) || CTRL_LSTICK_RIGHT(state) || CTRL_CROSS(state))
|
if(CTRL_LEFT(state) || CTRL_LSTICK_LEFT(state) || CTRL_RIGHT(state) || CTRL_LSTICK_RIGHT(state) || CTRL_CROSS(state))
|
||||||
|
@ -487,7 +487,7 @@ void gl_frame_menu (void)
|
|||||||
gl->win_height, gl->win_width, gl->win_height, g_frame_count,
|
gl->win_height, gl->win_width, gl->win_height, g_frame_count,
|
||||||
NULL, NULL, NULL, 0);
|
NULL, NULL, NULL, 0);
|
||||||
|
|
||||||
set_viewport(gl, gl->win_width, gl->win_height, false);
|
set_viewport(gl, gl->win_width, gl->win_height, true);
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, gl->menu_texture_id);
|
glBindTexture(GL_TEXTURE_2D, gl->menu_texture_id);
|
||||||
@ -1316,6 +1316,7 @@ void ps3graphics_set_aspect_ratio(uint32_t aspectratio_index)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
g_settings.video.force_aspect = false;
|
g_settings.video.force_aspect = false;
|
||||||
|
gl->keep_aspect = true;
|
||||||
set_viewport(gl, gl->win_width, gl->win_height, false);
|
set_viewport(gl, gl->win_width, gl->win_height, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user