xXJSONDeruloXx
1 week ago
No known key found for this signature in database
GPG Key ID: 629F3E618E280D7F
3 changed files with
16 additions and
5 deletions
-
src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt
-
src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt
-
src/android/app/src/main/jni/emu_window/emu_window.cpp
|
|
|
@ -204,9 +204,9 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener, InputManager |
|
|
|
} |
|
|
|
|
|
|
|
override fun onPause() { |
|
|
|
super.onPause() |
|
|
|
nfcReader.stopScanning() |
|
|
|
stopMotionSensorListener() |
|
|
|
super.onPause() |
|
|
|
} |
|
|
|
|
|
|
|
override fun onDestroy() { |
|
|
|
@ -339,6 +339,10 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener, InputManager |
|
|
|
} |
|
|
|
|
|
|
|
override fun onSensorChanged(event: SensorEvent) { |
|
|
|
if (!NativeLibrary.isRunning() || NativeLibrary.isPaused()) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
val rotation = this.display?.rotation |
|
|
|
if (rotation == Surface.ROTATION_90) { |
|
|
|
flipMotionOrientation = true |
|
|
|
|
|
|
|
@ -2217,14 +2217,13 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { |
|
|
|
if (surface == null) { |
|
|
|
Log.debug("[EmulationFragment] clearSurface called, but surface already null.") |
|
|
|
} else { |
|
|
|
if (state == State.RUNNING) { |
|
|
|
pause() |
|
|
|
} |
|
|
|
NativeLibrary.surfaceDestroyed() |
|
|
|
surface = null |
|
|
|
Log.debug("[EmulationFragment] Surface destroyed.") |
|
|
|
when (state) { |
|
|
|
State.RUNNING -> { |
|
|
|
state = State.PAUSED |
|
|
|
} |
|
|
|
|
|
|
|
State.PAUSED -> Log.debug( |
|
|
|
"[EmulationFragment] Surface cleared while emulation paused." |
|
|
|
) |
|
|
|
|
|
|
|
@ -14,6 +14,14 @@ |
|
|
|
#include "jni/native.h"
|
|
|
|
|
|
|
|
void EmuWindow_Android::OnSurfaceChanged(ANativeWindow* surface) { |
|
|
|
if (!surface) { |
|
|
|
LOG_INFO(Frontend, "EmuWindow_Android::OnSurfaceChanged received null surface"); |
|
|
|
m_window_width = 0; |
|
|
|
m_window_height = 0; |
|
|
|
window_info.render_surface = nullptr; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
m_window_width = ANativeWindow_getWidth(surface); |
|
|
|
m_window_height = ANativeWindow_getHeight(surface); |
|
|
|
|
|
|
|
|