From 4b1c4ae4463ab8e4ecc6b72085ccd0ce1a3be12b Mon Sep 17 00:00:00 2001 From: Ender's Games Date: Wed, 8 Aug 2018 09:52:55 -0400 Subject: [PATCH] Android: remove unused EGL14 config option This will require an entire proprietary view, as the packaged helper classes are strictly EGL10. --- .../com/reicast/emulator/config/Config.java | 1 - .../emulator/config/OptionsFragment.java | 29 ++----------------- .../com/reicast/emulator/emu/GL2JNIView.java | 7 ++--- 3 files changed, 5 insertions(+), 32 deletions(-) diff --git a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/config/Config.java b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/config/Config.java index d28dd35b2..831d92fc5 100644 --- a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/config/Config.java +++ b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/config/Config.java @@ -15,7 +15,6 @@ public class Config { public static final String pref_showfps = "show_fps"; public static final String pref_rendertype = "render_type"; public static final String pref_renderdepth = "depth_render"; - public static final String pref_egl14 = "use_egl14"; public static final String pref_touchvibe = "touch_vibration_enabled"; public static final String pref_vibrationDuration = "vibration_duration"; diff --git a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/config/OptionsFragment.java b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/config/OptionsFragment.java index a0167e02f..e958a3a8d 100644 --- a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/config/OptionsFragment.java +++ b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/config/OptionsFragment.java @@ -522,38 +522,13 @@ public class OptionsFragment extends Fragment { fps_opt.setChecked(counter); fps_opt.setOnCheckedChangeListener(fps_options); - final CompoundButton use_egl14_opt = (CompoundButton) getView().findViewById(R.id.force_gpu_option); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { - OnCheckedChangeListener force_gpu_options = new OnCheckedChangeListener() { - - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mPrefs.edit().putBoolean(Config.pref_egl14, isChecked).apply(); - } - }; - boolean enhanced = mPrefs.getBoolean(Config.pref_egl14, false); - use_egl14_opt.setChecked(enhanced); - use_egl14_opt.setOnCheckedChangeListener(force_gpu_options); - } else { - use_egl14_opt.setEnabled(false); - } - CompoundButton force_software_opt = (CompoundButton) getView().findViewById( R.id.software_option); OnCheckedChangeListener force_software = new OnCheckedChangeListener() { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mPrefs.edit() - .putInt(Config.pref_rendertype, isChecked - ? GL2JNIView.LAYER_TYPE_SOFTWARE : GL2JNIView.LAYER_TYPE_HARDWARE - ).apply(); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { - if (isChecked) { - use_egl14_opt.setEnabled(false); - mPrefs.edit().putBoolean(Config.pref_egl14, false).apply(); - } else { - use_egl14_opt.setEnabled(true); - } - } + mPrefs.edit().putInt(Config.pref_rendertype, isChecked ? + GL2JNIView.LAYER_TYPE_SOFTWARE : GL2JNIView.LAYER_TYPE_HARDWARE).apply(); } }; int software = mPrefs.getInt(Config.pref_rendertype, GL2JNIView.LAYER_TYPE_HARDWARE); diff --git a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/emu/GL2JNIView.java b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/emu/GL2JNIView.java index 7a12ae13a..181018d19 100644 --- a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/emu/GL2JNIView.java +++ b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/emu/GL2JNIView.java @@ -191,10 +191,9 @@ public class GL2JNIView extends GLSurfaceView // our surface exactly. This is going to be done in our // custom config chooser. See ConfigChooser class definition // below. - setEGLConfigChooser( - translucent? - new GLCFactory.ConfigChooser(8, 8, 8, 8, depth, stencil) - : new GLCFactory.ConfigChooser(5, 6, 5, 0, depth, stencil) + setEGLConfigChooser(translucent? + new GLCFactory.ConfigChooser(8, 8, 8, 8, depth, stencil) + : new GLCFactory.ConfigChooser(5, 6, 5, 0, depth, stencil) ); // Set the renderer responsible for frame rendering