cleanups
This commit is contained in:
parent
654ca7c5b8
commit
45b8bf75de
@ -28,7 +28,7 @@ import android.graphics.drawable.Drawable;
|
|||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
|
||||||
public class ItemizedIconOverlay<Item extends OverlayItem> extends ItemizedOverlay<Item> {
|
public class ItemizedIconOverlay<Item extends OverlayItem> extends ItemizedOverlay<Item> {
|
||||||
private static final String TAG = ItemizedIconOverlay.class.getName();
|
//private static final String TAG = ItemizedIconOverlay.class.getName();
|
||||||
|
|
||||||
protected final List<Item> mItemList;
|
protected final List<Item> mItemList;
|
||||||
protected OnItemGestureListener<Item> mOnItemGestureListener;
|
protected OnItemGestureListener<Item> mOnItemGestureListener;
|
||||||
|
|||||||
@ -34,7 +34,7 @@ import android.opengl.GLES20;
|
|||||||
* @author Hannes Janetzek
|
* @author Hannes Janetzek
|
||||||
*/
|
*/
|
||||||
public class TileRenderer {
|
public class TileRenderer {
|
||||||
//private final static String TAG = BaseMap.class.getName();
|
//private final static String TAG = TileRenderer.class.getName();
|
||||||
|
|
||||||
// used to increase polygon-offset for each tile drawn.
|
// used to increase polygon-offset for each tile drawn.
|
||||||
private static int mDrawCnt;
|
private static int mDrawCnt;
|
||||||
|
|||||||
@ -68,11 +68,6 @@ public final class TextLayer extends TextureLayer {
|
|||||||
TextItem it = labels;
|
TextItem it = labels;
|
||||||
|
|
||||||
for (; it != null; it = it.next) {
|
for (; it != null; it = it.next) {
|
||||||
// todo add captions at the end
|
|
||||||
//if (item.text.caption && !it.text.caption)
|
|
||||||
//continue;
|
|
||||||
//if (!item.text.caption && it.text.caption)
|
|
||||||
//continue;
|
|
||||||
|
|
||||||
if (item.text == it.text) {
|
if (item.text == it.text) {
|
||||||
while (it.next != null
|
while (it.next != null
|
||||||
|
|||||||
@ -71,7 +71,7 @@ public class ExtrusionOverlay extends RenderOverlay {
|
|||||||
|
|
||||||
for (int i = 1; i < 2; i++) {
|
for (int i = 1; i < 2; i++) {
|
||||||
// Set up the program for rendering extrusions
|
// Set up the program for rendering extrusions
|
||||||
shaderProgram[i] = GlUtils.createProgram(extrusionVertexShader[i],
|
shaderProgram[i] = GlUtils.createProgram(extrusionVertexShader,
|
||||||
extrusionFragmentShader);
|
extrusionFragmentShader);
|
||||||
if (shaderProgram[i] == 0) {
|
if (shaderProgram[i] == 0) {
|
||||||
Log.e(TAG, "Could not create extrusion shader program. " + i);
|
Log.e(TAG, "Could not create extrusion shader program. " + i);
|
||||||
@ -371,42 +371,8 @@ public class ExtrusionOverlay extends RenderOverlay {
|
|||||||
1.0f,
|
1.0f,
|
||||||
};
|
};
|
||||||
|
|
||||||
final static String[] extrusionVertexShader = {
|
final static String extrusionVertexShader = ""
|
||||||
"precision mediump float;"
|
+ "precision mediump float;"
|
||||||
+ "uniform mat4 u_mvp;"
|
|
||||||
+ "uniform vec4 u_color[4];"
|
|
||||||
+ "uniform int u_mode;"
|
|
||||||
+ "uniform float u_alpha;"
|
|
||||||
+ "attribute vec4 a_pos;"
|
|
||||||
+ "attribute vec2 a_light;"
|
|
||||||
+ "varying vec4 color;"
|
|
||||||
+ "const float ff = 255.0;"
|
|
||||||
+ "float c_alpha = 0.8;"
|
|
||||||
+ "void main() {"
|
|
||||||
+ " gl_Position = u_mvp * a_pos;"
|
|
||||||
+ " if (u_mode == 0)"
|
|
||||||
// roof / depth pass
|
|
||||||
+ " color = u_color[0];"
|
|
||||||
+ " else {"
|
|
||||||
// decrease contrast with distance
|
|
||||||
+ " float z = (0.96 + gl_Position.z * 0.04);"
|
|
||||||
+ " if (u_mode == 1){"
|
|
||||||
// sides 1 - use 0xff00
|
|
||||||
// scale direction to -0.5<>0.5
|
|
||||||
+ " float dir = abs(a_light.y / ff - 0.5);"
|
|
||||||
+ " color = u_color[1] * z;"
|
|
||||||
+ " color.rgb *= (0.7 + dir * 0.4);"
|
|
||||||
+ " } else if (u_mode == 2){"
|
|
||||||
// sides 2 - use 0x00ff
|
|
||||||
+ " float dir = abs(a_light.x / ff - 0.5);"
|
|
||||||
+ " color = u_color[2] * z;"
|
|
||||||
+ " color.rgb *= (0.7 + dir * 0.4);"
|
|
||||||
+ " } else"
|
|
||||||
// outline
|
|
||||||
+ " color = u_color[3] * z;"
|
|
||||||
+ "}}",
|
|
||||||
|
|
||||||
"precision mediump float;"
|
|
||||||
+ "uniform mat4 u_mvp;"
|
+ "uniform mat4 u_mvp;"
|
||||||
+ "uniform vec4 u_color[4];"
|
+ "uniform vec4 u_color[4];"
|
||||||
+ "uniform int u_mode;"
|
+ "uniform int u_mode;"
|
||||||
@ -444,8 +410,7 @@ public class ExtrusionOverlay extends RenderOverlay {
|
|||||||
// outline
|
// outline
|
||||||
+ " float z = (0.8 - gl_Position.z * 0.2);"
|
+ " float z = (0.8 - gl_Position.z * 0.2);"
|
||||||
+ " color = u_color[3] * z;"
|
+ " color = u_color[3] * z;"
|
||||||
+ "}}}"
|
+ "}}}";
|
||||||
};
|
|
||||||
|
|
||||||
final static String extrusionFragmentShader = ""
|
final static String extrusionFragmentShader = ""
|
||||||
+ "precision mediump float;"
|
+ "precision mediump float;"
|
||||||
|
|||||||
@ -194,7 +194,7 @@ public final class GeometryUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
double ua = ua_numr / denr;
|
double ua = ua_numr / denr;
|
||||||
double ub = ub_numr / denr;
|
//double ub = ub_numr / denr;
|
||||||
|
|
||||||
//if (ua >= 0.0 && ua <= 1.0 && ub >= 0.0 && ub <= 1.0)
|
//if (ua >= 0.0 && ua <= 1.0 && ub >= 0.0 && ub <= 1.0)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user