fix warnings, cleanups

This commit is contained in:
Hannes Janetzek 2013-09-17 22:43:53 +02:00
parent 1421a1f6b6
commit e5761ef601
10 changed files with 51 additions and 57 deletions
vtm-gdx-desktop/src/org/oscim/awt
vtm-gdx-html/src/org/oscim/gdx
client
emu
com/badlogic/gdx/backends/gwt
org/oscim/utils/async
vtm/src/org/oscim

@ -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;

@ -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

@ -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();
}

@ -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;

@ -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 <T> AsyncResult<T> submit(final AsyncTask<T> 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);
}

@ -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.

@ -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;

@ -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

@ -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);
}

@ -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 {