diff --git a/src/Core.h b/src/Core.h index 00c1e61dd..08458c98d 100644 --- a/src/Core.h +++ b/src/Core.h @@ -21,7 +21,6 @@ typedef signed __int64 int64_t; #define CC_INLINE inline #define CC_NOINLINE __declspec(noinline) -#define CC_ALIGN_HINT(x) __declspec(align(x)) #ifndef CC_API #define CC_API __declspec(dllexport, noinline) #define CC_VAR __declspec(dllexport) @@ -30,7 +29,6 @@ typedef signed __int64 int64_t; #include #define CC_INLINE inline #define CC_NOINLINE __attribute__((noinline)) -#define CC_ALIGN_HINT(x) __attribute__((aligned(x))) #ifndef CC_API #ifdef _WIN32 #define CC_API __attribute__((dllexport, noinline)) @@ -45,7 +43,6 @@ typedef signed __int64 int64_t; #include #define CC_INLINE inline #define CC_NOINLINE -#define CC_ALIGN_HINT(x) #define CC_API #define CC_VAR #else diff --git a/src/Program.c b/src/Program.c index f5344227f..df0fa4580 100644 --- a/src/Program.c +++ b/src/Program.c @@ -186,9 +186,8 @@ static void android_main(void) { } static void JNICALL java_runGameAsync(JNIEnv* env, jobject instance) { - App_Instance = instance; - (*env)->NewGlobalRef(env, instance); - /* TODO: Do we actually need to remove that global ref? */ + App_Instance = (*env)->NewGlobalRef(env, instance); + /* TODO: Do we actually need to remove that global ref later? */ Platform_LogConst("Running game async!"); Thread_Start(android_main, true); } @@ -198,11 +197,13 @@ static const JNINativeMethod methods[1] = { }; CC_API jint JNI_OnLoad(JavaVM* vm, void* reserved) { + jclass klass; JNIEnv* env; VM_Ptr = vm; - JavaGetCurrentEnv(env); - App_Class = (*env)->FindClass(env, "com/classicube/MainActivity"); + + klass = (*env)->FindClass(env, "com/classicube/MainActivity"); + App_Class = (*env)->NewGlobalRef(env, klass); JavaRegisterNatives(env, methods); return JNI_VERSION_1_4; } diff --git a/src/Window.c b/src/Window.c index 69aa4e118..9a355aa01 100644 --- a/src/Window.c +++ b/src/Window.c @@ -2964,13 +2964,13 @@ static const JNINativeMethod methods[19] = { { "processKeyUp", "(I)V", java_processKeyUp }, { "processKeyChar", "(I)V", java_processKeyChar }, - { "processMouseDown", "(I)V", java_processMouseDown }, - { "processMouseUp", "(I)V", java_processMouseUp }, - { "processMouseMove", "(I)V", java_processMouseMove }, + { "processMouseDown", "(II)V", java_processMouseDown }, + { "processMouseUp", "(II)V", java_processMouseUp }, + { "processMouseMove", "(II)V", java_processMouseMove }, - { "processSurfaceCreated", "(JLandroid/view/Surface;)V", java_processSurfaceCreated }, + { "processSurfaceCreated", "(Landroid/view/Surface;)V", java_processSurfaceCreated }, { "processSurfaceDestroyed", "()V", java_processSurfaceDestroyed }, - { "processSurfaceResized", "(JLandroid/view/Surface;)V", java_processSurfaceResized }, + { "processSurfaceResized", "(Landroid/view/Surface;)V", java_processSurfaceResized }, { "processSurfaceRedrawNeeded", "()V", java_processSurfaceRedrawNeeded }, { "processOnStart", "()V", java_onStart },