cleanups
This commit is contained in:
parent
8bcc3b6b3f
commit
3d8f62ec4a
@ -202,7 +202,14 @@ public final class WayDecorator {
|
||||
continue;
|
||||
}
|
||||
|
||||
float s = (wayNameWidth + 20) / segmentLength;
|
||||
//float s = (wayNameWidth + 20) / segmentLength;
|
||||
float s;
|
||||
|
||||
//if (wayNameWidth < segmentLength)
|
||||
// s = (segmentLength - 10) / segmentLength;
|
||||
//else
|
||||
s = (wayNameWidth + 20) / segmentLength;
|
||||
|
||||
float width, height;
|
||||
float x1, y1, x2, y2;
|
||||
|
||||
@ -229,39 +236,6 @@ public final class WayDecorator {
|
||||
y2 = y2 - (height - s * height);
|
||||
y1 = y1 + (height - s * height);
|
||||
|
||||
// short top = (short) (y1 < y2 ? y1 : y2);
|
||||
// short bot = (short) (y1 < y2 ? y2 : y1);
|
||||
// boolean intersects = false;
|
||||
//
|
||||
// for (TextItem t2 = items; t2 != null; t2 = t2.next) {
|
||||
//
|
||||
// // check crossings
|
||||
// if (GeometryUtils.lineIntersect(x1, y1, x2, y2, t2.x1, t2.y1,
|
||||
// t2.x2, t2.y2)) {
|
||||
// intersects = true;
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// // check overlapping labels of road with more than one
|
||||
// // way
|
||||
// short top2 = t2.y1 < t2.y2 ? t2.y1 : t2.y2;
|
||||
// short bot2 = t2.y1 < t2.y2 ? t2.y2 : t2.y1;
|
||||
//
|
||||
// if (x1 - 10 < t2.x2 && t2.x1 - 10 < x2 && top - 10 < bot2
|
||||
// && top2 - 10 < bot) {
|
||||
//
|
||||
// if (t2.string.equals(string)) {
|
||||
// intersects = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (intersects) {
|
||||
// previousX = (int) coordinates[pos + i];
|
||||
// previousY = (int) coordinates[pos + i + 1];
|
||||
// continue;
|
||||
// }
|
||||
TextItem n = TextItem.get();
|
||||
|
||||
// link items together
|
||||
|
@ -32,7 +32,7 @@ import android.util.Log;
|
||||
/**
|
||||
* @author Hannes Janetzek
|
||||
* FIXME check if polygon has self intersections or 0/180 degree
|
||||
* angles!
|
||||
* angles! or bad things might happen in Triangle
|
||||
*/
|
||||
public class ExtrusionLayer extends Layer {
|
||||
private final static String TAG = ExtrusionLayer.class.getName();
|
||||
@ -350,12 +350,6 @@ public class ExtrusionLayer extends Layer {
|
||||
if (mNumVertices == 0 || compiled)
|
||||
return;
|
||||
|
||||
// mVboIds = new int[2];
|
||||
// GLES20.glGenBuffers(2, mVboIds, 0);
|
||||
// mIndicesBufferID = mVboIds[0];
|
||||
// mVertexBufferID = mVboIds[1];
|
||||
|
||||
// FIXME add in_gl_thread param to make sure we get something here
|
||||
mVertexBO = BufferObject.get(0);
|
||||
mIndiceBO = BufferObject.get(0);
|
||||
mIndicesBufferID = mIndiceBO.id;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012 Hannes Janetzek
|
||||
* Copyright 2013 OpenScienceMap
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General License as published by the Free Software
|
||||
@ -21,6 +21,9 @@ import org.oscim.view.MapView;
|
||||
|
||||
import android.graphics.Paint.Cap;
|
||||
|
||||
/**
|
||||
* @author Hannes Janetzek
|
||||
*/
|
||||
public final class LineLayer extends Layer {
|
||||
|
||||
private static final float COORD_SCALE = GLRenderer.COORD_MULTIPLIER;
|
||||
@ -77,9 +80,8 @@ public final class LineLayer extends Layer {
|
||||
else if (line.cap == Cap.SQUARE)
|
||||
squared = true;
|
||||
|
||||
if (pool == null) {
|
||||
pool = curItem = VertexPool.get();
|
||||
}
|
||||
if (pool == null)
|
||||
curItem = pool = VertexPool.get();
|
||||
|
||||
VertexPoolItem si = curItem;
|
||||
short v[] = si.vertices;
|
||||
|
@ -83,20 +83,9 @@ public final class SymbolLayer extends TextureLayer {
|
||||
symbols = item;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// void compile(ShortBuffer sbuf) {
|
||||
// if (TextureRenderer.debug)
|
||||
// Log.d("...", "compile");
|
||||
//
|
||||
// for (TextureObject to = textures; to != null; to = to.next)
|
||||
// TextureObject.uploadTexture(to);
|
||||
//
|
||||
// Layers.addPoolItems(this, sbuf);
|
||||
// }
|
||||
|
||||
private final static int LBIT_MASK = 0xfffffffe;
|
||||
|
||||
// TODO ... reuse texture when only symbol position changed
|
||||
// TODO reuse texture when only symbol position changed
|
||||
@Override
|
||||
public boolean prepare() {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012 Hannes Janetzek
|
||||
* Copyright 2013 OpenScienceMap
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
@ -39,6 +39,9 @@ import android.opengl.Matrix;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
/**
|
||||
* @author Hannes Janetzek
|
||||
*/
|
||||
public class TextOverlay extends RenderOverlay {
|
||||
private final static String TAG = TextOverlay.class.getName();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user