mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-13 00:58:29 +02:00
WiiUpdateCallback: Add interface for update callback
This commit is contained in:
@ -73,6 +73,9 @@ static jmethodID s_patch_cheat_constructor;
|
||||
static jclass s_riivolution_patches_class;
|
||||
static jfieldID s_riivolution_patches_pointer;
|
||||
|
||||
static jclass s_wii_update_cb_class;
|
||||
static jmethodID s_wii_update_cb_run;
|
||||
|
||||
namespace IDCache
|
||||
{
|
||||
JNIEnv* GetEnvForThread()
|
||||
@ -338,6 +341,16 @@ jfieldID GetRiivolutionPatchesPointer()
|
||||
return s_riivolution_patches_pointer;
|
||||
}
|
||||
|
||||
jclass GetWiiUpdateCallbackClass()
|
||||
{
|
||||
return s_wii_update_cb_class;
|
||||
}
|
||||
|
||||
jmethodID GetWiiUpdateCallbackFunction()
|
||||
{
|
||||
return s_wii_update_cb_run;
|
||||
}
|
||||
|
||||
} // namespace IDCache
|
||||
|
||||
extern "C" {
|
||||
@ -474,6 +487,12 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved)
|
||||
s_riivolution_patches_pointer = env->GetFieldID(riivolution_patches_class, "mPointer", "J");
|
||||
env->DeleteLocalRef(riivolution_patches_class);
|
||||
|
||||
const jclass wii_update_cb_class =
|
||||
env->FindClass("org/dolphinemu/dolphinemu/utils/WiiUpdateCallback");
|
||||
s_wii_update_cb_class = reinterpret_cast<jclass>(env->NewGlobalRef(wii_update_cb_class));
|
||||
s_wii_update_cb_run = env->GetMethodID(s_wii_update_cb_class, "run", "(IIJ)Z");
|
||||
env->DeleteLocalRef(wii_update_cb_class);
|
||||
|
||||
return JNI_VERSION;
|
||||
}
|
||||
|
||||
@ -498,5 +517,6 @@ JNIEXPORT void JNI_OnUnload(JavaVM* vm, void* reserved)
|
||||
env->DeleteGlobalRef(s_gecko_cheat_class);
|
||||
env->DeleteGlobalRef(s_patch_cheat_class);
|
||||
env->DeleteGlobalRef(s_riivolution_patches_class);
|
||||
env->DeleteGlobalRef(s_wii_update_cb_class);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user