(360) Implemented auto aspect ratio

This commit is contained in:
TwinAphex51224 2012-05-22 20:15:27 +02:00
parent 69209b5e2e
commit d7f8f847e5
4 changed files with 9 additions and 4 deletions

View File

@ -432,6 +432,8 @@ begin_loop:
input_xdk360.poll(NULL);
rarch_set_auto_viewport(g_extern.frame_cache.width, g_extern.frame_cache.height);
do{
repeat = rarch_main_iterate();
}while(repeat && !g_console.frame_advance_enable);

View File

@ -367,6 +367,9 @@ static void xdk360_set_aspect_ratio(void * data, uint32_t aspectratio_index)
{
(void)data;
if(g_console.aspect_ratio_index == ASPECT_RATIO_AUTO)
rarch_set_auto_viewport(g_extern.frame_cache.width, g_extern.frame_cache.height);
g_settings.video.aspect_ratio = aspectratio_lut[g_console.aspect_ratio_index].value;
g_settings.video.force_aspect = false;
set_viewport(false);

View File

@ -486,12 +486,15 @@ struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END] = {
{ "19:14", 1.3571f },
{ "30:17", 1.7647f },
{ "32:9", 3.5555f },
{ "Auto", 0.0f },
{ "Auto", 1.0f },
{ "Custom", 0.0f }
};
void rarch_set_auto_viewport(unsigned width, unsigned height)
{
if(width == 0 || height == 0)
return;
unsigned aspect_x, aspect_y, len, highest, i;
len = width < height ? width : height;

View File

@ -557,9 +557,6 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
GLfloat yamt = (GLfloat)height / gl->tex_h;
set_texture_coords(gl->tex_coords, xamt, yamt);
if(g_console.aspect_ratio_index == ASPECT_RATIO_AUTO )
rarch_set_auto_viewport(width, height);
}
else if (width != gl->last_width[(gl->tex_index - 1) & TEXTURES_MASK] || height != gl->last_height[(gl->tex_index - 1) & TEXTURES_MASK])
{