Android: Normalize pointer touches based on rendered aspect ratio

This allows the defaults to be actual defaults across devices with different
screen sizes
This commit is contained in:
zackhow
2019-01-19 22:49:04 -05:00
parent ec557eb3a2
commit e8739156e4
8 changed files with 117 additions and 20 deletions

View File

@ -107,6 +107,11 @@ void Host_UpdateMainFrame()
void Host_RequestRenderWindowSize(int width, int height)
{
// Update touch pointer
JNIEnv* env;
IDCache::GetJavaVM()->AttachCurrentThread(&env, nullptr);
env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), IDCache::GetUpdateTouchPointer());
IDCache::GetJavaVM()->DetachCurrentThread();
}
bool Host_UINeedsControllerState()
@ -564,6 +569,13 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceDestr
s_surf = nullptr;
}
}
JNIEXPORT jfloat JNICALL
Java_org_dolphinemu_dolphinemu_NativeLibrary_GetGameAspectRatio(JNIEnv* env, jobject obj)
{
return g_renderer->CalculateDrawAspectRatio();
}
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_RefreshWiimotes(JNIEnv* env,
jobject obj)
{