mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 00:59:44 -06:00
Big commit. Fix running the APK, I had missed a view in the manifest. Clean up the Android EGL context creation to fit more in line with how Dolphin works. This breaks input at the moment as well. Change the memarena from 768MB to 64MB to allow 1GB phones to potentially run it. Rename EGL_X11 back to EGL since this merge brings in some of soreau's changes to more easily allow different platforms like Wayland and Android. Not quite all of the code because some needs to be cleaned up still.
This commit is contained in:
@ -39,6 +39,7 @@
|
||||
#include <android/native_window_jni.h>
|
||||
JNIEnv *g_env = NULL;
|
||||
ANativeWindow* surf;
|
||||
int g_width, g_height;
|
||||
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "Dolphinemu", __VA_ARGS__))
|
||||
|
||||
bool rendererHasFocus = true;
|
||||
@ -83,8 +84,8 @@ void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height)
|
||||
{
|
||||
x = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowXPos;
|
||||
y = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowYPos;
|
||||
width = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowWidth;
|
||||
height = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight;
|
||||
width = g_width;
|
||||
height = g_height;
|
||||
}
|
||||
|
||||
void Host_RequestRenderWindowSize(int width, int height) {}
|
||||
@ -122,18 +123,12 @@ void Host_SysMessage(const char *fmt, ...)
|
||||
|
||||
void Host_SetWiiMoteConnectionState(int _State) {}
|
||||
|
||||
extern void DrawReal();
|
||||
extern void PrepareShit();
|
||||
extern void DrawButton(int tex, int ID);
|
||||
extern void SetButtonCoords(float *Coords);
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeRenderer_PrepareME(JNIEnv *env, jobject obj)
|
||||
{
|
||||
PrepareShit();
|
||||
}
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeRenderer_SetButtonCoords(JNIEnv *env, jobject obj, jfloatArray Coords)
|
||||
{
|
||||
jfloat* flt1 = env->GetFloatArrayElements(Coords, 0);
|
||||
@ -148,33 +143,30 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeRenderer_DrawButton(
|
||||
DrawButton((int)GLTex, (int)ID);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeRenderer_UnPauseEmulation(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeGLSurfaceView_UnPauseEmulation(JNIEnv *env, jobject obj)
|
||||
{
|
||||
PowerPC::Start();
|
||||
}
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeRenderer_PauseEmulation(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeGLSurfaceView_PauseEmulation(JNIEnv *env, jobject obj)
|
||||
{
|
||||
PowerPC::Pause();
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeRenderer_StopEmulation(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeGLSurfaceView_StopEmulation(JNIEnv *env, jobject obj)
|
||||
{
|
||||
PowerPC::Stop();
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeRenderer_DrawME(JNIEnv *env, jobject obj)
|
||||
{
|
||||
DrawReal();
|
||||
}
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_DolphinEmulator_SetKey(JNIEnv *env, jobject obj, jint Value, jint Key)
|
||||
{
|
||||
WARN_LOG(COMMON, "Key %d with action %d\n", (int)Key, (int)Value);
|
||||
KeyStates[(int)Key] = (int)Value == 0 ? true : false;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeGLSurfaceView_main(JNIEnv *env, jobject obj, jstring jFile, jobject _surf)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeGLSurfaceView_main(JNIEnv *env, jobject obj, jstring jFile, jobject _surf, jint _width, jint _height)
|
||||
{
|
||||
surf = ANativeWindow_fromSurface(env, _surf);
|
||||
g_width = (int)_width;
|
||||
g_height = (int)_height;
|
||||
g_env = env;
|
||||
|
||||
LogManager::Init();
|
||||
|
Reference in New Issue
Block a user