Add allow_rotate.

This commit is contained in:
Themaister 2012-04-01 16:12:04 +02:00
parent 525d9b3cf5
commit 38a4141eef
5 changed files with 15 additions and 0 deletions

View file

@ -212,6 +212,10 @@ static const float refresh_rate = 59.92;
static const float refresh_rate = 59.95;
#endif
// Allow games to set rotation. If false, rotation requests are honored, but ignored.
// Used for setups where one manually rotates the monitor.
static const bool allow_rotate = true;
////////////////
// Audio
////////////////

View file

@ -421,6 +421,9 @@ static bool environment_cb(unsigned cmd, void *data)
{
unsigned rotation = *(const unsigned*)data;
SSNES_LOG("Environ SET_ROTATION: %u\n", rotation);
if (!g_settings.video.allow_rotate)
break;
if (driver.video && driver.video_data && driver.video->set_rotation)
video_set_rotation_func(rotation);
else

View file

@ -126,6 +126,7 @@ struct settings
bool h264_record;
bool post_filter_record;
bool allow_rotate;
char external_driver[PATH_MAX];
} video;

View file

@ -164,6 +164,7 @@ void config_set_defaults(void)
g_settings.video.crop_overscan = crop_overscan;
g_settings.video.aspect_ratio = -1.0f; // Automatic
g_settings.video.shader_type = SSNES_SHADER_AUTO;
g_settings.video.allow_rotate = allow_rotate;
#ifdef HAVE_FREETYPE
g_settings.video.font_enable = font_enable;
@ -371,6 +372,7 @@ bool config_load_file(const char *path)
CONFIG_GET_FLOAT(video.fbo_scale_x, "video_fbo_scale_x");
CONFIG_GET_FLOAT(video.fbo_scale_y, "video_fbo_scale_y");
CONFIG_GET_BOOL(video.second_pass_smooth, "video_second_pass_smooth");
CONFIG_GET_BOOL(video.allow_rotate, "video_allow_rotate");
#ifdef HAVE_FREETYPE
CONFIG_GET_STRING(video.font_path, "video_font_path");

View file

@ -117,6 +117,11 @@
# Used to calculate a suitable audio input rate.
# video_refresh_rate = 59.95
# Allows libsnes cores to set rotation modes.
# Setting this to false will honor, but ignore this request.
# This is useful for vertically oriented games where one manually rotates the monitor.
# video_allow_rotate = true
#### Audio
# Enable audio.