From 3a587bbec45bec4a11d1eb92db441b655c6befbc Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 29 Dec 2021 21:19:57 -0500 Subject: [PATCH] v1.1.2: iOS version now takes advantage of higher framerate devices --- .../shatteredpixeldungeon/ios/IOSLauncher.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ios/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ios/IOSLauncher.java b/ios/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ios/IOSLauncher.java index a10270414..823a71a33 100644 --- a/ios/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ios/IOSLauncher.java +++ b/ios/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ios/IOSLauncher.java @@ -18,9 +18,11 @@ import org.robovm.apple.foundation.NSAutoreleasePool; import org.robovm.apple.foundation.NSBundle; import org.robovm.apple.foundation.NSDictionary; import org.robovm.apple.foundation.NSException; +import org.robovm.apple.foundation.NSProcessInfo; import org.robovm.apple.glkit.GLKViewDrawableColorFormat; import org.robovm.apple.glkit.GLKViewDrawableDepthFormat; import org.robovm.apple.uikit.UIApplication; +import org.robovm.apple.uikit.UIScreen; public class IOSLauncher extends IOSApplication.Delegate { @Override @@ -59,6 +61,10 @@ public class IOSLauncher extends IOSApplication.Delegate { config.depthFormat = GLKViewDrawableDepthFormat.None; config.hdpiMode = HdpiMode.Pixels; + if (NSProcessInfo.getSharedProcessInfo().getOperatingSystemVersion().getMajorVersion() >= 11) { + config.preferredFramesPerSecond = (int)(UIScreen.getMainScreen().getMaximumFramesPerSecond()); + } + CGRect statusBarFrame = UIApplication.getSharedApplication().getStatusBarFrame(); double statusBarHeight = Math.min(statusBarFrame.getWidth(), statusBarFrame.getHeight());