diff --git a/src/org/oscim/generator/JobQueue.java b/src/org/oscim/generator/JobQueue.java index bfdb73e7..bad5f8d3 100644 --- a/src/org/oscim/generator/JobQueue.java +++ b/src/org/oscim/generator/JobQueue.java @@ -1,5 +1,6 @@ /* * Copyright 2010, 2011, 2012 mapsforge.org + * Copyright 2012, 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 @@ -14,7 +15,8 @@ */ package org.oscim.generator; -//import static org.oscim.view.mapgenerator.JobTile.LOADING; +import static org.oscim.generator.JobTile.STATE_LOADING; +import static org.oscim.generator.JobTile.STATE_NONE; import java.util.ArrayList; import java.util.PriorityQueue; @@ -41,8 +43,7 @@ public class JobQueue { for (int i = 0, n = tiles.size(); i < n; i++) { JobTile tile = tiles.get(i); - //tile.isLoading = true; - tile.state = JobTile.STATE_LOADING; + tile.state = STATE_LOADING; mPriorityQueue.offer(tile); } } @@ -53,8 +54,7 @@ public class JobQueue { public synchronized void clear() { JobTile t; while ((t = mPriorityQueue.poll()) != null) - t.state = JobTile.STATE_NONE; - //t.isLoading = false; + t.state = STATE_NONE; mPriorityQueue.clear(); } diff --git a/src/org/oscim/generator/JobTile.java b/src/org/oscim/generator/JobTile.java index a535b727..97a1edca 100644 --- a/src/org/oscim/generator/JobTile.java +++ b/src/org/oscim/generator/JobTile.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 Hannes Janetzek + * Copyright 2012, 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 @@ -19,21 +19,16 @@ import org.oscim.core.Tile; import android.util.Log; /** - * + * @author Hannes Janetzek */ public class JobTile extends Tile implements Comparable { private final static String TAG = JobTile.class.getName(); - // public final static int LOADING = 1; - // public final static int NEWDATA = 1 << 1; - // public final static int READY = 1 << 2; - // public final static int AVAILABLE = 1 << 1 | 1 << 2; - // public final static int CANCELED = 1 << 3; - // public int state; public final static int STATE_NONE = 0; public final static int STATE_LOADING = 1 << 0; public final static int STATE_NEW_DATA = 1 << 1; public final static int STATE_READY = 1 << 2; + public final static int STATE_ERROR = 1 << 3; public void clearState() { state = STATE_NONE; @@ -46,14 +41,10 @@ public class JobTile extends Tile implements Comparable { state = STATE_LOADING; } - /** - * tile is in JobQueue - */ - //public boolean isLoading; public byte state; /** - * distance from map center. + * distance from map center */ public float distance; diff --git a/src/org/oscim/generator/MapWorker.java b/src/org/oscim/generator/MapWorker.java index 2456246d..0f50f7d8 100644 --- a/src/org/oscim/generator/MapWorker.java +++ b/src/org/oscim/generator/MapWorker.java @@ -14,7 +14,6 @@ */ package org.oscim.generator; -import org.oscim.renderer.TileGenerator; import org.oscim.renderer.TileManager; import org.oscim.utils.PausableThread; diff --git a/src/org/oscim/renderer/TileGenerator.java b/src/org/oscim/generator/TileGenerator.java similarity index 98% rename from src/org/oscim/renderer/TileGenerator.java rename to src/org/oscim/generator/TileGenerator.java index f398e805..21d9ce16 100644 --- a/src/org/oscim/renderer/TileGenerator.java +++ b/src/org/oscim/generator/TileGenerator.java @@ -12,7 +12,7 @@ * You should have received a copy of the GNU Lesser General Public License along with * this program. If not, see . */ -package org.oscim.renderer; +package org.oscim.generator; import static org.oscim.generator.JobTile.STATE_NONE; @@ -23,7 +23,8 @@ import org.oscim.core.WebMercator; import org.oscim.database.IMapDatabase; import org.oscim.database.IMapDatabaseCallback; import org.oscim.database.QueryResult; -import org.oscim.generator.JobTile; +import org.oscim.renderer.MapTile; +import org.oscim.renderer.WayDecorator; import org.oscim.renderer.layer.Layer; import org.oscim.renderer.layer.Layers; import org.oscim.renderer.layer.LineLayer; @@ -55,8 +56,8 @@ public class TileGenerator implements IRenderCallback, IMapDatabaseCallback { private static final double STROKE_INCREASE = Math.sqrt(2); private static final byte LAYERS = 11; - static final byte STROKE_MIN_ZOOM_LEVEL = 12; - static final byte STROKE_MAX_ZOOM_LEVEL = 17; + public static final byte STROKE_MIN_ZOOM_LEVEL = 12; + public static final byte STROKE_MAX_ZOOM_LEVEL = 17; private static RenderTheme renderTheme; diff --git a/src/org/oscim/renderer/GLRenderer.java b/src/org/oscim/renderer/GLRenderer.java index 9324a134..42c270f7 100644 --- a/src/org/oscim/renderer/GLRenderer.java +++ b/src/org/oscim/renderer/GLRenderer.java @@ -233,8 +233,8 @@ public class GLRenderer implements GLSurfaceView.Renderer { // use multiple buffers to avoid overwriting buffer while current // data is uploaded (or rather the blocking which is probably done to // avoid overwriting) - int curBuffer = uploadCnt % rotateBuffers; - uploadCnt++; + int curBuffer = uploadCnt++ % rotateBuffers; + //uploadCnt++; ShortBuffer sbuf = shortBuffer[curBuffer]; diff --git a/src/org/oscim/renderer/LineRenderer.java b/src/org/oscim/renderer/LineRenderer.java index 29fc2044..5ad454e5 100644 --- a/src/org/oscim/renderer/LineRenderer.java +++ b/src/org/oscim/renderer/LineRenderer.java @@ -26,6 +26,7 @@ import static android.opengl.GLES20.glUseProgram; import static android.opengl.GLES20.glVertexAttribPointer; import org.oscim.core.MapPosition; +import org.oscim.generator.TileGenerator; import org.oscim.renderer.layer.Layer; import org.oscim.renderer.layer.LineLayer; import org.oscim.theme.renderinstruction.Line; diff --git a/src/org/oscim/renderer/MapTile.java b/src/org/oscim/renderer/MapTile.java index 8409c93d..ff827c58 100644 --- a/src/org/oscim/renderer/MapTile.java +++ b/src/org/oscim/renderer/MapTile.java @@ -32,7 +32,7 @@ public final class MapTile extends JobTile { * Tile data set by TileGenerator: */ public TextItem labels; - Layers layers; + public Layers layers; /** * tile has new data to upload to gl diff --git a/src/org/oscim/view/MapView.java b/src/org/oscim/view/MapView.java index 904296b3..388cc88c 100644 --- a/src/org/oscim/view/MapView.java +++ b/src/org/oscim/view/MapView.java @@ -37,15 +37,15 @@ import org.oscim.database.OpenResult; import org.oscim.generator.JobQueue; import org.oscim.generator.JobTile; import org.oscim.generator.MapWorker; +import org.oscim.generator.TileGenerator; import org.oscim.overlay.GenericOverlay; import org.oscim.overlay.LabelingOverlay; import org.oscim.overlay.Overlay; import org.oscim.overlay.OverlayManager; import org.oscim.renderer.GLRenderer; import org.oscim.renderer.GLView; -import org.oscim.renderer.TileGenerator; import org.oscim.renderer.TileManager; -import org.oscim.renderer.overlays.ModelOverlay; +import org.oscim.renderer.overlays.BuildingOverlay; import org.oscim.theme.ExternalRenderTheme; import org.oscim.theme.InternalRenderTheme; import org.oscim.theme.RenderTheme; @@ -186,7 +186,7 @@ public class MapView extends RelativeLayout { mOverlayManager.add(new LabelingOverlay(this)); //mOverlayManager.add(new GenericOverlay(this, new GridOverlay(this))); - mOverlayManager.add(new GenericOverlay(this, new ModelOverlay(this))); + mOverlayManager.add(new GenericOverlay(this, new BuildingOverlay(this))); // mOverlayManager.add(new GenericOverlay(this, new TestOverlay(this))); diff --git a/src/org/oscim/view/MapZoomControls.java b/src/org/oscim/view/MapZoomControls.java index 83b1322f..17b8768c 100644 --- a/src/org/oscim/view/MapZoomControls.java +++ b/src/org/oscim/view/MapZoomControls.java @@ -14,7 +14,7 @@ */ package org.oscim.view; -import org.oscim.renderer.TileGenerator; +import org.oscim.generator.TileGenerator; import android.content.Context; import android.os.Handler;