Skip to content

Commit

Permalink
libGDX 1.11.0, fix #972
Browse files Browse the repository at this point in the history
  • Loading branch information
devemux86 committed Nov 14, 2022
1 parent 36e4116 commit e1191f6
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 34 deletions.
9 changes: 6 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
}
}
}
Expand Down
1 change: 1 addition & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 10 additions & 10 deletions docs/Integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
```

Expand All @@ -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'
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion vtm-android-gdx/src/org/oscim/gdx/AndroidGL.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public String getActiveAttrib(int program, int index, IntBuffer size, Buffer typ

@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
Expand Down
1 change: 0 additions & 1 deletion vtm-gdx/src/org/oscim/gdx/InputHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,5 +276,4 @@ private boolean toggleBuildingLayer(List<Layer> layers) {
}
return false;
}

}
4 changes: 2 additions & 2 deletions vtm-ios-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions vtm-ios/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand All @@ -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
Expand Down
21 changes: 8 additions & 13 deletions vtm-ios/src/org/oscim/ios/backend/IosBitmap.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,23 @@

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;

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}.
Expand Down Expand Up @@ -217,7 +212,7 @@ public void uploadToTexture(boolean replace) {
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();

}
Expand Down Expand Up @@ -256,10 +251,10 @@ static byte[] toByteArray(InputStream in) throws IOException {
*/
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();
}

Expand Down
4 changes: 2 additions & 2 deletions vtm-ios/src/org/oscim/ios/backend/IosGL.java
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ public String getActiveAttrib(int program, int index, IntBuffer size, Buffer typ
program,
index,
size,
type);
(IntBuffer) type);
}

@Override
Expand All @@ -572,7 +572,7 @@ public String getActiveUniform(int program, int index, IntBuffer size, Buffer ty
program,
index,
size,
type);
(IntBuffer) type);
}

@Override
Expand Down

0 comments on commit e1191f6

Please sign in to comment.