From 446e2d9119a3c4281e72feefca9bbcd2b1eb21e3 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 8 Aug 2021 14:33:06 +0200 Subject: Android: Remove state from EmulationState --- Source/Android/jni/MainAndroid.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'Source/Android/jni/MainAndroid.cpp') diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index eedc728ad9..1b54cd592c 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -23,6 +23,7 @@ #include "Common/CommonTypes.h" #include "Common/Event.h" #include "Common/FileUtil.h" +#include "Common/Flag.h" #include "Common/IniFile.h" #include "Common/Logging/LogManager.h" #include "Common/MsgHandler.h" @@ -81,6 +82,7 @@ Common::Event s_update_main_frame_event; std::mutex s_surface_lock; bool s_need_nonblocking_alert_msg; +Common::Flag s_is_booting; bool s_have_wm_user_stop = false; bool s_game_metadata_is_valid = false; } // Anonymous namespace @@ -247,9 +249,14 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_StopEmulatio s_update_main_frame_event.Set(); } +JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetIsBooting(JNIEnv*, jclass) +{ + s_is_booting.Set(); +} + JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_IsRunning(JNIEnv*, jclass) { - return static_cast(Core::IsRunning()); + return s_is_booting.IsSet() || static_cast(Core::IsRunning()); } JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_IsRunningAndStarted(JNIEnv*, @@ -258,6 +265,12 @@ JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_IsRunnin return static_cast(Core::IsRunningAndStarted()); } +JNIEXPORT jboolean JNICALL +Java_org_dolphinemu_dolphinemu_NativeLibrary_IsRunningAndUnpaused(JNIEnv*, jclass) +{ + return static_cast(Core::GetState() == Core::State::Running); +} + JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadEvent( JNIEnv* env, jclass, jstring jDevice, jint Button, jint Action) { @@ -561,6 +574,7 @@ static void Run(JNIEnv* env, const std::vector& paths, } } + s_is_booting.Clear(); s_need_nonblocking_alert_msg = false; surface_guard.unlock(); -- cgit v1.2.3