(PS3) Added aspect ratio settings/options

This commit is contained in:
TwinAphex51224 2012-01-31 18:21:53 +01:00
parent 2c61f2b1e7
commit 766bdf727c
3 changed files with 38 additions and 2 deletions

View File

@ -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_sram_dir, usrDirPath, sizeof(g_console.default_sram_dir));
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.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(current_resolution_id, "current_resolution_id");
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");
// 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, "current_resolution_id", g_console.current_resolution_id);
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);
// g_extern

View File

@ -361,6 +361,11 @@ static void set_setting_label(menu * menu_obj, int currentsetting)
case SETTING_FONT_SIZE:
break;
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;
case SETTING_HW_TEXTURE_FILTER:
if(g_settings.video.smooth)
@ -975,6 +980,8 @@ static void producesettingentry(menu * menu_obj, uint64_t switchvalue)
if(CTRL_START(state))
{
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;
case SETTING_SHADER_2:
@ -989,11 +996,37 @@ static void producesettingentry(menu * menu_obj, uint64_t switchvalue)
if(CTRL_START(state))
{
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;
case SETTING_FONT_SIZE:
break;
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;
case SETTING_HW_TEXTURE_FILTER:
if(CTRL_LEFT(state) || CTRL_LSTICK_LEFT(state) || CTRL_RIGHT(state) || CTRL_LSTICK_RIGHT(state) || CTRL_CROSS(state))

View File

@ -487,7 +487,7 @@ void gl_frame_menu (void)
gl->win_height, gl->win_width, gl->win_height, g_frame_count,
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);
glBindTexture(GL_TEXTURE_2D, gl->menu_texture_id);
@ -1316,6 +1316,7 @@ void ps3graphics_set_aspect_ratio(uint32_t aspectratio_index)
break;
}
g_settings.video.force_aspect = false;
gl->keep_aspect = true;
set_viewport(gl, gl->win_width, gl->win_height, false);
}