diff --git a/shell/android/res/layout/configure_fragment.xml b/shell/android/res/layout/configure_fragment.xml
index e86c1b3bd..605aa4c0c 100644
--- a/shell/android/res/layout/configure_fragment.xml
+++ b/shell/android/res/layout/configure_fragment.xml
@@ -238,6 +238,35 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/shell/android/res/values/strings.xml b/shell/android/res/values/strings.xml
index 13d476a95..62ea5b5fc 100644
--- a/shell/android/res/values/strings.xml
+++ b/shell/android/res/values/strings.xml
@@ -29,6 +29,7 @@
Show OnScreen FPS
Force Software Rendering
Enable Emulator Sound
+ Rendering Depth
Force v6 GPU Config
Set Default Disk
@@ -79,6 +80,12 @@
- Controller C
- Controller D
+
+
+ - 16
+ - 24
+ - 32
+
- cdi
diff --git a/shell/android/src/com/reicast/emulator/MainActivity.java b/shell/android/src/com/reicast/emulator/MainActivity.java
index 8e4a119a5..e090a5c58 100644
--- a/shell/android/src/com/reicast/emulator/MainActivity.java
+++ b/shell/android/src/com/reicast/emulator/MainActivity.java
@@ -81,7 +81,6 @@ public class MainActivity extends SlidingFragmentActivity implements
} else {
loadInterface(savedInstanceState);
}
-
}
private void loadInterface(Bundle savedInstanceState) {
diff --git a/shell/android/src/com/reicast/emulator/config/ConfigureFragment.java b/shell/android/src/com/reicast/emulator/config/ConfigureFragment.java
index b1cd5d312..6b79f9c32 100644
--- a/shell/android/src/com/reicast/emulator/config/ConfigureFragment.java
+++ b/shell/android/src/com/reicast/emulator/config/ConfigureFragment.java
@@ -318,6 +318,36 @@ public class ConfigureFragment extends Fragment {
int count) {
}
});
+
+ String[] depths = parentActivity.getResources().getStringArray(
+ R.array.depth);
+
+ Spinner depth_spnr = (Spinner) getView().findViewById(
+ R.id.depth_spinner);
+ ArrayAdapter depthAdapter = new ArrayAdapter(
+ parentActivity, android.R.layout.simple_spinner_item, depths);
+ depthAdapter
+ .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ depth_spnr.setAdapter(depthAdapter);
+
+ String depth = String.valueOf(mPrefs.getInt("depth_render", 24));
+ depth_spnr.setSelection(depthAdapter.getPosition(depth), true);
+
+ depth_spnr.setOnItemSelectedListener(new OnItemSelectedListener() {
+
+ public void onItemSelected(AdapterView> parent, View view,
+ int pos, long id) {
+ int render = Integer.valueOf(parent.getItemAtPosition(pos)
+ .toString());
+ mPrefs.edit().putInt("depth_render", render).commit();
+
+ }
+
+ public void onNothingSelected(AdapterView> arg0) {
+
+ }
+
+ });
}
public void generateErrorLog() {
diff --git a/shell/android/src/com/reicast/emulator/emu/GL2JNIActivity.java b/shell/android/src/com/reicast/emulator/emu/GL2JNIActivity.java
index 59deff35f..02608a657 100644
--- a/shell/android/src/com/reicast/emulator/emu/GL2JNIActivity.java
+++ b/shell/android/src/com/reicast/emulator/emu/GL2JNIActivity.java
@@ -272,7 +272,7 @@ public class GL2JNIActivity extends Activity {
fileName = Uri.decode(intent.getData().toString());
// Create the actual GLES view
- mView = new GL2JNIView(getApplication(), fileName, false, 24, 0, false);
+ mView = new GL2JNIView(getApplication(), fileName, false, prefs.getInt("depth_render", 24), 0, false);
setContentView(mView);
String menu_spec;
diff --git a/shell/android/src/com/reicast/emulator/emu/GL2JNIView.java b/shell/android/src/com/reicast/emulator/emu/GL2JNIView.java
index 86e66398e..c507a5f85 100644
--- a/shell/android/src/com/reicast/emulator/emu/GL2JNIView.java
+++ b/shell/android/src/com/reicast/emulator/emu/GL2JNIView.java
@@ -606,7 +606,7 @@ private static class ContextFactory implements GLSurfaceView.EGLContextFactory
EGL10.EGL_GREEN_SIZE, 4,
EGL10.EGL_BLUE_SIZE, 4,
EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL10.EGL_DEPTH_SIZE, 24,
+ EGL10.EGL_DEPTH_SIZE, 16,
EGL10.EGL_NONE
};
@@ -660,30 +660,6 @@ private static class ContextFactory implements GLSurfaceView.EGLContextFactory
return(null);
}
-
- private boolean checkGLSupport(int renderableType)
- {
- EGL10 egl = (EGL10) EGLContext.getEGL();
- EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
-
- int[] version = new int[2];
- egl.eglInitialize(display, version);
-
- int[] configAttribs =
- {
- EGL10.EGL_RED_SIZE, 4,
- EGL10.EGL_GREEN_SIZE, 4,
- EGL10.EGL_BLUE_SIZE, 4,
- EGL10.EGL_RENDERABLE_TYPE, renderableType,
- EGL10.EGL_NONE
- };
-
- EGLConfig[] configs = new EGLConfig[10];
- int[] num_config = new int[1];
- egl.eglChooseConfig(display, configAttribs, configs, 10, num_config);
- egl.eglTerminate(display);
- return num_config[0] > 0;
- }
private int findConfigAttrib(EGL10 egl,EGLDisplay display,EGLConfig config,int attribute,int defaultValue)
{
diff --git a/shell/android/src/com/reicast/emulator/emu/GLCFactory6.java b/shell/android/src/com/reicast/emulator/emu/GLCFactory6.java
index e1fdc9aff..cbb553e4b 100644
--- a/shell/android/src/com/reicast/emulator/emu/GLCFactory6.java
+++ b/shell/android/src/com/reicast/emulator/emu/GLCFactory6.java
@@ -93,7 +93,7 @@ public class GLCFactory6 {
EGL14.EGL_GREEN_SIZE, 4,
EGL14.EGL_BLUE_SIZE, 4,
EGL14.EGL_RENDERABLE_TYPE, renderableType,
- EGL14.EGL_DEPTH_SIZE, 24,
+ EGL14.EGL_DEPTH_SIZE, 16,
EGL14.EGL_NONE
};