Fix android
Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
parent
09e040eedf
commit
304979701e
|
|
@ -209,10 +209,15 @@ object NativeLibrary {
|
|||
external fun setTurboSpeedLimit(enabled: Boolean)
|
||||
|
||||
/**
|
||||
* Set the current speed limit to the configured turbo speed.
|
||||
* Set the current speed limit to the configured slow speed.
|
||||
*/
|
||||
external fun setSlowSpeedLimit(enabled: Boolean)
|
||||
|
||||
/**
|
||||
* Set the current speed limit to the configured standard speed.
|
||||
*/
|
||||
external fun setStandardSpeedLimit(enabled: Boolean)
|
||||
|
||||
/**
|
||||
* Returns Vulkan driver version / API version / GPU model
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class QuickSettings(val emulationFragment: EmulationFragment) {
|
|||
|
||||
fun addCustomToggle(
|
||||
name: Int,
|
||||
// isChecked: Boolean,
|
||||
isChecked: Boolean,
|
||||
|
||||
container: ViewGroup,
|
||||
callback: (Boolean) -> Unit
|
||||
|
|
@ -152,13 +152,14 @@ class QuickSettings(val emulationFragment: EmulationFragment) {
|
|||
|
||||
titleView.text = YuzuApplication.appContext.getString(name)
|
||||
switchContainer.visibility = View.VISIBLE
|
||||
// switchView.isChecked = isChecked
|
||||
|
||||
switchView.setOnCheckedChangeListener { _, checked ->
|
||||
callback(checked)
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
switchView.isChecked = isChecked
|
||||
|
||||
switchContainer.setOnClickListener {
|
||||
switchView.toggle()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1056,11 +1056,24 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
|||
quickSettings.addPerGameConfigStatusIndicator(container)
|
||||
}
|
||||
|
||||
quickSettings.addBooleanSetting(
|
||||
lateinit var slowSpeed: MaterialSwitch
|
||||
lateinit var turboSpeed: MaterialSwitch
|
||||
|
||||
quickSettings.addCustomToggle(
|
||||
R.string.frame_limit_enable,
|
||||
container,
|
||||
BooleanSetting.RENDERER_USE_SPEED_LIMIT,
|
||||
)
|
||||
BooleanSetting.RENDERER_USE_SPEED_LIMIT.getBoolean(false),
|
||||
container
|
||||
) { enabled ->
|
||||
if (!enabled) {
|
||||
turboSpeed.isChecked = false
|
||||
slowSpeed.isChecked = false
|
||||
}
|
||||
|
||||
turboSpeed.isEnabled = enabled
|
||||
slowSpeed.isEnabled = enabled
|
||||
|
||||
NativeLibrary.setStandardSpeedLimit(enabled)
|
||||
}!!
|
||||
|
||||
quickSettings.addSliderSetting(
|
||||
R.string.frame_limit_slider,
|
||||
|
|
@ -1071,11 +1084,9 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
|||
units = "%",
|
||||
)
|
||||
|
||||
lateinit var slowSpeed: MaterialSwitch
|
||||
lateinit var turboSpeed: MaterialSwitch
|
||||
|
||||
turboSpeed = quickSettings.addCustomToggle(
|
||||
R.string.turbo_speed_limit,
|
||||
false,
|
||||
container
|
||||
) { enabled ->
|
||||
if (enabled)
|
||||
|
|
@ -1085,6 +1096,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
|||
|
||||
slowSpeed = quickSettings.addCustomToggle(
|
||||
R.string.slow_speed_limit,
|
||||
false,
|
||||
container
|
||||
) { enabled ->
|
||||
if (enabled)
|
||||
|
|
|
|||
|
|
@ -1262,6 +1262,11 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_setSlowSpeedLimit(JNIEnv *env, jobjec
|
|||
cur.SetValue(fallback);
|
||||
}
|
||||
|
||||
void Java_org_yuzu_yuzu_1emu_NativeLibrary_setStandardSpeedLimit(JNIEnv *env, jobject jobj, jboolean enabled) {
|
||||
Settings::values.use_speed_limit.SetValue(enabled);
|
||||
Settings::values.current_speed_limit.SetValue(Settings::values.speed_limit.GetValue());
|
||||
}
|
||||
|
||||
void Java_org_yuzu_yuzu_1emu_NativeLibrary_run(JNIEnv* env, jobject jobj, jstring j_path,
|
||||
jint j_program_index,
|
||||
jboolean j_frontend_initiated) {
|
||||
|
|
|
|||
|
|
@ -1440,6 +1440,7 @@ void MainWindow::InitializeHotkeys() {
|
|||
connect_shortcut(QStringLiteral("Audio Mute/Unmute"), &MainWindow::OnMute);
|
||||
connect_shortcut(QStringLiteral("Audio Volume Down"), &MainWindow::OnDecreaseVolume);
|
||||
connect_shortcut(QStringLiteral("Audio Volume Up"), &MainWindow::OnIncreaseVolume);
|
||||
|
||||
connect_shortcut(QStringLiteral("Toggle Framerate Limit"), [] {
|
||||
Settings::values.use_speed_limit.SetValue(!Settings::values.use_speed_limit.GetValue());
|
||||
Settings::values.current_speed_limit.SetValue(Settings::values.speed_limit.GetValue());
|
||||
|
|
|
|||
Loading…
Reference in New Issue