summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/MainAndroid.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2015-06-24 21:39:47 -0500
committerRyan Houdek <Sonicadvance1@gmail.com>2015-06-24 21:39:47 -0500
commit521f6e89c31811103a96da8e9c32820aa5b64ee9 (patch)
treef41760ec5c240bb5737ab1e8819a063b1f6abc75 /Source/Core/DolphinWX/MainAndroid.cpp
parent2a5dd69c72677154215564aa837bb6bdc0213dea (diff)
parent7935c1c57a264158bbc8e0bda97fedaa8cbba96a (diff)
Merge pull request #2624 from sigmabeta/android-save-screenshot
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);
}