(PS3) Saves custom viewport settings now

This commit is contained in:
TwinAphex51224 2012-03-03 16:10:03 +01:00
parent cd08339051
commit 8ef9e99960
3 changed files with 24 additions and 33 deletions

View File

@ -2252,31 +2252,31 @@ static void ingame_menu(uint32_t menu_id)
}
if(CTRL_LSTICK_LEFT(state) || CTRL_LEFT(state))
gl->custom_viewport_x -= 1;
g_console.custom_viewport_x -= 1;
else if (CTRL_LSTICK_RIGHT(state) || CTRL_RIGHT(state))
gl->custom_viewport_x += 1;
g_console.custom_viewport_x += 1;
if (CTRL_LSTICK_UP(state) || CTRL_UP(state))
gl->custom_viewport_y += 1;
g_console.custom_viewport_y += 1;
else if (CTRL_LSTICK_DOWN(state) || CTRL_DOWN(state))
gl->custom_viewport_y -= 1;
g_console.custom_viewport_y -= 1;
if (CTRL_RSTICK_LEFT(state) || CTRL_L1(state))
gl->custom_viewport_width -= 1;
g_console.custom_viewport_width -= 1;
else if (CTRL_RSTICK_RIGHT(state) || CTRL_R1(state))
gl->custom_viewport_width += 1;
g_console.custom_viewport_width += 1;
if (CTRL_RSTICK_UP(state) || CTRL_L2(state))
gl->custom_viewport_height += 1;
g_console.custom_viewport_height += 1;
else if (CTRL_RSTICK_DOWN(state) || CTRL_R2(state))
gl->custom_viewport_height -= 1;
g_console.custom_viewport_height -= 1;
if (CTRL_TRIANGLE(state))
{
gl->custom_viewport_x = 0;
gl->custom_viewport_y = 0;
gl->custom_viewport_width = gl->win_width;
gl->custom_viewport_height = gl->win_height;
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;
}
if(CTRL_CIRCLE(state))
{
@ -2290,13 +2290,13 @@ static void ingame_menu(uint32_t menu_id)
cellDbgFontPrintf (0.3f, 0.05f, 0.82f, WHITE, "Libsnes core: %s", snes_library_id());
cellDbgFontPrintf (0.7f, 0.05f, 0.82f, WHITE, "%s v%s", EMULATOR_NAME, EMULATOR_VERSION);
cellDbgFontPrintf(x_position, 0.14f, 1.4f, WHITE, "Resize Mode");
cellDbgFontPrintf (x_position, ypos, font_size, GREEN, "Viewport X: #%d", gl->custom_viewport_x);
cellDbgFontPrintf (x_position, ypos, font_size, GREEN, "Viewport X: #%d", g_console.custom_viewport_x);
cellDbgFontPrintf (x_position, ypos+(ypos_increment*1), font_size, GREEN, "Viewport Y: #%d", gl->custom_viewport_y);
cellDbgFontPrintf (x_position, ypos+(ypos_increment*1), font_size, GREEN, "Viewport Y: #%d", g_console.custom_viewport_y);
cellDbgFontPrintf (x_position, ypos+(ypos_increment*2), font_size, GREEN, "Viewport Width: #%d", gl->custom_viewport_width);
cellDbgFontPrintf (x_position, ypos+(ypos_increment*2), font_size, GREEN, "Viewport Width: #%d", g_console.custom_viewport_width);
cellDbgFontPrintf (x_position, ypos+(ypos_increment*3), font_size, GREEN, "Viewport Height: #%d", gl->custom_viewport_height);
cellDbgFontPrintf (x_position, ypos+(ypos_increment*3), font_size, GREEN, "Viewport Height: #%d", g_console.custom_viewport_height);
cellDbgFontPrintf (0.09f, 0.40f, font_size, LIGHTBLUE, "CONTROLS:");

View File

@ -444,10 +444,10 @@ static void set_viewport(gl_t *gl, unsigned width, unsigned height, bool force_f
// If the aspect ratios of screen and desired aspect ratio are sufficiently equal (floating point stuff),
if(g_console.aspect_ratio_index == ASPECT_RATIO_CUSTOM)
{
m_viewport_x_temp = gl->custom_viewport_x;
m_viewport_y_temp = gl->custom_viewport_y;
m_viewport_width_temp = gl->custom_viewport_width;
m_viewport_height_temp = gl->custom_viewport_height;
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;
}
else if (device_aspect > desired_aspect)
{
@ -816,10 +816,10 @@ static bool psgl_init_device(gl_t *gl, const video_info_t *video, uint32_t resol
gl->gl_device = psglCreateDeviceExtended(&params);
psglGetDeviceDimensions(gl->gl_device, &gl->win_width, &gl->win_height);
if(gl->custom_viewport_width == 0)
gl->custom_viewport_width = gl->win_width;
if(gl->custom_viewport_height == 0)
gl->custom_viewport_height = gl->win_height;
if(g_console.custom_viewport_width == 0)
g_console.custom_viewport_width = gl->win_width;
if(g_console.custom_viewport_height == 0)
g_console.custom_viewport_height = gl->win_height;
gl->gl_context = psglCreateContext();
psglMakeCurrent(gl->gl_context, gl->gl_device);
@ -1284,11 +1284,6 @@ void ps3graphics_video_init(bool get_all_resolutions)
gl_t * gl = g_gl;
gl->custom_viewport_width = g_console.custom_viewport_width;
gl->custom_viewport_height = g_console.custom_viewport_height;
gl->custom_viewport_x = g_console.custom_viewport_x;
gl->custom_viewport_y = g_console.custom_viewport_y;
gl->overscan_enable = g_console.overscan_enable;
gl->overscan_amount = g_console.overscan_amount;

View File

@ -71,10 +71,6 @@ typedef struct gl
bool overscan_enable;
int fbo_pass;
unsigned base_size; /* 2 or 4*/
unsigned custom_viewport_x;
unsigned custom_viewport_y;
unsigned custom_viewport_width;
unsigned custom_viewport_height;
unsigned last_width[TEXTURES];
unsigned last_height[TEXTURES];
unsigned tex_index; /* For use with PREV. */