summaryrefslogtreecommitdiff
path: root/Source/Android/jni/AndroidCommon/IDCache.cpp
diff options
context:
space:
mode:
authorzackhow <zackhow@gmail.com>2019-01-21 19:11:11 -0500
committerzackhow <zackhow@gmail.com>2019-01-26 09:38:35 -0500
commit4979220cf0103d81023c32498870ecfd35ef473b (patch)
treed8359d9d4c542f9a479dc20e699491917b86175a /Source/Android/jni/AndroidCommon/IDCache.cpp
parentff5e29657655b0a423b94575f5766e6a56fc3407 (diff)
Android: Optimize rumble call
Moved rumble call to IDCache since GetMethodID is expensive
Diffstat (limited to 'Source/Android/jni/AndroidCommon/IDCache.cpp')
-rw-r--r--Source/Android/jni/AndroidCommon/IDCache.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/Android/jni/AndroidCommon/IDCache.cpp b/Source/Android/jni/AndroidCommon/IDCache.cpp
index 9841506fab..71e2ae9d59 100644
--- a/Source/Android/jni/AndroidCommon/IDCache.cpp
+++ b/Source/Android/jni/AndroidCommon/IDCache.cpp
@@ -25,6 +25,8 @@ static jclass s_analytics_class;
static jmethodID s_send_analytics_report;
static jmethodID s_get_analytics_value;
+static jmethodID s_do_rumble;
+
namespace IDCache
{
JavaVM* GetJavaVM()
@@ -86,6 +88,11 @@ jfieldID GetGameFileCachePointer()
return s_game_file_cache_pointer;
}
+jmethodID GetDoRumble()
+{
+ return s_do_rumble;
+}
+
} // namespace IDCache
#ifdef __cplusplus
@@ -104,8 +111,9 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved)
s_native_library_class = reinterpret_cast<jclass>(env->NewGlobalRef(native_library_class));
s_display_alert_msg = env->GetStaticMethodID(s_native_library_class, "displayAlertMsg",
"(Ljava/lang/String;Ljava/lang/String;Z)Z");
+ s_do_rumble = env->GetStaticMethodID(s_native_library_class, "rumble", "(ID)V");
s_get_update_touch_pointer =
- env->GetStaticMethodID(IDCache::GetNativeLibraryClass(), "updateTouchPointer", "()V");
+ env->GetStaticMethodID(s_native_library_class, "updateTouchPointer", "()V");
const jclass game_file_class = env->FindClass("org/dolphinemu/dolphinemu/model/GameFile");
s_game_file_class = reinterpret_cast<jclass>(env->NewGlobalRef(game_file_class));