diff --git a/CHANGES b/CHANGES index c743847437b..aa9739a6b55 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ - [BREAKING CHANGE] GWT: Updated to 2.10.0. `com.google.jsinterop:jsinterop-annotations:2.0.2:sources` must be added as a dependency to your html project dependencies. - [BREAKING CHANGE] Android: Minimum API level is now level 19 (Android 4.4) - [BREAKING CHANGE] iOS: Increased min supported iOS version to 12.0. Update your Info.plist file if necessary. +- [BREAKING CHANGE] Android, iOS: Exceptions occurring in Runnable tasks scheduled through Gdx.app.postRunnable() are no longer swallowed and will crash the app (add a protection if required). - iOS: Update to MobiVM 2.3.21 - iOS: The iOS backend now implements AudioDevice. It can be configured through IOSApplicationConfiguration with audioDeviceBufferSize/audioDeviceBufferCount - Fixed GlyphLayout for fixed width glyph offsets at the start and end of lines. diff --git a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGraphics.java b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGraphics.java index 9ba40d3c3aa..a2177eb2462 100644 --- a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGraphics.java +++ b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGraphics.java @@ -494,11 +494,7 @@ public void onDrawFrame (javax.microedition.khronos.opengles.GL10 gl) { } for (int i = 0; i < app.getExecutedRunnables().size; i++) { - try { - app.getExecutedRunnables().get(i).run(); - } catch (Throwable t) { - t.printStackTrace(); - } + app.getExecutedRunnables().get(i).run(); } app.getInput().processEvents(); frameId++; diff --git a/backends/gdx-backend-robovm-metalangle/src/com/badlogic/gdx/backends/iosrobovm/IOSApplication.java b/backends/gdx-backend-robovm-metalangle/src/com/badlogic/gdx/backends/iosrobovm/IOSApplication.java index ca806176ea8..2149c1d5ef9 100644 --- a/backends/gdx-backend-robovm-metalangle/src/com/badlogic/gdx/backends/iosrobovm/IOSApplication.java +++ b/backends/gdx-backend-robovm-metalangle/src/com/badlogic/gdx/backends/iosrobovm/IOSApplication.java @@ -394,11 +394,7 @@ public void processRunnables () { runnables.clear(); } for (int i = 0; i < executedRunnables.size; i++) { - try { - executedRunnables.get(i).run(); - } catch (Throwable t) { - t.printStackTrace(); - } + executedRunnables.get(i).run(); } } diff --git a/backends/gdx-backend-robovm-metalangle/src/com/badlogic/gdx/backends/iosrobovm/IOSApplicationConfiguration.java b/backends/gdx-backend-robovm-metalangle/src/com/badlogic/gdx/backends/iosrobovm/IOSApplicationConfiguration.java index 300a12f0838..f0cb63b9e8d 100644 --- a/backends/gdx-backend-robovm-metalangle/src/com/badlogic/gdx/backends/iosrobovm/IOSApplicationConfiguration.java +++ b/backends/gdx-backend-robovm-metalangle/src/com/badlogic/gdx/backends/iosrobovm/IOSApplicationConfiguration.java @@ -36,8 +36,8 @@ public class IOSApplicationConfiguration { /** the multisample format, None is default * */ public MGLDrawableMultisample multisample = MGLDrawableMultisample.None; - /** preferred/max number of frames per second. Set to "0" to indicate max supported by screen (on standard OpenGL backend (non - * MetalANGLE) Apple has a 60fps cap on most devices). * */ + /** preferred/max number of frames per second. Set to "0" to indicate max supported by screen. Important: On standard OpenGL + * backend FPS is capped to 60. Make sure to use MetalANGLE to support higher FPS. * */ public int preferredFramesPerSecond = 0; /** whether to use the accelerometer, default true * */ diff --git a/backends/gdx-backend-robovm-metalangle/src/com/badlogic/gdx/backends/iosrobovm/IOSGraphics.java b/backends/gdx-backend-robovm-metalangle/src/com/badlogic/gdx/backends/iosrobovm/IOSGraphics.java index ad4765231c2..0f247f9ad77 100644 --- a/backends/gdx-backend-robovm-metalangle/src/com/badlogic/gdx/backends/iosrobovm/IOSGraphics.java +++ b/backends/gdx-backend-robovm-metalangle/src/com/badlogic/gdx/backends/iosrobovm/IOSGraphics.java @@ -150,10 +150,11 @@ public void draw (CGRect rect) { viewController.setView(view); viewController.setDelegate(viewDelegate); int preferredFps; + int maxSupportedFPS = (int)(UIScreen.getMainScreen().getMaximumFramesPerSecond()); if (config.preferredFramesPerSecond == 0) { - preferredFps = (int)(UIScreen.getMainScreen().getMaximumFramesPerSecond()); + preferredFps = maxSupportedFPS; } else { - preferredFps = config.preferredFramesPerSecond; + preferredFps = Math.min(config.preferredFramesPerSecond, maxSupportedFPS); } viewController.setPreferredFramesPerSecond(preferredFps); this.app = app; diff --git a/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSApplication.java b/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSApplication.java index 386793ec6a1..4427fcccb39 100644 --- a/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSApplication.java +++ b/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSApplication.java @@ -413,11 +413,7 @@ public void processRunnables () { runnables.clear(); } for (int i = 0; i < executedRunnables.size; i++) { - try { - executedRunnables.get(i).run(); - } catch (Throwable t) { - t.printStackTrace(); - } + executedRunnables.get(i).run(); } } diff --git a/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSApplicationConfiguration.java b/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSApplicationConfiguration.java index 2111d4f595c..0de031428fd 100644 --- a/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSApplicationConfiguration.java +++ b/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSApplicationConfiguration.java @@ -47,8 +47,8 @@ public class IOSApplicationConfiguration { /** the multisample format, None is default **/ public GLKViewDrawableMultisample multisample = GLKViewDrawableMultisample.None; - /** preferred/max number of frames per second. Set to "0" to indicate max supported by screen (on standard OpenGL backend (non - * MetalANGLE) Apple has a 60fps cap on most devices). **/ + /** preferred/max number of frames per second. Set to "0" to indicate max supported by screen. Important: On standard OpenGL + * backend FPS is capped to 60. Make sure to use MetalANGLE to support higher FPS. **/ public int preferredFramesPerSecond = 0; /** whether to use the accelerometer, default true **/ diff --git a/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSGraphics.java b/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSGraphics.java index ef644bdb002..dd9967f97fc 100644 --- a/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSGraphics.java +++ b/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSGraphics.java @@ -145,10 +145,11 @@ public void draw (CGRect rect) { viewController.setDelegate(viewDelegate); int preferredFps; + int maxSupportedFPS = (int)(UIScreen.getMainScreen().getMaximumFramesPerSecond()); if (config.preferredFramesPerSecond == 0) { - preferredFps = (int)(UIScreen.getMainScreen().getMaximumFramesPerSecond()); + preferredFps = maxSupportedFPS; } else { - preferredFps = config.preferredFramesPerSecond; + preferredFps = Math.min(config.preferredFramesPerSecond, maxSupportedFPS); } viewController.setPreferredFramesPerSecond(preferredFps); diff --git a/extensions/gdx-freetype/src/com/badlogic/gdx/graphics/g2d/freetype/FreeTypeFontGenerator.java b/extensions/gdx-freetype/src/com/badlogic/gdx/graphics/g2d/freetype/FreeTypeFontGenerator.java index 4472ff7c8f3..dee52891062 100644 --- a/extensions/gdx-freetype/src/com/badlogic/gdx/graphics/g2d/freetype/FreeTypeFontGenerator.java +++ b/extensions/gdx-freetype/src/com/badlogic/gdx/graphics/g2d/freetype/FreeTypeFontGenerator.java @@ -598,8 +598,9 @@ public FreeTypeBitmapFontData generateData (FreeTypeFontParameter parameter, Fre } } - Rectangle rect = packer.pack(mainPixmap); - glyph.page = packer.getPages().size - 1; // Glyph is always packed into the last page for now. + String pixmapName = glyph.hashCode() + "_" + glyph.id; + Rectangle rect = packer.pack(pixmapName, mainPixmap); + glyph.page = packer.getPageIndex(pixmapName); glyph.srcX = (int)rect.x; glyph.srcY = (int)rect.y; diff --git a/extensions/gdx-setup/res/com/badlogic/gdx/setup/resources/android/proguard-rules.pro b/extensions/gdx-setup/res/com/badlogic/gdx/setup/resources/android/proguard-rules.pro index 63c1adb6ea1..edadc84afe5 100644 --- a/extensions/gdx-setup/res/com/badlogic/gdx/setup/resources/android/proguard-rules.pro +++ b/extensions/gdx-setup/res/com/badlogic/gdx/setup/resources/android/proguard-rules.pro @@ -23,6 +23,11 @@ -dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication +# Required if using libGDX Scene2d Skins (JSON Skin descriptors) +-keep public class com.badlogic.gdx.scenes.scene2d.** { *; } +-keep public class com.badlogic.gdx.graphics.g2d.BitmapFont { *; } +-keep public class com.badlogic.gdx.graphics.Color { *; } + # Required if using Gdx-Controllers extension -keep class com.badlogic.gdx.controllers.android.AndroidControllers diff --git a/gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java b/gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java index b268ff70aef..93e9fca9a7f 100644 --- a/gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java +++ b/gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java @@ -218,6 +218,7 @@ public boolean handle (Event event) { protected void addScrollListener () { addListener(new InputListener() { public boolean scrolled (InputEvent event, float x, float y, float scrollAmountX, float scrollAmountY) { + event.cancel(); setScrollbarsVisible(true); if (scrollY || scrollX) { if (scrollY) { diff --git a/tests/gdx-tests-iosrobovm/robovm.xml b/tests/gdx-tests-iosrobovm/robovm.xml index d397409cdec..986bfb1592e 100644 --- a/tests/gdx-tests-iosrobovm/robovm.xml +++ b/tests/gdx-tests-iosrobovm/robovm.xml @@ -34,19 +34,20 @@ org.apache.harmony.security.provider.crypto.CryptoProvider - ../../gdx/libs/ios32/gdx.xcframework/ios-arm64_armv7/libgdx.a - ../../gdx/libs/ios32/ObjectAL.xcframework/ios-arm64_armv7/libObjectAL.a - ../../extensions/gdx-freetype/libs/ios32/gdx-freetype.xcframework/ios-arm64_armv7/libgdx-freetype.a - ../../extensions/gdx-bullet/libs/ios32/gdx-bullet.xcframework/ios-arm64_armv7/libgdx-bullet.a - ../../extensions/gdx-box2d/gdx-box2d/libs/ios32/gdx-box2d.xcframework/ios-arm64_armv7/libgdx-box2d.a - - ../../gdx/libs/ios32/gdx.xcframework/ios-arm64_x86_64-simulator/libgdx.a - ../../gdx/libs/ios32/ObjectAL.xcframework/ios-arm64_x86_64-simulator/libObjectAL.a - ../../extensions/gdx-freetype/libs/ios32/gdx-freetype.xcframework/ios-arm64_x86_64-simulator/libgdx-freetype.a - ../../extensions/gdx-bullet/libs/ios32/gdx-bullet.xcframework/ios-arm64_x86_64-simulator/libgdx-bullet.a - ../../extensions/gdx-box2d/gdx-box2d/libs/ios32/gdx-box2d.xcframework/ios-arm64_x86_64-simulator/libgdx-box2d.a + + ../../gdx/libs/ios32 + ../../extensions/gdx-freetype/libs/ios32 + ../../extensions/gdx-bullet/libs/ios32 + ../../extensions/gdx-box2d/gdx-box2d/libs/ios32 + + gdx + ObjectAL + gdx-freetype + gdx-bullet + gdx-box2d + UIKit OpenGLES QuartzCore