Merge pull request #7726 from zackhow/rumfast

Android: Optimize rumble call
This commit is contained in:
JosJuice
2019-01-30 19:37:24 +01:00
committed by GitHub
3 changed files with 11 additions and 4 deletions

View File

@ -239,9 +239,7 @@ void Touchscreen::Motor::Rumble(int padID, double state)
{
JNIEnv* env;
IDCache::GetJavaVM()->AttachCurrentThread(&env, nullptr);
jmethodID rumbleMethod =
env->GetStaticMethodID(IDCache::GetNativeLibraryClass(), "rumble", "(ID)V");
env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), rumbleMethod, padID, state);
env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), IDCache::GetDoRumble(), padID, state);
IDCache::GetJavaVM()->DetachCurrentThread();
}
}