[VTM] Fixed Java version: 7 -> 8
[VTM] Fixed libGDX API changes [VTM] Fixed libGDX API changes
This commit is contained in:
parent
332a694d65
commit
faf0d0dd99
@ -6,7 +6,7 @@ allprojects {
|
|||||||
group = 'org.mapsforge'
|
group = 'org.mapsforge'
|
||||||
version = 'master-SNAPSHOT'
|
version = 'master-SNAPSHOT'
|
||||||
|
|
||||||
ext.gdxVersion = "1.9.10"
|
ext.gdxVersion = "1.11.0"
|
||||||
ext.gwtVersion = "2.8.2"
|
ext.gwtVersion = "2.8.2"
|
||||||
ext.slf4jVersion = "1.7.28"
|
ext.slf4jVersion = "1.7.28"
|
||||||
|
|
||||||
@ -32,12 +32,12 @@ def versionName() { return version }
|
|||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_7
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
targetCompatibility = JavaVersion.VERSION_1_7
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
options.encoding = 'UTF-8'
|
options.encoding = 'UTF-8'
|
||||||
if (JavaVersion.current().isJava9Compatible()) {
|
if (JavaVersion.current().isJava9Compatible()) {
|
||||||
if (!project.properties.containsKey('android')) {
|
if (!project.properties.containsKey('android')) {
|
||||||
options.compilerArgs.addAll(['--release', '7'])
|
options.compilerArgs.addAll(['--release', '8'])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ public class GdxModelRenderer extends LayerRenderer {
|
|||||||
cam = new MapCamera(mMap);
|
cam = new MapCamera(mMap);
|
||||||
|
|
||||||
renderContext =
|
renderContext =
|
||||||
new RenderContext(new DefaultTextureBinder(DefaultTextureBinder.WEIGHTED, 1));
|
new RenderContext(new DefaultTextureBinder(DefaultTextureBinder.LRU, 1));
|
||||||
|
|
||||||
// shader = new DefaultShader(renderable.material,
|
// shader = new DefaultShader(renderable.material,
|
||||||
// renderable.mesh.getVertexAttributes(), true, false, 1, 0, 0, 0);
|
// renderable.mesh.getVertexAttributes(), true, false, 1, 0, 0, 0);
|
||||||
|
@ -61,7 +61,7 @@ public class GdxRenderer3D extends LayerRenderer {
|
|||||||
cam = new MapCamera(mMap);
|
cam = new MapCamera(mMap);
|
||||||
|
|
||||||
renderContext =
|
renderContext =
|
||||||
new RenderContext(new DefaultTextureBinder(DefaultTextureBinder.WEIGHTED, 1));
|
new RenderContext(new DefaultTextureBinder(DefaultTextureBinder.LRU, 1));
|
||||||
|
|
||||||
// shader = new DefaultShader(renderable.material,
|
// shader = new DefaultShader(renderable.material,
|
||||||
// renderable.mesh.getVertexAttributes(), true, false, 1, 0, 0, 0);
|
// renderable.mesh.getVertexAttributes(), true, false, 1, 0, 0, 0);
|
||||||
|
@ -255,10 +255,10 @@ public class InputHandler implements InputProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean scrolled(int amount) {
|
public boolean scrolled(float amountX, float amountY) {
|
||||||
float fx = mPosX - mMap.getWidth() / 2;
|
float fx = mPosX - mMap.getWidth() / 2;
|
||||||
float fy = mPosY - mMap.getHeight() / 2;
|
float fy = mPosY - mMap.getHeight() / 2;
|
||||||
mMap.animator().animateZoom(250, amount > 0 ? 0.75f : 1.333f, fx, fy, Easing.Type.LINEAR);
|
mMap.animator().animateZoom(250, amountY > 0 ? 0.75f : 1.333f, fx, fy, Easing.Type.LINEAR);
|
||||||
mMap.updateMap(false);
|
mMap.updateMap(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -276,4 +276,5 @@ public class InputHandler implements InputProcessor {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,7 @@ public class MotionHandler extends MotionEvent implements InputProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean scrolled(int amount) {
|
public boolean scrolled(float amountX, float amountY) {
|
||||||
mTime = Gdx.input.getCurrentEventTime();
|
mTime = Gdx.input.getCurrentEventTime();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -135,10 +135,10 @@ public class MapApplicationAdapter extends ApplicationAdapter {
|
|||||||
InputMultiplexer mux = new InputMultiplexer();
|
InputMultiplexer mux = new InputMultiplexer();
|
||||||
mux.addProcessor(new MotionHandler(map) {
|
mux.addProcessor(new MotionHandler(map) {
|
||||||
@Override
|
@Override
|
||||||
public boolean scrolled(int amount) {
|
public boolean scrolled(float amountX, float amountY) {
|
||||||
super.scrolled(amount);
|
super.scrolled(amountX, amountY);
|
||||||
MapPosition mapPosition = map.getMapPosition();
|
MapPosition mapPosition = map.getMapPosition();
|
||||||
int zoomLevel = mapPosition.getZoomLevel() - amount;
|
int zoomLevel = (int) (mapPosition.getZoomLevel() - amountY);
|
||||||
mapPosition.setZoomLevel(zoomLevel);
|
mapPosition.setZoomLevel(zoomLevel);
|
||||||
map.setMapPosition(mapPosition);
|
map.setMapPosition(mapPosition);
|
||||||
bothMapPositionHandler.mapPositionChangedFromVtmMap(mapPosition);
|
bothMapPositionHandler.mapPositionChangedFromVtmMap(mapPosition);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user