More flexible aspect ratio options.

This commit is contained in:
Themaister 2012-12-31 21:24:39 +01:00
parent be5c271b0e
commit be602e417a
3 changed files with 40 additions and 6 deletions

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="aspect_ratios">
<item>Full screen</item>
<item>Auto</item>
<item>4:3</item>
<item>16:9</item>
<item>16:10</item>
<item>8:7</item>
</string-array>
<string-array name="aspect_values">
<item>full</item>
<item>auto</item>
<item>1.33333</item>
<item>1.77777</item>
<item>1.60000</item>
<item>1.14286</item>
</string-array>
</resources>

View File

@ -16,11 +16,13 @@
android:key="video_smooth"
android:summary="Applies bilinear filter, smooths out edges"
android:title="Bilinear filter" />
<CheckBoxPreference
android:defaultValue="true"
android:key="video_force_aspect"
android:summary="Let game decide aspect ratio"
android:title="Force aspect correction" />
<ListPreference
android:entryValues="@array/aspect_values"
android:entries="@array/aspect_ratios"
android:key="video_aspect_ratio"
android:title="Aspect ratio"
android:summary="Aspect ratio to enforce" />
</PreferenceScreen>

View File

@ -133,11 +133,23 @@ public class ModuleActivity extends Activity implements
private void updateConfigFile() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
config.setBoolean("video_force_aspect", prefs.getBoolean("video_force_aspect", true));
config.setBoolean("audio_rate_control", prefs.getBoolean("audio_rate_control", true));
config.setBoolean("audio_enable", prefs.getBoolean("audio_enable", true));
config.setBoolean("video_smooth", prefs.getBoolean("video_smooth", true));
config.setBoolean("savestate_auto_save", prefs.getBoolean("savestate_auto_save", false));
String aspect = prefs.getString("video_aspect_ratio", "auto");
if (aspect.equals("full")) {
config.setBoolean("video_force_aspect", false);
} else if (aspect.equals("auto")) {
config.setBoolean("video_force_aspect", true);
config.setBoolean("video_force_aspect_auto", true);
config.setDouble("video_aspect_ratio", -1.0);
} else {
double aspect_ratio = Double.parseDouble(aspect);
config.setBoolean("video_force_aspect", true);
config.setDouble("video_aspect_ratio", aspect_ratio);
}
String confPath = getDefaultConfigPath();
try {