summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/MainAndroid.cpp
diff options
context:
space:
mode:
authorsigmabeta <sigmabeta@users.noreply.github.com>2015-06-18 21:28:40 -0400
committerEder Bastos <bastos.eder@gmail.com>2015-06-23 22:22:01 -0400
commita028805626e26b8e4041d9a3010a241aa95e310e (patch)
treeb88485d390db1422ed0c2dc4deb760cabf686db9 /Source/Core/DolphinWX/MainAndroid.cpp
parent2cea9104316d70df23192b2052a76db5dc3305ef (diff)
Android: Save screenshot at end of an emulation session.
Diffstat (limited to 'Source/Core/DolphinWX/MainAndroid.cpp')
-rw-r--r--Source/Core/DolphinWX/MainAndroid.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/MainAndroid.cpp b/Source/Core/DolphinWX/MainAndroid.cpp
index cca694c251..3788f42928 100644
--- a/Source/Core/DolphinWX/MainAndroid.cpp
+++ b/Source/Core/DolphinWX/MainAndroid.cpp
@@ -31,6 +31,7 @@
#include "UICommon/UICommon.h"
#include "VideoCommon/OnScreenDisplay.h"
+#include "VideoCommon/RenderBase.h"
#include "VideoCommon/VideoBackendBase.h"
ANativeWindow* surf;
@@ -40,6 +41,7 @@ std::string g_set_userpath = "";
JavaVM* g_java_vm;
jclass g_jni_class;
jmethodID g_jni_method_alert;
+jmethodID g_jni_method_end;
#define DOLPHIN_TAG "DolphinEmuNative"
@@ -394,6 +396,8 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_PauseEmulati
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_StopEmulation(JNIEnv *env, jobject obj)
{
+ Core::SaveScreenShot("thumb");
+ Renderer::s_screenshotCompleted.Wait();
Core::Stop();
updateMainFrameEvent.Set(); // Kick the waiting event
}
@@ -591,6 +595,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_CacheClasses
// Method signature taken from javap -s Source/Android/app/build/intermediates/classes/arm/debug/org/dolphinemu/dolphinemu/NativeLibrary.class
g_jni_method_alert = env->GetStaticMethodID(g_jni_class, "displayAlertMsg", "(Ljava/lang/String;)V");
+ g_jni_method_end = env->GetStaticMethodID(g_jni_class, "endEmulationActivity", "()V");
}
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *env, jobject obj, jobject _surf)
@@ -624,6 +629,9 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *
UICommon::Shutdown();
ANativeWindow_release(surf);
+
+ // Execute the Java method.
+ env->CallStaticVoidMethod(g_jni_class, g_jni_method_end);
}