summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Src/MainAndroid.cpp
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2013-08-23 00:51:12 +1200
committerMatthew Parlane <parlane@gmail.com>2013-08-23 00:51:12 +1200
commitb6e054a2beef3236822e27d95dfe38a4ccee2eb1 (patch)
tree6f744593b14def9c2fbc7be9e509df5507835cc4 /Source/Core/DolphinWX/Src/MainAndroid.cpp
parentf274b3b074fb8bb0477b0e9f4e88db0e08bf4f2c (diff)
parent41c25d0c90a2461c3e34bf9659dcf1da5e1e8580 (diff)
Merge branch 'master' into wii-network
Conflicts: Source/Core/Core/Core.vcxproj Source/Core/Core/Core.vcxproj.filters Source/Core/Core/Src/CoreParameter.cpp Source/Core/DolphinWX/Dolphin.vcxproj Source/Core/DolphinWX/Dolphin.vcxproj.filters
Diffstat (limited to 'Source/Core/DolphinWX/Src/MainAndroid.cpp')
-rw-r--r--Source/Core/DolphinWX/Src/MainAndroid.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/Source/Core/DolphinWX/Src/MainAndroid.cpp b/Source/Core/DolphinWX/Src/MainAndroid.cpp
index 295d13ccef..5fc616d5ac 100644
--- a/Source/Core/DolphinWX/Src/MainAndroid.cpp
+++ b/Source/Core/DolphinWX/Src/MainAndroid.cpp
@@ -47,6 +47,9 @@
#include <android/native_window_jni.h>
ANativeWindow* surf;
int g_width, g_height;
+std::string g_filename;
+static std::thread g_run_thread;
+
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "Dolphinemu", __VA_ARGS__))
void Host_NotifyMapLoaded() {}
@@ -66,7 +69,10 @@ void* Host_GetRenderHandle()
void* Host_GetInstance() { return NULL; }
-void Host_UpdateTitle(const char* title){};
+void Host_UpdateTitle(const char* title)
+{
+ LOGI(title);
+};
void Host_UpdateLogDisplay(){}
@@ -297,12 +303,23 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetConfig(JN
env->ReleaseStringUTFChars(jDefault, Default);
}
-JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *env, jobject obj, jstring jFile, jobject _surf, jint _width, jint _height)
+JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetFilename(JNIEnv *env, jobject obj, jstring jFile)
+{
+ const char *File = env->GetStringUTFChars(jFile, NULL);
+
+ g_filename = std::string(File);
+
+ env->ReleaseStringUTFChars(jFile, File);
+}
+JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetDimensions(JNIEnv *env, jobject obj, jint _width, jint _height)
{
- surf = ANativeWindow_fromSurface(env, _surf);
g_width = (int)_width;
g_height = (int)_height;
+}
+JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *env, jobject obj, jobject _surf)
+{
+ surf = ANativeWindow_fromSurface(env, _surf);
// Install our callbacks
OSD::AddCallback(OSD::OSD_INIT, OSDCallbacks, 0);
OSD::AddCallback(OSD::OSD_SHUTDOWN, OSDCallbacks, 2);
@@ -322,9 +339,8 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *
if (onscreencontrols)
OSD::AddCallback(OSD::OSD_ONFRAME, OSDCallbacks, 1);
- const char *File = env->GetStringUTFChars(jFile, NULL);
// No use running the loop when booting fails
- if ( BootManager::BootCore( File ) )
+ if ( BootManager::BootCore( g_filename.c_str() ) )
while (PowerPC::GetState() != PowerPC::CPU_POWERDOWN)
updateMainFrameEvent.Wait();
@@ -333,7 +349,8 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *
SConfig::Shutdown();
LogManager::Shutdown();
}
-
+
+
#ifdef __cplusplus
}
#endif