Fixed #11278 / FPS limit changes on iOS

This commit is contained in:
Anuken
2025-10-12 17:13:00 +09:00
parent 197d8c4060
commit 872939454f
4 changed files with 14 additions and 11 deletions

View File

@@ -214,7 +214,7 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
public void update(){
PerfCounter.update.begin();
int targetfps = Core.settings.getInt("fpscap", 120);
int targetfps = ios ? 0 : Core.settings.getInt("fpscap", 120);
boolean changed = lastTargetFps != targetfps && lastTargetFps != -1;
boolean limitFps = targetfps > 0 && targetfps <= 240;

View File

@@ -386,7 +386,18 @@ public class SettingsMenuDialog extends BaseDialog{
graphics.sliderPref("bloomintensity", 6, 0, 16, i -> (int)(i/4f * 100f) + "%");
graphics.sliderPref("bloomblur", 2, 1, 16, i -> i + "x");
graphics.sliderPref("fpscap", 240, 10, 245, 5, s -> (s > 240 ? Core.bundle.get("setting.fpscap.none") : Core.bundle.format("setting.fpscap.text", s)));
graphics.sliderPref("fpscap", 240, 10, 245, 5, s -> {
if(ios){
Core.graphics.setPreferredFPS(s > 240 ? 0 : s);
}
return (s > 240 ? Core.bundle.get("setting.fpscap.none") : Core.bundle.format("setting.fpscap.text", s));
});
if(ios){
int value = Core.settings.getInt("fpscap", 240);
Core.graphics.setPreferredFPS(value > 240 ? 0 : value);
}
graphics.sliderPref("chatopacity", 100, 0, 100, 5, s -> s + "%");
graphics.sliderPref("lasersopacity", 100, 0, 100, 5, s -> {
if(ui.settings != null){
@@ -412,13 +423,6 @@ public class SettingsMenuDialog extends BaseDialog{
return s + "%";
});
if(ios){
graphics.checkPref("iosuncapfps", false, b -> Core.graphics.setPreferredFPS(b ? 0 : 60));
if(Core.settings.getBool("iosuncapfps")){
Core.graphics.setPreferredFPS(0);
}
}
if(!mobile){
graphics.checkPref("vsync", true, b -> Core.graphics.setVSync(b));
graphics.checkPref("fullscreen", false, b -> {