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"
package="org.retroarch"
android:versionCode="1"
android:versionName="1.0" >
android:versionName="0.9.8" >
<uses-sdk
android:minSdkVersion="11"
@ -24,12 +24,8 @@
<activity android:name="org.retroarch.browser.DirectoryActivity"></activity>
<activity android:name="org.retroarch.browser.ROMActivity"></activity>
<activity android:name="org.retroarch.browser.ShaderActivity">
<intent-filter>
<action android:name="org.retroarch.action.ShaderSelect" />
<category android:name="android.intent.category.PREFERENCE" />
</intent-filter>
</activity>
<activity android:name="org.retroarch.browser.ShaderActivity"></activity>
<activity android:name="org.retroarch.browser.OverlayActivity"></activity>
<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" />

View File

@ -1,67 +1,83 @@
<?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" >
<PreferenceScreen android:title="System Config" >
<CheckBoxPreference
android:defaultValue="false"
android:key="savestate_auto_save"
android:summary="Automatically saves and restores game state"
android:title="Auto save state" />
<CheckBoxPreference
android:defaultValue="false"
android:key="rewind_enable"
android:summary="Rewind a game in real-time (WARNING - very CPU intensive)."
android:title="Rewind" />
<PreferenceCategory android:title="General" >
<CheckBoxPreference
android:defaultValue="false"
android:key="savestate_auto_save"
android:summary="Automatically saves and restores game state"
android:title="Auto save state" />
<CheckBoxPreference
android:defaultValue="false"
android:key="rewind_enable"
android:summary="Allow rewinding a game in real-time (WARNING - CPU intensive)."
android:title="Rewind" />
</PreferenceCategory>
</PreferenceScreen>
<PreferenceScreen android:title="Video Config" >
<CheckBoxPreference
android:defaultValue="true"
android:key="video_smooth"
android:summary="Applies bilinear filter, smooths out edges"
android:title="Bilinear filter" />
<Preference
android:title="XML shader"
android:summary="Sets GLES2 style XML shader">
<intent
android:action="org.retroarch.action.ShaderSelect"
android:targetPackage="org.retroarch"
android:targetClass="org.retroarch.ShaderActivity" />
</Preference>
<CheckBoxPreference
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" />
<PreferenceCategory android:title="General" >
<CheckBoxPreference
android:defaultValue="true"
android:key="video_smooth"
android:summary="Applies bilinear filter, smooths out edges"
android:title="Bilinear filter" />
<CheckBoxPreference
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
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" />
<ListPreference
android:entries="@array/aspect_ratios"
android:entryValues="@array/aspect_values"
android:key="video_aspect_ratio"
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 android:title="Audio Config" >
<CheckBoxPreference
android:defaultValue="true"
android:key="audio_enable"
android:summary="Enable audio"
android:title="Audio enable" />
<CheckBoxPreference
android:defaultValue="true"
android:key="audio_rate_control"
android:summary="Enable dynamic rate control"
android:title="Dynamic Rate Control" />
<PreferenceCategory android:title="General" >
<CheckBoxPreference
android:defaultValue="true"
android:key="audio_enable"
android:summary="Enable audio"
android:title="Audio enable" />
<CheckBoxPreference
android:defaultValue="true"
android:key="audio_rate_control"
android:summary="Enable dynamic rate control"
android:title="Dynamic Rate Control" />
</PreferenceCategory>
</PreferenceScreen>
</PreferenceScreen>
</PreferenceScreen>

View File

@ -259,9 +259,8 @@ public class DirectoryActivity extends Activity implements
for (File file : files) {
String path = file.getName();
boolean allowFile = filterPath(path);
boolean allowFile = file.isDirectory() || filterPath(path);
// Don't list save files in ROM list.
if (allowFile)
adapter.add(new FileWrapper(file, false,
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", "");
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_bsnes_shader", shaderPath);
} else {
config.setString("video_shader_type", "none");
config.setString("video_bsnes_shader", "");
}
config.setString("input_overlay",
prefs.getBoolean("input_overlay_enable", false) ?
prefs.getString("input_overlay", "") : "");
String confPath = getDefaultConfigPath();
try {