diff --git a/vtm-gdx-desktop/src/org/oscim/awt/AwtCanvas.java b/vtm-gdx-desktop/src/org/oscim/awt/AwtCanvas.java index 221c4c66..6a6c0254 100644 --- a/vtm-gdx-desktop/src/org/oscim/awt/AwtCanvas.java +++ b/vtm-gdx-desktop/src/org/oscim/awt/AwtCanvas.java @@ -17,7 +17,6 @@ package org.oscim.awt; import java.awt.AlphaComposite; -import java.awt.Color; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.font.TextLayout; diff --git a/vtm-gdx-desktop/src/org/oscim/awt/AwtPaint.java b/vtm-gdx-desktop/src/org/oscim/awt/AwtPaint.java index eafa121b..4b0be66c 100644 --- a/vtm-gdx-desktop/src/org/oscim/awt/AwtPaint.java +++ b/vtm-gdx-desktop/src/org/oscim/awt/AwtPaint.java @@ -60,7 +60,7 @@ public class AwtPaint implements Paint { private int cap; private float strokeWidth; - private Align mAlign; + //private Align mAlign; @Override public int getColor() { @@ -121,7 +121,7 @@ public class AwtPaint implements Paint { @Override public void setTextAlign(Align align) { - mAlign = align; + //mAlign = align; } @Override diff --git a/vtm-gdx-html/src/org/oscim/gdx/client/GwtPaint.java b/vtm-gdx-html/src/org/oscim/gdx/client/GwtPaint.java index 8d5aebea..bad031fb 100644 --- a/vtm-gdx-html/src/org/oscim/gdx/client/GwtPaint.java +++ b/vtm-gdx-html/src/org/oscim/gdx/client/GwtPaint.java @@ -16,7 +16,7 @@ public class GwtPaint implements Paint { float fontSize = 12; private FontStyle fontStyle = FontStyle.NORMAL; - private FontFamily fontFamily = FontFamily.DEFAULT; + //private FontFamily fontFamily = FontFamily.DEFAULT; //String font = "12px sans-serif"; String font = "13px Helvetica"; @@ -85,7 +85,7 @@ public class GwtPaint implements Paint { @Override public void setTypeface(FontFamily fontFamily, FontStyle fontStyle) { this.fontStyle = fontStyle; - this.fontFamily = fontFamily; + //this.fontFamily = fontFamily; buildFont(); } diff --git a/vtm-gdx-html/src/org/oscim/gdx/emu/com/badlogic/gdx/backends/gwt/GwtGL20.java b/vtm-gdx-html/src/org/oscim/gdx/emu/com/badlogic/gdx/backends/gwt/GwtGL20.java index 34a232c1..8aaf50ea 100644 --- a/vtm-gdx-html/src/org/oscim/gdx/emu/com/badlogic/gdx/backends/gwt/GwtGL20.java +++ b/vtm-gdx-html/src/org/oscim/gdx/emu/com/badlogic/gdx/backends/gwt/GwtGL20.java @@ -25,7 +25,6 @@ import java.nio.ShortBuffer; import java.util.HashMap; import java.util.Map; -import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.Pixmap; diff --git a/vtm-gdx-html/src/org/oscim/gdx/emu/org/oscim/utils/async/AsyncExecutor.java b/vtm-gdx-html/src/org/oscim/gdx/emu/org/oscim/utils/async/AsyncExecutor.java index 8865a17c..b7143ff7 100644 --- a/vtm-gdx-html/src/org/oscim/gdx/emu/org/oscim/utils/async/AsyncExecutor.java +++ b/vtm-gdx-html/src/org/oscim/gdx/emu/org/oscim/utils/async/AsyncExecutor.java @@ -2,7 +2,6 @@ package org.oscim.utils.async; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.utils.Disposable; -import com.badlogic.gdx.utils.Timer; /** * GWT emulation of AsynchExecutor, will call tasks immediately :D @@ -26,7 +25,7 @@ public class AsyncExecutor implements Disposable { * will be queued. * @param task the task to execute asynchronously */ - @SuppressWarnings("rawtypes") + @SuppressWarnings({ "unchecked", "rawtypes" }) public AsyncResult submit(final AsyncTask task) { T result = null; @@ -37,6 +36,9 @@ public class AsyncExecutor implements Disposable { } catch(Throwable t) { error = true; } + if (error) + return null; + return new AsyncResult(result); } diff --git a/vtm/src/org/oscim/backend/GL20.java b/vtm/src/org/oscim/backend/GL20.java index fdf895cd..8829e523 100644 --- a/vtm/src/org/oscim/backend/GL20.java +++ b/vtm/src/org/oscim/backend/GL20.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2011 See AUTHORS file. + * Copyright 2011 See libgdx AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/vtm/src/org/oscim/layers/tile/vector/BuildingLayer.java b/vtm/src/org/oscim/layers/tile/vector/BuildingLayer.java index 8f78f80c..9aeb0be7 100644 --- a/vtm/src/org/oscim/layers/tile/vector/BuildingLayer.java +++ b/vtm/src/org/oscim/layers/tile/vector/BuildingLayer.java @@ -15,7 +15,6 @@ package org.oscim.layers.tile.vector; import org.oscim.core.MapPosition; -import org.oscim.event.MotionEvent; import org.oscim.layers.Layer; import org.oscim.map.Map; import org.oscim.renderer.ExtrusionRenderer; diff --git a/vtm/src/org/oscim/utils/GeometryUtils.java b/vtm/src/org/oscim/utils/GeometryUtils.java index ab6c9f49..2f265990 100644 --- a/vtm/src/org/oscim/utils/GeometryUtils.java +++ b/vtm/src/org/oscim/utils/GeometryUtils.java @@ -16,10 +16,6 @@ package org.oscim.utils; import org.oscim.core.Point; - -/** - * @author Hannes Janetzek - */ public final class GeometryUtils { /** * Calculates the center of the minimum bounding rectangle for the given diff --git a/vtm/src/org/oscim/utils/Matrix4.java b/vtm/src/org/oscim/utils/Matrix4.java index 02c9985c..0063e7ef 100644 --- a/vtm/src/org/oscim/utils/Matrix4.java +++ b/vtm/src/org/oscim/utils/Matrix4.java @@ -21,7 +21,6 @@ import java.nio.FloatBuffer; import org.oscim.backend.GL20; import org.oscim.backend.GLAdapter; - public class Matrix4 { private static final GL20 GL = GLAdapter.get(); @@ -29,46 +28,6 @@ public class Matrix4 { private final static String TAG = Matrix4.class.getName(); private final static boolean dbg = false; - private native static long alloc(); - - private native static void delete(long self); - - private native static void set(long self, float[] m); - - private native static void copy(long self, long other); - - private native static void identity(long self); - - private native static void get(long self, float[] m); - - private native static void mul(long self, long lhs_ptr); - - private native static void smul(long self, long rhs_ptr, long lhs_ptr); - - private native static void smulrhs(long self, long rhs_ptr); - - private native static void smullhs(long self, long lhs_ptr); - - private native static void strans(long self, long rhs_ptr); - - private native static void prj(long self, float[] vec3); - - private native static void setRotation(long self, float a, float x, float y, float z); - - private native static void setScale(long self, float x, float y, float z); - - private native static void setTranslation(long self, float x, float y, float z); - - private native static void setTransScale(long self, float tx, float ty, float scale); - - //private native static void setAsUniform(long self, int handle); - - private native static void setValueAt(long self, int pos, float value); - - private native static void addDepthOffset(long self, int delta); - - private native static ByteBuffer getBuffer(long self); - private final long pointer; private final FloatBuffer buffer; @@ -247,6 +206,9 @@ public class Matrix4 { identity(pointer); } + /** + * Free native object + * */ @Override public void finalize() { if (pointer != 0) @@ -452,4 +414,43 @@ public class Matrix4 { return true; } + private native static long alloc(); + + private native static void delete(long self); + + private native static void set(long self, float[] m); + + private native static void copy(long self, long other); + + private native static void identity(long self); + + private native static void get(long self, float[] m); + + private native static void mul(long self, long lhs_ptr); + + private native static void smul(long self, long rhs_ptr, long lhs_ptr); + + private native static void smulrhs(long self, long rhs_ptr); + + private native static void smullhs(long self, long lhs_ptr); + + private native static void strans(long self, long rhs_ptr); + + private native static void prj(long self, float[] vec3); + + private native static void setRotation(long self, float a, float x, float y, float z); + + private native static void setScale(long self, float x, float y, float z); + + private native static void setTranslation(long self, float x, float y, float z); + + private native static void setTransScale(long self, float tx, float ty, float scale); + + //private native static void setAsUniform(long self, int handle); + + private native static void setValueAt(long self, int pos, float value); + + private native static void addDepthOffset(long self, int delta); + + private native static ByteBuffer getBuffer(long self); } diff --git a/vtm/src/org/oscim/utils/async/AsyncExecutor.java b/vtm/src/org/oscim/utils/async/AsyncExecutor.java index d0851024..575e7c99 100644 --- a/vtm/src/org/oscim/utils/async/AsyncExecutor.java +++ b/vtm/src/org/oscim/utils/async/AsyncExecutor.java @@ -22,7 +22,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; - /** * Allows asnynchronous execution of {@link AsyncTask} instances on a separate thread. * Needs to be disposed via a call to {@link #dispose()} when no longer used, in which @@ -82,7 +81,6 @@ public class AsyncExecutor { * then destroys any resources like threads. Can not be used * after this method is called. */ - //@Override public void dispose () { executor.shutdown(); try {