Hook up XML shader and overlay prefs.

This commit is contained in:
Themaister 2013-01-04 16:45:28 +01:00
parent 100f5ac947
commit 2267c4d65b
5 changed files with 95 additions and 68 deletions

View File

@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.retroarch" package="org.retroarch"
android:versionCode="1" android:versionCode="1"
android:versionName="1.0" > android:versionName="0.9.8" >
<uses-sdk <uses-sdk
android:minSdkVersion="11" android:minSdkVersion="11"
@ -24,12 +24,8 @@
<activity android:name="org.retroarch.browser.DirectoryActivity"></activity> <activity android:name="org.retroarch.browser.DirectoryActivity"></activity>
<activity android:name="org.retroarch.browser.ROMActivity"></activity> <activity android:name="org.retroarch.browser.ROMActivity"></activity>
<activity android:name="org.retroarch.browser.ShaderActivity"> <activity android:name="org.retroarch.browser.ShaderActivity"></activity>
<intent-filter> <activity android:name="org.retroarch.browser.OverlayActivity"></activity>
<action android:name="org.retroarch.action.ShaderSelect" />
<category android:name="android.intent.category.PREFERENCE" />
</intent-filter>
</activity>
<activity android:name="android.app.NativeActivity" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale"> <activity android:name="android.app.NativeActivity" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
<meta-data android:name="android.app.lib_name" android:value="retroarch-activity" /> <meta-data android:name="android.app.lib_name" android:value="retroarch-activity" />

View File

@ -1,67 +1,83 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="RetroArch Config" > android:title="RetroArch Config" >
<PreferenceScreen android:title="System Config" > <PreferenceScreen android:title="System Config" >
<CheckBoxPreference <PreferenceCategory android:title="General" >
android:defaultValue="false" <CheckBoxPreference
android:key="savestate_auto_save" android:defaultValue="false"
android:summary="Automatically saves and restores game state" android:key="savestate_auto_save"
android:title="Auto save state" /> android:summary="Automatically saves and restores game state"
<CheckBoxPreference android:title="Auto save state" />
android:defaultValue="false" <CheckBoxPreference
android:key="rewind_enable" android:defaultValue="false"
android:summary="Rewind a game in real-time (WARNING - very CPU intensive)." android:key="rewind_enable"
android:title="Rewind" /> android:summary="Allow rewinding a game in real-time (WARNING - CPU intensive)."
android:title="Rewind" />
</PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>
<PreferenceScreen android:title="Video Config" > <PreferenceScreen android:title="Video Config" >
<CheckBoxPreference <PreferenceCategory android:title="General" >
android:defaultValue="true" <CheckBoxPreference
android:key="video_smooth" android:defaultValue="true"
android:summary="Applies bilinear filter, smooths out edges" android:key="video_smooth"
android:title="Bilinear filter" /> android:summary="Applies bilinear filter, smooths out edges"
android:title="Bilinear filter" />
<Preference <CheckBoxPreference
android:title="XML shader" android:defaultValue="true"
android:summary="Sets GLES2 style XML shader"> android:key="video_vsync"
<intent android:summary="When set to enabled, prevents screen tearing"
android:action="org.retroarch.action.ShaderSelect" android:title="VSync" />
android:targetPackage="org.retroarch" <CheckBoxPreference
android:targetClass="org.retroarch.ShaderActivity" /> android:defaultValue="true"
</Preference> android:key="video_allow_rotate"
android:summary="Will auto-rotate the screen for vertically oriented games."
<CheckBoxPreference android:title="Auto-rotate" />
android:defaultValue="true"
android:key="video_vsync"
android:summary="When set to enabled, prevents screen tearing"
android:title="VSync" />
<CheckBoxPreference
android:defaultValue="true"
android:key="video_allow_rotate"
android:summary="Will auto-rotate the screen for vertically oriented games."
android:title="Auto-rotate" />
<ListPreference <ListPreference
android:entryValues="@array/aspect_values" android:entries="@array/aspect_ratios"
android:entries="@array/aspect_ratios" android:entryValues="@array/aspect_values"
android:key="video_aspect_ratio" android:key="video_aspect_ratio"
android:title="Aspect ratio" android:summary="Aspect ratio to enforce"
android:summary="Aspect ratio to enforce" /> android:title="Aspect ratio" />
</PreferenceCategory>
<PreferenceCategory android:title="Overlay" >
<CheckBoxPreference android:title="Enable"
android:key="input_overlay_enable"
android:defaultValue="false" />
<Preference
android:summary="Sets touchscreen overlay config"
android:title="Input overlay" >
<intent
android:targetClass="org.retroarch.browser.OverlayActivity"
android:targetPackage="org.retroarch" />
</Preference>
</PreferenceCategory>
<PreferenceCategory android:title="Shaders" >
<CheckBoxPreference android:title="Enable"
android:key="video_shader_enable"
android:defaultValue="false" />
<Preference
android:summary="Sets GLES2 style XML shader"
android:title="XML shader" >
<intent
android:targetClass="org.retroarch.browser.ShaderActivity"
android:targetPackage="org.retroarch" />
</Preference>
</PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>
<PreferenceScreen android:title="Audio Config" > <PreferenceScreen android:title="Audio Config" >
<CheckBoxPreference <PreferenceCategory android:title="General" >
android:defaultValue="true" <CheckBoxPreference
android:key="audio_enable" android:defaultValue="true"
android:summary="Enable audio" android:key="audio_enable"
android:title="Audio enable" /> android:summary="Enable audio"
<CheckBoxPreference android:title="Audio enable" />
android:defaultValue="true" <CheckBoxPreference
android:key="audio_rate_control" android:defaultValue="true"
android:summary="Enable dynamic rate control" android:key="audio_rate_control"
android:title="Dynamic Rate Control" /> android:summary="Enable dynamic rate control"
android:title="Dynamic Rate Control" />
</PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>
</PreferenceScreen> </PreferenceScreen>

View File

@ -259,9 +259,8 @@ public class DirectoryActivity extends Activity implements
for (File file : files) { for (File file : files) {
String path = file.getName(); String path = file.getName();
boolean allowFile = filterPath(path); boolean allowFile = file.isDirectory() || filterPath(path);
// Don't list save files in ROM list.
if (allowFile) if (allowFile)
adapter.add(new FileWrapper(file, false, adapter.add(new FileWrapper(file, false,
file.isDirectory() || true)); file.isDirectory() || true));

View File

@ -0,0 +1,12 @@
package org.retroarch.browser;
import android.os.Bundle;
public class OverlayActivity extends DirectoryActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.addAllowedExt(".cfg");
super.setPathSettingKey("input_overlay");
super.onCreate(savedInstanceState);
}
}

View File

@ -159,13 +159,17 @@ public class RetroArch extends Activity implements
} }
String shaderPath = prefs.getString("video_bsnes_shader", ""); String shaderPath = prefs.getString("video_bsnes_shader", "");
if (new File(shaderPath).exists()) { if (prefs.getBoolean("video_shader_enable", false) && new File(shaderPath).exists()) {
config.setString("video_shader_type", "bsnes"); config.setString("video_shader_type", "bsnes");
config.setString("video_bsnes_shader", shaderPath); config.setString("video_bsnes_shader", shaderPath);
} else { } else {
config.setString("video_shader_type", "none"); config.setString("video_shader_type", "none");
config.setString("video_bsnes_shader", ""); config.setString("video_bsnes_shader", "");
} }
config.setString("input_overlay",
prefs.getBoolean("input_overlay_enable", false) ?
prefs.getString("input_overlay", "") : "");
String confPath = getDefaultConfigPath(); String confPath = getDefaultConfigPath();
try { try {