Implement graphics pipelines loading screen core logic

This commit is contained in:
lynxnb
2023-04-24 17:44:39 +02:00
parent 03029f5fa9
commit e41ff6b19f
8 changed files with 181 additions and 21 deletions

View File

@ -63,8 +63,11 @@ namespace skyline {
waitForSubmitOrCancelId{environ->GetMethodID(instanceClass, "waitForSubmitOrCancel", "(Lemu/skyline/applet/swkbd/SoftwareKeyboardDialog;)[Ljava/lang/Object;")},
closeKeyboardId{environ->GetMethodID(instanceClass, "closeKeyboard", "(Lemu/skyline/applet/swkbd/SoftwareKeyboardDialog;)V")},
showValidationResultId{environ->GetMethodID(instanceClass, "showValidationResult", "(Lemu/skyline/applet/swkbd/SoftwareKeyboardDialog;ILjava/lang/String;)I")},
getVersionCodeId{environ->GetMethodID(instanceClass, "getVersionCode", "()I")},
getIntegerValueId{environ->GetMethodID(environ->FindClass("java/lang/Integer"), "intValue", "()I")},
showPipelineLoadingScreenId{environ->GetMethodID(instanceClass, "showPipelineLoadingScreen", "(I)V")},
updatePipelineLoadingProgressId{environ->GetMethodID(instanceClass, "updatePipelineLoadingProgress", "(I)V")},
hidePipelineLoadingScreenId{environ->GetMethodID(instanceClass, "hidePipelineLoadingScreen", "()V")},
getVersionCodeId{environ->GetMethodID(instanceClass, "getVersionCode", "()I")},
getDhcpInfoId{environ->GetMethodID(instanceClass, "getDhcpInfo", "()Landroid/net/DhcpInfo;")} {
env.Initialize(environ);
}
@ -155,14 +158,26 @@ namespace skyline {
env->DeleteGlobalRef(dialog);
}
i32 JvmManager::GetVersionCode() {
return env->CallIntMethod(instance, getVersionCodeId);
}
JvmManager::KeyboardCloseResult JvmManager::ShowValidationResult(jobject dialog, KeyboardTextCheckResult checkResult, std::u16string message) {
auto str{env->NewString(reinterpret_cast<const jchar *>(message.data()), static_cast<int>(message.length()))};
auto result{static_cast<KeyboardCloseResult>(env->CallIntMethod(instance, showValidationResultId, dialog, checkResult, str))};
env->DeleteLocalRef(str);
return result;
}
void JvmManager::ShowPipelineLoadingScreen(u32 totalPipelineCount) {
env->CallVoidMethod(instance, showPipelineLoadingScreenId, static_cast<jint>(totalPipelineCount));
}
void JvmManager::UpdatePipelineLoadingProgress(u32 progress) {
env->CallVoidMethod(instance, updatePipelineLoadingProgressId, static_cast<jint>(progress));
}
void JvmManager::HidePipelineLoadingScreen() {
env->CallVoidMethod(instance, hidePipelineLoadingScreenId);
}
i32 JvmManager::GetVersionCode() {
return env->CallIntMethod(instance, getVersionCodeId);
}
}