Base size for windowed mode calculations.

This commit is contained in:
Themaister 2011-10-16 21:36:17 +02:00
parent fc594f7f0f
commit 5ae0cb1821
5 changed files with 13 additions and 6 deletions

View File

@ -109,8 +109,9 @@
//////////////// ////////////////
// Windowed // Windowed
static const float xscale = 3.0; // Real x res = 296 * xscale static const float xscale = 3.0; // Real x res = aspect * base_size * xscale
static const float yscale = 3.0; // Real y res = 224 * yscale static const float yscale = 3.0; // Real y res = base_size * yscale
static const unsigned base_size = 224; // Base size for windowed mode.
// Fullscreen // Fullscreen
static const bool fullscreen = false; // To start in Fullscreen or not static const bool fullscreen = false; // To start in Fullscreen or not

View File

@ -432,13 +432,13 @@ void init_video_input(void)
{ {
if (g_settings.video.force_aspect) if (g_settings.video.force_aspect)
{ {
width = 224 * g_settings.video.xscale * g_settings.video.aspect_ratio; width = roundf(g_settings.video.base_size * g_settings.video.xscale * g_settings.video.aspect_ratio);
height = 224 * g_settings.video.yscale; height = roundf(g_settings.video.base_size * g_settings.video.yscale);
} }
else else
{ {
width = 256 * g_settings.video.xscale; width = roundf(8.0f / 7.0f * g_settings.video.base_size * g_settings.video.xscale); // Assume 8:7 aspect.
height = 224 * g_settings.video.yscale; height = roundf(g_settings.video.base_size * g_settings.video.yscale);
} }
} }

View File

@ -70,6 +70,7 @@ struct settings
char driver[32]; char driver[32];
float xscale; float xscale;
float yscale; float yscale;
unsigned base_size;
bool fullscreen; bool fullscreen;
unsigned fullscreen_x; unsigned fullscreen_x;
unsigned fullscreen_y; unsigned fullscreen_y;

View File

@ -120,6 +120,7 @@ static void set_defaults(void)
g_settings.video.xscale = xscale; g_settings.video.xscale = xscale;
g_settings.video.yscale = yscale; g_settings.video.yscale = yscale;
g_settings.video.base_size = base_size;
g_settings.video.fullscreen = g_extern.force_fullscreen ? true : fullscreen; g_settings.video.fullscreen = g_extern.force_fullscreen ? true : fullscreen;
g_settings.video.fullscreen_x = fullscreen_x; g_settings.video.fullscreen_x = fullscreen_x;
g_settings.video.fullscreen_y = fullscreen_y; g_settings.video.fullscreen_y = fullscreen_y;
@ -297,6 +298,7 @@ static void parse_config_file(void)
CONFIG_GET_DOUBLE(video.xscale, "video_xscale"); CONFIG_GET_DOUBLE(video.xscale, "video_xscale");
CONFIG_GET_DOUBLE(video.yscale, "video_yscale"); CONFIG_GET_DOUBLE(video.yscale, "video_yscale");
CONFIG_GET_INT(video.base_size, "video_base_size");
CONFIG_GET_INT(video.fullscreen_x, "video_fullscreen_x"); CONFIG_GET_INT(video.fullscreen_x, "video_fullscreen_x");
CONFIG_GET_INT(video.fullscreen_y, "video_fullscreen_y"); CONFIG_GET_INT(video.fullscreen_y, "video_fullscreen_y");

View File

@ -23,6 +23,9 @@
# video_xscale = 3.0 # video_xscale = 3.0
# video_yscale = 3.0 # video_yscale = 3.0
# Base size for windowed mode calculations. Generally 224 for SNES, but can be modified.
# video_base_size = 224
# Fullscreen resolution. Resolution of 0 uses the resolution of the desktop. # Fullscreen resolution. Resolution of 0 uses the resolution of the desktop.
# video_fullscreen_x = 0 # video_fullscreen_x = 0
# video_fullscreen_y = 0 # video_fullscreen_y = 0