Skip to content

Commit

Permalink
Merge branch 'master' into iosupgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
obigu authored Apr 20, 2024
2 parents 7733fde + 10b21c0 commit c134dad
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 36 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 * */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 **/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
23 changes: 12 additions & 11 deletions tests/gdx-tests-iosrobovm/robovm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,20 @@
<pattern>org.apache.harmony.security.provider.crypto.CryptoProvider</pattern>
</forceLinkClasses>
<libs>
<lib variant="device">../../gdx/libs/ios32/gdx.xcframework/ios-arm64_armv7/libgdx.a</lib>
<lib variant="device">../../gdx/libs/ios32/ObjectAL.xcframework/ios-arm64_armv7/libObjectAL.a</lib>
<lib variant="device">../../extensions/gdx-freetype/libs/ios32/gdx-freetype.xcframework/ios-arm64_armv7/libgdx-freetype.a</lib>
<lib variant="device">../../extensions/gdx-bullet/libs/ios32/gdx-bullet.xcframework/ios-arm64_armv7/libgdx-bullet.a</lib>
<lib variant="device">../../extensions/gdx-box2d/gdx-box2d/libs/ios32/gdx-box2d.xcframework/ios-arm64_armv7/libgdx-box2d.a</lib>

<lib variant="simulator">../../gdx/libs/ios32/gdx.xcframework/ios-arm64_x86_64-simulator/libgdx.a</lib>
<lib variant="simulator">../../gdx/libs/ios32/ObjectAL.xcframework/ios-arm64_x86_64-simulator/libObjectAL.a</lib>
<lib variant="simulator">../../extensions/gdx-freetype/libs/ios32/gdx-freetype.xcframework/ios-arm64_x86_64-simulator/libgdx-freetype.a</lib>
<lib variant="simulator">../../extensions/gdx-bullet/libs/ios32/gdx-bullet.xcframework/ios-arm64_x86_64-simulator/libgdx-bullet.a</lib>
<lib variant="simulator">../../extensions/gdx-box2d/gdx-box2d/libs/ios32/gdx-box2d.xcframework/ios-arm64_x86_64-simulator/libgdx-box2d.a</lib>
</libs>
<frameworkPaths>
<path>../../gdx/libs/ios32</path>
<path>../../extensions/gdx-freetype/libs/ios32</path>
<path>../../extensions/gdx-bullet/libs/ios32</path>
<path>../../extensions/gdx-box2d/gdx-box2d/libs/ios32</path>
</frameworkPaths>
<frameworks>
<framework>gdx</framework>
<framework>ObjectAL</framework>
<framework>gdx-freetype</framework>
<framework>gdx-bullet</framework>
<framework>gdx-box2d</framework>
<!-- System Frameworks -->
<framework>UIKit</framework>
<framework>OpenGLES</framework>
<framework>QuartzCore</framework>
Expand Down

0 comments on commit c134dad

Please sign in to comment.