From e1191f68ae3f8f591d0205e216d0f39f43e2fea5 Mon Sep 17 00:00:00 2001 From: Emux Date: Mon, 14 Nov 2022 14:35:20 +0200 Subject: [PATCH] libGDX 1.11.0, fix #972 --- build.gradle | 9 +++++--- docs/Changelog.md | 1 + docs/Integration.md | 20 +++++++++--------- .../src/org/oscim/gdx/AndroidGL.java | 2 +- vtm-gdx/src/org/oscim/gdx/InputHandler.java | 1 - vtm-ios-example/build.gradle | 4 ++-- vtm-ios/build.gradle | 4 ++-- .../src/org/oscim/ios/backend/IosBitmap.java | 21 +++++++------------ vtm-ios/src/org/oscim/ios/backend/IosGL.java | 4 ++-- 9 files changed, 32 insertions(+), 34 deletions(-) diff --git a/build.gradle b/build.gradle index 5f046ae2..8d103300 100644 --- a/build.gradle +++ b/build.gradle @@ -32,12 +32,15 @@ def versionName() { return version } subprojects { tasks.withType(JavaCompile) { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_7 + targetCompatibility = JavaVersion.VERSION_1_7 options.encoding = 'UTF-8' if (JavaVersion.current().isJava9Compatible()) { if (!project.properties.containsKey('android')) { - options.compilerArgs.addAll(['--release', '8']) + if (project.name == 'vtm-desktop-lwjgl3' || project.name == 'vtm-playground' || project.name == 'vtm-theme-comparator') + options.compilerArgs.addAll(['--release', '8']) + else + options.compilerArgs.addAll(['--release', '7']) } } } diff --git a/docs/Changelog.md b/docs/Changelog.md index be1262a1..d5a7c6e2 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -4,6 +4,7 @@ - MVT simplification [#956](https://github.com/mapsforge/vtm/pull/956) - `Parameters.SIMPLIFICATION_TOLERANCE`, `Parameters.SIMPLIFICATION_EXCEPTIONS` +- libGDX 1.11.0 [#972](https://github.com/mapsforge/vtm/pull/972) - Disable `vtm-web` [#973](https://github.com/mapsforge/vtm/pull/973) - Minor improvements and bug fixes - [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.19.0) diff --git a/docs/Integration.md b/docs/Integration.md index 891dde42..10f62435 100644 --- a/docs/Integration.md +++ b/docs/Integration.md @@ -37,8 +37,8 @@ implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-arm64-v8 implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86' implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86_64' implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]' -implementation 'com.badlogicgames.gdx:gdx:1.9.10' -implementation 'com.badlogicgames.gdx:gdx-backend-android:1.9.10' +implementation 'com.badlogicgames.gdx:gdx:1.11.0' +implementation 'com.badlogicgames.gdx:gdx-backend-android:1.11.0' implementation 'com.caverock:androidsvg:1.4' ``` @@ -53,15 +53,15 @@ implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]' implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-linux' implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-osx' implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-windows' -implementation 'com.badlogicgames.gdx:gdx:1.9.10' -implementation 'com.badlogicgames.gdx:gdx-platform:1.9.10:natives-desktop' +implementation 'com.badlogicgames.gdx:gdx:1.11.0' +implementation 'com.badlogicgames.gdx:gdx-platform:1.11.0:natives-desktop' implementation 'com.formdev:svgSalamander:1.1.3' ``` ### Desktop (LWJGL) ```groovy implementation 'org.mapsforge:vtm-desktop-lwjgl:[CURRENT-VERSION]' -implementation 'com.badlogicgames.gdx:gdx-backend-lwjgl:1.9.10' +implementation 'com.badlogicgames.gdx:gdx-backend-lwjgl:1.11.0' implementation 'org.lwjgl.lwjgl:lwjgl:2.9.3' implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-linux' implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-osx' @@ -71,11 +71,11 @@ implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-windows' ### Desktop (LWJGL 3) ```groovy implementation 'org.mapsforge:vtm-desktop-lwjgl3:[CURRENT-VERSION]' -implementation 'com.badlogicgames.gdx:gdx-backend-lwjgl3:1.9.10' -implementation 'org.lwjgl:lwjgl:3.2.3' -implementation 'org.lwjgl:lwjgl:3.2.3:natives-linux' -implementation 'org.lwjgl:lwjgl:3.2.3:natives-macos' -implementation 'org.lwjgl:lwjgl:3.2.3:natives-windows' +implementation 'com.badlogicgames.gdx:gdx-backend-lwjgl3:1.11.0' +implementation 'org.lwjgl:lwjgl:3.3.1' +implementation 'org.lwjgl:lwjgl:3.3.1:natives-linux' +implementation 'org.lwjgl:lwjgl:3.3.1:natives-macos' +implementation 'org.lwjgl:lwjgl:3.3.1:natives-windows' ``` ### JTS geometries diff --git a/vtm-android-gdx/src/org/oscim/gdx/AndroidGL.java b/vtm-android-gdx/src/org/oscim/gdx/AndroidGL.java index ac7f3a83..545f9c49 100644 --- a/vtm-android-gdx/src/org/oscim/gdx/AndroidGL.java +++ b/vtm-android-gdx/src/org/oscim/gdx/AndroidGL.java @@ -222,7 +222,7 @@ public class AndroidGL implements GL { @Override public String getActiveUniform(int program, int index, IntBuffer size, Buffer type) { - return androidGL.glGetActiveUniform(program, index, size, type); + return androidGL.glGetActiveUniform(program, index, size, (IntBuffer) type); } @Override diff --git a/vtm-gdx/src/org/oscim/gdx/InputHandler.java b/vtm-gdx/src/org/oscim/gdx/InputHandler.java index 2360068b..a574e7be 100644 --- a/vtm-gdx/src/org/oscim/gdx/InputHandler.java +++ b/vtm-gdx/src/org/oscim/gdx/InputHandler.java @@ -276,5 +276,4 @@ public class InputHandler implements InputProcessor { } return false; } - } diff --git a/vtm-ios-example/build.gradle b/vtm-ios-example/build.gradle index 42cfc43d..f42df311 100644 --- a/vtm-ios-example/build.gradle +++ b/vtm-ios-example/build.gradle @@ -3,7 +3,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.7' + classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.18' } } @@ -15,7 +15,7 @@ sourceSets.main.java.srcDirs = ["src/"] [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' ext { - roboVMVersion = "2.3.7" + roboVMVersion = "2.3.18" } launchIPhoneSimulator.dependsOn build diff --git a/vtm-ios/build.gradle b/vtm-ios/build.gradle index 8dde6868..78cbba38 100644 --- a/vtm-ios/build.gradle +++ b/vtm-ios/build.gradle @@ -3,7 +3,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.7' + classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.18' } } @@ -16,7 +16,7 @@ sourceSets.main.java.srcDirs = ["src/"] [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' ext { - roboVMVersion = "2.3.7" + roboVMVersion = "2.3.18" } launchIPhoneSimulator.dependsOn build diff --git a/vtm-ios/src/org/oscim/ios/backend/IosBitmap.java b/vtm-ios/src/org/oscim/ios/backend/IosBitmap.java index 67acf5c8..ac27ca4c 100644 --- a/vtm-ios/src/org/oscim/ios/backend/IosBitmap.java +++ b/vtm-ios/src/org/oscim/ios/backend/IosBitmap.java @@ -17,21 +17,15 @@ package org.oscim.ios.backend; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Pixmap; - import org.oscim.backend.AssetAdapter; import org.oscim.backend.GL; import org.oscim.backend.canvas.Bitmap; import org.oscim.backend.canvas.Color; -import org.robovm.apple.coregraphics.CGBitmapContext; -import org.robovm.apple.coregraphics.CGBlendMode; -import org.robovm.apple.coregraphics.CGColor; -import org.robovm.apple.coregraphics.CGColorSpace; -import org.robovm.apple.coregraphics.CGImage; -import org.robovm.apple.coregraphics.CGImageAlphaInfo; -import org.robovm.apple.coregraphics.CGRect; +import org.robovm.apple.coregraphics.*; import org.robovm.apple.foundation.NSData; import org.robovm.apple.uikit.UIColor; import org.robovm.apple.uikit.UIImage; +import org.robovm.rt.VM; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,6 +33,7 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.nio.Buffer; +import java.nio.ByteOrder; /** * iOS specific implementation of {@link Bitmap}. @@ -217,7 +212,7 @@ public class IosBitmap implements Bitmap { glFormat = pixmap.getGLFormat(); glType = pixmap.getGLType(); - directPixelBuffer = cgBitmapContext.getData().asIntBuffer(encodedData.length / 4); + directPixelBuffer = VM.newDirectByteBuffer(cgBitmapContext.getData(), (encodedData.length / 4) << 2).order(ByteOrder.nativeOrder()).asIntBuffer(); pixmap.dispose(); } @@ -256,10 +251,10 @@ public class IosBitmap implements Bitmap { */ static CGColor getCGColor(int color) { return UIColor.fromRGBA( - Color.a(color), - Color.g(color), - Color.b(color), - Color.r(color)) + Color.a(color), + Color.g(color), + Color.b(color), + Color.r(color)) .getCGColor(); } diff --git a/vtm-ios/src/org/oscim/ios/backend/IosGL.java b/vtm-ios/src/org/oscim/ios/backend/IosGL.java index 50cfdcc5..6df04869 100644 --- a/vtm-ios/src/org/oscim/ios/backend/IosGL.java +++ b/vtm-ios/src/org/oscim/ios/backend/IosGL.java @@ -563,7 +563,7 @@ public class IosGL implements GL { program, index, size, - type); + (IntBuffer) type); } @Override @@ -572,7 +572,7 @@ public class IosGL implements GL { program, index, size, - type); + (IntBuffer) type); } @Override