diff options
author | bunnei <bunneidev@gmail.com> | 2023-06-11 00:13:06 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2023-06-11 00:13:06 +0200 |
commit | ea716eb5cc7fd568897da586c1b3aa5c3a5052ba (patch) | |
tree | cfce03591f4582891110bd1148b92ccbbbc8cc28 /src/android | |
parent | Merge pull request #10670 from liamwhite/fxaa2 (diff) | |
download | yuzu-ea716eb5cc7fd568897da586c1b3aa5c3a5052ba.tar yuzu-ea716eb5cc7fd568897da586c1b3aa5c3a5052ba.tar.gz yuzu-ea716eb5cc7fd568897da586c1b3aa5c3a5052ba.tar.bz2 yuzu-ea716eb5cc7fd568897da586c1b3aa5c3a5052ba.tar.lz yuzu-ea716eb5cc7fd568897da586c1b3aa5c3a5052ba.tar.xz yuzu-ea716eb5cc7fd568897da586c1b3aa5c3a5052ba.tar.zst yuzu-ea716eb5cc7fd568897da586c1b3aa5c3a5052ba.zip |
Diffstat (limited to 'src/android')
-rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt | 28 | ||||
-rw-r--r-- | src/android/app/src/main/jni/native.cpp | 20 |
2 files changed, 0 insertions, 48 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt index f4db61cb3..20a0394f5 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt @@ -6,15 +6,12 @@ package org.yuzu.yuzu_emu.activities import android.app.Activity import android.content.Context import android.content.Intent -import android.content.res.Configuration import android.graphics.Rect import android.hardware.Sensor import android.hardware.SensorEvent import android.hardware.SensorEventListener import android.hardware.SensorManager -import android.hardware.display.DisplayManager import android.os.Bundle -import android.view.Display import android.view.InputDevice import android.view.KeyEvent import android.view.MotionEvent @@ -23,7 +20,6 @@ import android.view.View import android.view.inputmethod.InputMethodManager import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity -import androidx.core.content.getSystemService import androidx.core.view.WindowCompat import androidx.core.view.WindowInsetsCompat import androidx.core.view.WindowInsetsControllerCompat @@ -39,7 +35,6 @@ import org.yuzu.yuzu_emu.features.settings.model.SettingsViewModel import org.yuzu.yuzu_emu.fragments.EmulationFragment import org.yuzu.yuzu_emu.model.Game import org.yuzu.yuzu_emu.utils.ControllerMappingHelper -import org.yuzu.yuzu_emu.utils.EmulationMenuSettings import org.yuzu.yuzu_emu.utils.ForegroundService import org.yuzu.yuzu_emu.utils.InputHandler import org.yuzu.yuzu_emu.utils.NfcReader @@ -148,11 +143,6 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { super.onResume() nfcReader.startScanning() startMotionSensorListener() - - NativeLibrary.notifyOrientationChange( - EmulationMenuSettings.landscapeScreenLayout, - getAdjustedRotation() - ) } override fun onPause() { @@ -258,24 +248,6 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { override fun onAccuracyChanged(sensor: Sensor, i: Int) {} - private fun getAdjustedRotation():Int { - val rotation = getSystemService<DisplayManager>()!!.getDisplay(Display.DEFAULT_DISPLAY).rotation - val config: Configuration = resources.configuration - - if ((config.screenLayout and Configuration.SCREENLAYOUT_LONG_YES) != 0 || - (config.screenLayout and Configuration.SCREENLAYOUT_LONG_NO) == 0 || - (config.screenLayout and Configuration.SCREENLAYOUT_SIZE_SMALL) != 0) { - return rotation - } - when (rotation) { - Surface.ROTATION_0 -> return Surface.ROTATION_90 - Surface.ROTATION_90 -> return Surface.ROTATION_0 - Surface.ROTATION_180 -> return Surface.ROTATION_270 - Surface.ROTATION_270 -> return Surface.ROTATION_180 - } - return rotation - } - private fun restoreState(savedInstanceState: Bundle) { game = savedInstanceState.parcelable(EXTRA_SELECTED_GAME)!! } diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 03cb0b74b..7ebed5e6a 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp @@ -94,14 +94,6 @@ public: m_native_window = native_window; } - u32 ScreenRotation() const { - return m_screen_rotation; - } - - void SetScreenRotation(u32 screen_rotation) { - m_screen_rotation = screen_rotation; - } - void InitializeGpuDriver(const std::string& hook_lib_dir, const std::string& custom_driver_dir, const std::string& custom_driver_name, const std::string& file_redirect_dir) { @@ -400,7 +392,6 @@ private: // Window management std::unique_ptr<EmuWindow_Android> m_window; ANativeWindow* m_native_window{}; - u32 m_screen_rotation{}; // Core emulation Core::System m_system; @@ -426,10 +417,6 @@ private: } // Anonymous namespace -u32 GetAndroidScreenRotation() { - return EmulationSession::GetInstance().ScreenRotation(); -} - static Core::SystemResultStatus RunEmulation(const std::string& filepath) { Common::Log::Initialize(); Common::Log::SetColorConsoleBackendEnabled(true); @@ -473,13 +460,6 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_surfaceDestroyed(JNIEnv* env, EmulationSession::GetInstance().SurfaceChanged(); } -void Java_org_yuzu_yuzu_1emu_NativeLibrary_notifyOrientationChange(JNIEnv* env, - [[maybe_unused]] jclass clazz, - jint layout_option, - jint rotation) { - return EmulationSession::GetInstance().SetScreenRotation(static_cast<u32>(rotation)); -} - void Java_org_yuzu_yuzu_1emu_NativeLibrary_setAppDirectory(JNIEnv* env, [[maybe_unused]] jclass clazz, jstring j_directory) { |