mirror of
https://github.com/libretro/RetroArch
synced 2025-01-26 09:35:21 +00:00
(PS3) Updated to work with new viewport settings code
This commit is contained in:
parent
4ecdddb2cb
commit
d51772dcb1
24
ps3/main.c
24
ps3/main.c
@ -141,10 +141,10 @@ static void set_default_settings(void)
|
||||
g_console.overscan_enable = false;
|
||||
g_console.overscan_amount = 0.0f;
|
||||
g_console.sound_mode = SOUND_MODE_NORMAL;
|
||||
g_console.custom_viewport_width = 0;
|
||||
g_console.custom_viewport_height = 0;
|
||||
g_console.custom_viewport_x = 0;
|
||||
g_console.custom_viewport_y = 0;
|
||||
g_console.viewports.custom_vp.width = 0;
|
||||
g_console.viewports.custom_vp.height = 0;
|
||||
g_console.viewports.custom_vp.x = 0;
|
||||
g_console.viewports.custom_vp.y = 0;
|
||||
g_console.custom_bgm_enable = true;
|
||||
|
||||
// g_extern
|
||||
@ -230,10 +230,10 @@ static void init_settings(bool load_libretro_path)
|
||||
CONFIG_GET_BOOL_CONSOLE(triple_buffering_enable, "triple_buffering_enable");
|
||||
CONFIG_GET_INT_CONSOLE(aspect_ratio_index, "aspect_ratio_index");
|
||||
CONFIG_GET_INT_CONSOLE(current_resolution_id, "current_resolution_id");
|
||||
CONFIG_GET_INT_CONSOLE(custom_viewport_x, "custom_viewport_x");
|
||||
CONFIG_GET_INT_CONSOLE(custom_viewport_y, "custom_viewport_y");
|
||||
CONFIG_GET_INT_CONSOLE(custom_viewport_width, "custom_viewport_width");
|
||||
CONFIG_GET_INT_CONSOLE(custom_viewport_height, "custom_viewport_height");
|
||||
CONFIG_GET_INT_CONSOLE(viewports.custom_vp.x, "custom_viewport_x");
|
||||
CONFIG_GET_INT_CONSOLE(viewports.custom_vp.y, "custom_viewport_y");
|
||||
CONFIG_GET_INT_CONSOLE(viewports.custom_vp.width, "custom_viewport_width");
|
||||
CONFIG_GET_INT_CONSOLE(viewports.custom_vp.height, "custom_viewport_height");
|
||||
CONFIG_GET_INT_CONSOLE(screen_orientation, "screen_orientation");
|
||||
CONFIG_GET_INT_CONSOLE(sound_mode, "sound_mode");
|
||||
CONFIG_GET_STRING_CONSOLE(default_rom_startup_dir, "default_rom_startup_dir");
|
||||
@ -294,10 +294,10 @@ static void save_settings(void)
|
||||
config_set_int(conf, "sound_mode", g_console.sound_mode);
|
||||
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, "custom_viewport_width", g_console.custom_viewport_width);
|
||||
config_set_int(conf, "custom_viewport_height", g_console.custom_viewport_height);
|
||||
config_set_int(conf, "custom_viewport_x", g_console.custom_viewport_x);
|
||||
config_set_int(conf, "custom_viewport_y", g_console.custom_viewport_y);
|
||||
config_set_int(conf, "custom_viewport_width", g_console.viewports.custom_vp.width);
|
||||
config_set_int(conf, "custom_viewport_height", g_console.viewports.custom_vp.height);
|
||||
config_set_int(conf, "custom_viewport_x", g_console.viewports.custom_vp.x);
|
||||
config_set_int(conf, "custom_viewport_y", g_console.viewports.custom_vp.y);
|
||||
config_set_int(conf, "screen_orientation", g_console.screen_orientation);
|
||||
config_set_string(conf, "default_rom_startup_dir", g_console.default_rom_startup_dir);
|
||||
config_set_float(conf, "menu_font_size", g_console.menu_font_size);
|
||||
|
32
ps3/menu.c
32
ps3/menu.c
@ -2246,31 +2246,31 @@ static void ingame_menu(uint32_t menu_id)
|
||||
}
|
||||
|
||||
if(CTRL_LSTICK_LEFT(state) || CTRL_LEFT(state))
|
||||
g_console.custom_viewport_x -= 1;
|
||||
g_console.viewports.custom_vp.x -= 1;
|
||||
else if (CTRL_LSTICK_RIGHT(state) || CTRL_RIGHT(state))
|
||||
g_console.custom_viewport_x += 1;
|
||||
g_console.viewports.custom_vp.x += 1;
|
||||
|
||||
if (CTRL_LSTICK_UP(state) || CTRL_UP(state))
|
||||
g_console.custom_viewport_y += 1;
|
||||
g_console.viewports.custom_vp.y += 1;
|
||||
else if (CTRL_LSTICK_DOWN(state) || CTRL_DOWN(state))
|
||||
g_console.custom_viewport_y -= 1;
|
||||
g_console.viewports.custom_vp.y -= 1;
|
||||
|
||||
if (CTRL_RSTICK_LEFT(state) || CTRL_L1(state))
|
||||
g_console.custom_viewport_width -= 1;
|
||||
g_console.viewports.custom_vp.width -= 1;
|
||||
else if (CTRL_RSTICK_RIGHT(state) || CTRL_R1(state))
|
||||
g_console.custom_viewport_width += 1;
|
||||
g_console.viewports.custom_vp.width += 1;
|
||||
|
||||
if (CTRL_RSTICK_UP(state) || CTRL_L2(state))
|
||||
g_console.custom_viewport_height += 1;
|
||||
g_console.viewports.custom_vp.height += 1;
|
||||
else if (CTRL_RSTICK_DOWN(state) || CTRL_R2(state))
|
||||
g_console.custom_viewport_height -= 1;
|
||||
g_console.viewports.custom_vp.height -= 1;
|
||||
|
||||
if (CTRL_TRIANGLE(state))
|
||||
{
|
||||
g_console.custom_viewport_x = 0;
|
||||
g_console.custom_viewport_y = 0;
|
||||
g_console.custom_viewport_width = gl->win_width;
|
||||
g_console.custom_viewport_height = gl->win_height;
|
||||
g_console.viewports.custom_vp.x = 0;
|
||||
g_console.viewports.custom_vp.y = 0;
|
||||
g_console.viewports.custom_vp.width = gl->win_width;
|
||||
g_console.viewports.custom_vp.height = gl->win_height;
|
||||
}
|
||||
if(CTRL_CIRCLE(state))
|
||||
{
|
||||
@ -2288,13 +2288,13 @@ static void ingame_menu(uint32_t menu_id)
|
||||
cellDbgFontPrintf (0.3f, 0.05f, 0.82f, WHITE, "Libretro core: %s", id);
|
||||
cellDbgFontPrintf (0.9f, 0.09f, 0.82f, WHITE, "v%s", EMULATOR_VERSION);
|
||||
cellDbgFontPrintf(x_position, 0.14f, 1.4f, WHITE, "Resize Mode");
|
||||
cellDbgFontPrintf(x_position, ypos, font_size, GREEN, "Viewport X: #%d", g_console.custom_viewport_x);
|
||||
cellDbgFontPrintf(x_position, ypos, font_size, GREEN, "Viewport X: #%d", g_console.viewports.custom_vp.x);
|
||||
|
||||
cellDbgFontPrintf(x_position, ypos+(ypos_increment*1), font_size, GREEN, "Viewport Y: #%d", g_console.custom_viewport_y);
|
||||
cellDbgFontPrintf(x_position, ypos+(ypos_increment*1), font_size, GREEN, "Viewport Y: #%d", g_console.viewports.custom_vp.y);
|
||||
|
||||
cellDbgFontPrintf(x_position, ypos+(ypos_increment*2), font_size, GREEN, "Viewport Width: #%d", g_console.custom_viewport_width);
|
||||
cellDbgFontPrintf(x_position, ypos+(ypos_increment*2), font_size, GREEN, "Viewport Width: #%d", g_console.viewports.custom_vp.width);
|
||||
|
||||
cellDbgFontPrintf(x_position, ypos+(ypos_increment*3), font_size, GREEN, "Viewport Height: #%d", g_console.custom_viewport_height);
|
||||
cellDbgFontPrintf(x_position, ypos+(ypos_increment*3), font_size, GREEN, "Viewport Height: #%d", g_console.viewports.custom_vp.height);
|
||||
|
||||
cellDbgFontPrintf (0.09f, 0.40f, font_size, LIGHTBLUE, "CONTROLS:");
|
||||
|
||||
|
@ -404,10 +404,10 @@ static void set_viewport(gl_t *gl, unsigned width, unsigned height)
|
||||
if(g_console.aspect_ratio_index == ASPECT_RATIO_CUSTOM)
|
||||
{
|
||||
delta = (desired_aspect / device_aspect - 1.0) / 2.0 + 0.5;
|
||||
m_viewport_x_temp = g_console.custom_viewport_x;
|
||||
m_viewport_y_temp = g_console.custom_viewport_y;
|
||||
m_viewport_width_temp = g_console.custom_viewport_width;
|
||||
m_viewport_height_temp = g_console.custom_viewport_height;
|
||||
m_viewport_x_temp = g_console.viewports.custom_vp.x;
|
||||
m_viewport_y_temp = g_console.viewports.custom_vp.y;
|
||||
m_viewport_width_temp = g_console.viewports.custom_vp.width;
|
||||
m_viewport_height_temp = g_console.viewports.custom_vp.height;
|
||||
}
|
||||
else if (device_aspect > desired_aspect)
|
||||
{
|
||||
@ -786,11 +786,11 @@ static bool psgl_init_device(gl_t *gl, const video_info_t *video, uint32_t resol
|
||||
gl->gl_device = psglCreateDeviceExtended(¶ms);
|
||||
psglGetDeviceDimensions(gl->gl_device, &gl->win_width, &gl->win_height);
|
||||
|
||||
if(g_console.custom_viewport_width == 0)
|
||||
g_console.custom_viewport_width = gl->win_width;
|
||||
if(g_console.viewports.custom_vp.width == 0)
|
||||
g_console.viewports.custom_vp.width = gl->win_width;
|
||||
|
||||
if(g_console.custom_viewport_height == 0)
|
||||
g_console.custom_viewport_height = gl->win_height;
|
||||
if(g_console.viewports.custom_vp.height == 0)
|
||||
g_console.viewports.custom_vp.height = gl->win_height;
|
||||
|
||||
gl->gl_context = psglCreateContext();
|
||||
psglMakeCurrent(gl->gl_context, gl->gl_device);
|
||||
|
Loading…
x
Reference in New Issue
Block a user