diff --git a/SPD-classes/src/main/java/com/watabou/noosa/Game.java b/SPD-classes/src/main/java/com/watabou/noosa/Game.java index 83a634d9e..12c19eca5 100644 --- a/SPD-classes/src/main/java/com/watabou/noosa/Game.java +++ b/SPD-classes/src/main/java/com/watabou/noosa/Game.java @@ -146,9 +146,11 @@ public class Game implements ApplicationListener { } } - //FIXME this is a hack to improve start times on android (first frame is 'cheated' and skips rendering) - //This is mainly to improve stats on google play, as lots of texture refreshing leads to slow warm starts - //Would be nice to accomplish this goal in a less hacky way + ///justResumed is used for two purposes: + //firstly, to clear pointer events when the game is resumed, + // this helps with input errors caused by system gestures on iOS/Android + //secondly, as a bit of a hack to improve start time metrics on Android, + // as texture refreshing leads to slow warm starts. TODO would be nice to fix this properly private boolean justResumed = true; @Override @@ -160,6 +162,7 @@ public class Game implements ApplicationListener { } if (justResumed){ + PointerEvent.clearPointerEvents(); justResumed = false; if (DeviceCompat.isAndroid()) return; } 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 94554754b..d56698974 100644 --- a/ios/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ios/IOSLauncher.java +++ b/ios/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ios/IOSLauncher.java @@ -104,7 +104,10 @@ public class IOSLauncher extends IOSApplication.Delegate { config.hideHomeIndicator = SPDSettings.fullscreen(); config.overrideRingerSwitch = SPDSettings.ignoreSilentMode(); - config.screenEdgesDeferringSystemGestures = UIRectEdge.None; + //game has to ignore input from system gestures itself, otherwise there is lag on + //every button press on the corner of the screen. Currently this is accomplished via + //clearing all pointer events on the first frame after the game is resumed. + config.screenEdgesDeferringSystemGestures = UIRectEdge.All; if (NSProcessInfo.getSharedProcessInfo().getOperatingSystemVersion().getMajorVersion() >= 11) { config.preferredFramesPerSecond = (int)(UIScreen.getMainScreen().getMaximumFramesPerSecond());