diff --git a/vtm-desktop/src/org/oscim/gdx/GdxMapApp.java b/vtm-desktop/src/org/oscim/gdx/GdxMapApp.java index 9d98d46f0..01aa21a13 100644 --- a/vtm-desktop/src/org/oscim/gdx/GdxMapApp.java +++ b/vtm-desktop/src/org/oscim/gdx/GdxMapApp.java @@ -23,6 +23,8 @@ import org.oscim.tiling.TileSource; import org.oscim.tiling.source.oscimap4.OSciMap4TileSource; import org.oscim.utils.FastMath; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.badlogic.gdx.backends.jglfw.JglfwApplication; import com.badlogic.gdx.backends.jglfw.JglfwApplicationConfiguration; @@ -31,6 +33,8 @@ public class GdxMapApp extends GdxMap { + public static final Logger log = LoggerFactory.getLogger(GdxMapApp.class); + static class GdxGL20Wrapper extends JglfwGL20 implements GL20 { } diff --git a/vtm-playground/src/org/oscim/test/HairLineTest.java b/vtm-playground/src/org/oscim/test/HairLineTest.java index 7cfdcc969..7c90a2b31 100644 --- a/vtm-playground/src/org/oscim/test/HairLineTest.java +++ b/vtm-playground/src/org/oscim/test/HairLineTest.java @@ -54,13 +54,13 @@ static class Renderer extends BucketRenderer { .build()); @Override - protected boolean setup() { + public boolean setup() { //ll.roundCap = true; return super.setup(); } @Override - protected void update(GLViewport v) { + public void update(GLViewport v) { if (!init) { mMapPosition.copy(v.pos); init = true; diff --git a/vtm-playground/src/org/oscim/test/LineRenderTest.java b/vtm-playground/src/org/oscim/test/LineRenderTest.java index 5011e5a11..33734973e 100644 --- a/vtm-playground/src/org/oscim/test/LineRenderTest.java +++ b/vtm-playground/src/org/oscim/test/LineRenderTest.java @@ -185,7 +185,7 @@ public synchronized void clear() { } @Override - protected synchronized void update(GLViewport v) { + public synchronized void update(GLViewport v) { if (mMapPosition.scale == 0) mMapPosition.copy(v.pos); diff --git a/vtm-playground/src/org/oscim/test/LineTest.java b/vtm-playground/src/org/oscim/test/LineTest.java index fe82ee15e..f29141e24 100644 --- a/vtm-playground/src/org/oscim/test/LineTest.java +++ b/vtm-playground/src/org/oscim/test/LineTest.java @@ -42,12 +42,12 @@ protected void createLayers() { boolean init; LineBucket ll = buckets.addLineBucket(0, - new LineStyle(Color.fade(Color.CYAN, 0.5f), 1.5f)); + new LineStyle(Color.fade(Color.CYAN, 0.5f), 1.5f)); GeometryBuffer g = new GeometryBuffer(10, 1); @Override - protected void update(GLViewport v) { + public void update(GLViewport v) { if (!init) { mMapPosition.copy(v.pos); init = true; @@ -82,13 +82,13 @@ protected void update(GLViewport v) { buckets.clear(); buckets.set(ll); g.clear(); - for (int i = 0; i < 60; i++) { - g.startLine(); - g.addPoint(-1, 0); - g.addPoint(0, 0); - g.addPoint((float) Math.cos(Math.toRadians(angle)), - (float) Math.sin(Math.toRadians(angle))); - } + //for (int i = 0; i < 60; i++) { + g.startLine(); + g.addPoint(-1, 0); + g.addPoint(0, 0); + g.addPoint((float) Math.cos(Math.toRadians(angle)), + (float) Math.sin(Math.toRadians(angle))); + //} g.scale(100, 100); diff --git a/vtm-playground/src/org/oscim/test/MapTest.java b/vtm-playground/src/org/oscim/test/MapTest.java index fc043900d..de5029329 100644 --- a/vtm-playground/src/org/oscim/test/MapTest.java +++ b/vtm-playground/src/org/oscim/test/MapTest.java @@ -1,29 +1,26 @@ package org.oscim.test; -import org.oscim.gdx.GdxMap; import org.oscim.gdx.GdxMapApp; import org.oscim.layers.tile.buildings.BuildingLayer; import org.oscim.layers.tile.vector.VectorTileLayer; import org.oscim.layers.tile.vector.labeling.LabelLayer; +import org.oscim.map.Map; import org.oscim.theme.VtmThemes; import org.oscim.tiling.source.oscimap4.OSciMap4TileSource; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -public class MapTest extends GdxMap { - - final Logger log = LoggerFactory.getLogger(MeshTest.class); +public class MapTest extends GdxMapApp { @Override public void createLayers() { + Map map = getMap(); - VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource()); - mMap.setTheme(VtmThemes.DEFAULT); - mMap.layers().add(new BuildingLayer(mMap, l)); - mMap.layers().add(new LabelLayer(mMap, l)); + VectorTileLayer l = map.setBaseMap(new OSciMap4TileSource()); - mMap.setMapPosition(53.08, 8.82, 1 << 17); + map.layers().add(new BuildingLayer(map, l)); + map.layers().add(new LabelLayer(map, l)); + map.setTheme(VtmThemes.DEFAULT); + map.setMapPosition(53.075, 8.808, 1 << 17); } public static void main(String[] args) { diff --git a/vtm-playground/src/org/oscim/test/MeshTest.java b/vtm-playground/src/org/oscim/test/MeshTest.java deleted file mode 100644 index 271354891..000000000 --- a/vtm-playground/src/org/oscim/test/MeshTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.oscim.test; - -import static org.oscim.tiling.source.bitmap.DefaultSources.STAMEN_TONER; - -import org.oscim.gdx.GdxMapApp; -import org.oscim.layers.tile.bitmap.BitmapTileLayer; -import org.oscim.layers.tile.buildings.S3DBLayer; -import org.oscim.tiling.TileSource; -import org.oscim.tiling.source.oscimap4.OSciMap4TileSource; - -public class MeshTest extends GdxMapApp { - - @Override - public void createLayers() { - //MapRenderer.setBackgroundColor(0xf0f0f0); - - //VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource()); - //mMap.setTheme(VtmThemes.DEFAULT); - - mMap.setBaseMap(new BitmapTileLayer(mMap, STAMEN_TONER.build())); - - TileSource ts = new OSciMap4TileSource("http://opensciencemap.org/tiles/s3db"); - S3DBLayer tl = new S3DBLayer(mMap, ts); - - //BuildingLayer tl = new BuildingLayer(mMap, l); - - //OffscreenRenderer or = new OffscreenRenderer(mMap.getWidth(), - // mMap.getHeight()); - //or.setRenderer(tl.getRenderer()); - - mMap.layers().add(tl); - - //mMap.layers().add(new GenericLayer(mMap, or)); - - //mMap.layers().add(new LabelLayer(mMap, l)); - - //mMap.setMapPosition(7.707, 81.689, 1 << 17); - - mMap.setMapPosition(53.08, 8.82, 1 << 17); - - } - - public static void main(String[] args) { - init(); - run(new MeshTest(), null, 400); - } -} diff --git a/vtm-playground/src/org/oscim/test/S3DBLayerTest.java b/vtm-playground/src/org/oscim/test/S3DBLayerTest.java new file mode 100644 index 000000000..c26381c62 --- /dev/null +++ b/vtm-playground/src/org/oscim/test/S3DBLayerTest.java @@ -0,0 +1,36 @@ +package org.oscim.test; + +import org.oscim.gdx.GdxMapApp; +import org.oscim.layers.tile.bitmap.BitmapTileLayer; +import org.oscim.layers.tile.buildings.S3DBLayer; +import org.oscim.tiling.TileSource; +import org.oscim.tiling.source.bitmap.DefaultSources; +import org.oscim.tiling.source.oscimap4.OSciMap4TileSource; + +public class S3DBLayerTest extends GdxMapApp { + + @Override + public void createLayers() { + + //VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource()); + //mMap.setTheme(VtmThemes.DEFAULT); + + mMap.setBaseMap(new BitmapTileLayer(mMap, DefaultSources.STAMEN_TONER.build())); + + TileSource ts = OSciMap4TileSource + .builder() + .url("http://opensciencemap.org/tiles/s3db") + .build(); + + S3DBLayer tl = new S3DBLayer(mMap, ts); + mMap.layers().add(tl); + + mMap.setMapPosition(53.08, 8.82, 1 << 17); + + } + + public static void main(String[] args) { + init(); + run(new S3DBLayerTest(), null, 400); + } +} diff --git a/vtm-playground/src/org/oscim/test/TessellatorTest.java b/vtm-playground/src/org/oscim/test/TessellatorTest.java deleted file mode 100644 index e2baaa77b..000000000 --- a/vtm-playground/src/org/oscim/test/TessellatorTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.oscim.test; - -import static java.lang.System.out; - -import java.util.Arrays; - -import org.oscim.core.GeometryBuffer; -import org.oscim.core.Tile; -import org.oscim.utils.Tessellator; - -import com.badlogic.gdx.utils.SharedLibraryLoader; - -public class TessellatorTest extends Tessellator{ - - public static void main(String[] args) { - new SharedLibraryLoader().load("vtm-jni"); - - GeometryBuffer e = new GeometryBuffer(128, 3); - - int size = Tile.SIZE; - - float x1 = -1; - float y1 = -1; - float x2 = size + 1; - float y2 = size + 1; - - // always clear geometry before starting - // a different type. - e.clear(); - e.startPolygon(); - e.addPoint(x1, y1); - e.addPoint(x2, y1); - e.addPoint(x2, y2); - e.addPoint(x1, y2); - - y1 = 5; - y2 = size - 5; - x1 = 5; - x2 = size - 5; - - e.startHole(); - e.addPoint(x1, y1); - e.addPoint(x2, y1); - e.addPoint(x2, y2); - e.addPoint(x1, y2); - - addMesh(e); - } - - static void addMesh(GeometryBuffer geom) { - int numRings = 2; - int[] result = new int[2]; - - long ctx = Tessellator.tessellate(geom.points, 0, geom.index, 0, numRings, result); - out.println("ok" + Arrays.toString(result)); - - short[] coordinates = new short[100]; - - while (Tessellator.tessGetVertices(ctx, coordinates, 2) > 0) { - out.println(Arrays.toString(coordinates)); - } - - while (Tessellator.tessGetIndices(ctx, coordinates) > 0) { - out.println(Arrays.toString(coordinates)); - } - - Tessellator.tessFinish(ctx); - } - -} diff --git a/vtm-playground/src/org/oscim/test/ThemeBuilderTest.java b/vtm-playground/src/org/oscim/test/ThemeBuilderTest.java index 1605fa76e..99052273c 100644 --- a/vtm-playground/src/org/oscim/test/ThemeBuilderTest.java +++ b/vtm-playground/src/org/oscim/test/ThemeBuilderTest.java @@ -13,7 +13,7 @@ public class ThemeBuilderTest extends GdxMap { - final Logger log = LoggerFactory.getLogger(MeshTest.class); + final Logger log = LoggerFactory.getLogger(S3DBLayerTest.class); static class MyTheme extends ThemeBuilder { public MyTheme() { diff --git a/vtm-playground/src/org/oscim/test/TileRenderTest.java b/vtm-playground/src/org/oscim/test/TileRenderTest.java index 14affa1d7..7d61304a1 100644 --- a/vtm-playground/src/org/oscim/test/TileRenderTest.java +++ b/vtm-playground/src/org/oscim/test/TileRenderTest.java @@ -1,36 +1,44 @@ package org.oscim.test; -import static org.oscim.tiling.source.bitmap.DefaultSources.STAMEN_TONER; - +import org.oscim.backend.canvas.Color; +import org.oscim.core.GeometryBuffer.GeometryType; +import org.oscim.core.MapElement; +import org.oscim.core.MapPosition; import org.oscim.core.MercatorProjection; -import org.oscim.gdx.GdxMap; +import org.oscim.event.Event; import org.oscim.gdx.GdxMapApp; +import org.oscim.layers.TileGridLayer; import org.oscim.layers.tile.MapTile; import org.oscim.layers.tile.MapTile.TileNode; import org.oscim.layers.tile.TileLoader; import org.oscim.layers.tile.TileManager; import org.oscim.layers.tile.TileSet; import org.oscim.layers.tile.VectorTileRenderer; -import org.oscim.layers.tile.bitmap.BitmapTileLayer; import org.oscim.layers.tile.vector.VectorTileLayer; import org.oscim.layers.tile.vector.VectorTileLoader; +import org.oscim.layers.tile.vector.labeling.LabelLayer; +import org.oscim.map.Map; import org.oscim.renderer.MapRenderer; -import org.oscim.theme.DebugTheme; +import org.oscim.theme.VtmThemes; import org.oscim.tiling.TileSource; import org.oscim.tiling.source.oscimap4.OSciMap4TileSource; -public class TileRenderTest extends GdxMap { +public class TileRenderTest extends GdxMapApp { static boolean loadOneTile = true; - static int tileX = 34365 >> 2; - static int tileY = 21333 >> 2; + // static int tileX = 34365 >> 2; + // static int tileY = 21333 >> 2; + // static byte tileZ = 14; + + static int tileX = 68747 >> 3; + static int tileY = 42648 >> 3; static byte tileZ = 14; @Override public void createLayers() { - final TileManager tileManager; - MapRenderer.setBackgroundColor(0xff888888); + mMap.layers().add(new TileGridLayer(mMap, Color.LTGRAY, 1.2f, 1)); + MapTile tile = new MapTile(null, tileX, tileY, tileZ); double w = 1.0 / (1 << tile.zoomLevel); @@ -38,90 +46,156 @@ public void createLayers() { double maxLon = MercatorProjection.toLongitude(tile.x + w); double minLat = MercatorProjection.toLatitude(tile.y + w); double maxLat = MercatorProjection.toLatitude(tile.y); + double lat = minLat + (maxLat - minLat) / 2; + double lon = minLon + (maxLon - minLon) / 2; - mMap.setMapPosition(minLat + (maxLat - minLat) / 2, minLon - + (maxLon - minLon) / 2, 1 << tile.zoomLevel); + MapPosition mapPosition = new MapPosition(lat, lon, 1 << tile.zoomLevel); - // mMap.setMapPosition(53.0521, 8.7951, 1 << 15); + mMap.setMapPosition(mapPosition); - if (loadOneTile) { + final TileManager tileManager; + if (loadOneTile) { tile = new MapTile(new TileNode(), tileX, tileY, tileZ); - // setup tile quad-tree, expected for locking - // tile.node= new ; + /* setup tile quad-tree, expected for locking */ tile.node.parent = tile.node; tile.node.parent.parent = tile.node; - // setup TileSet contatining one tile + /* setup TileSet contatining one tile */ final TileSet tiles = new TileSet(); tiles.cnt = 1; tiles.tiles[0] = tile; tiles.lockTiles(); - tileManager = new TileManager(mMap, 0, 32, 100) { - @Override - public boolean getActiveTiles(TileSet tileSet) { - if (tileSet == null) - tileSet = new TileSet(1); - - tileSet.setTiles(tiles); - return true; - } - - @Override - public void releaseTiles(TileSet tileSet) { - tileSet.releaseTiles(); - } - }; + tileManager = new TestTileManager(mMap, tiles); } else { - // create TileManager and calculate tiles for current position + /* create TileManager and calculate tiles for current position */ tileManager = new TileManager(mMap, 0, 32, 100); - tileManager.init(); - tileManager.update(mMap.getMapPosition()); } - final VectorTileLoader[] tileLoader = { null }; - - VectorTileLayer l = new VectorTileLayer(mMap, tileManager, - new VectorTileRenderer()) { - protected TileLoader createLoader() { - tileLoader[0] = new VectorTileLoader(this) { + /* get the loader created by VectorTileLayer ... */ + final TestTileLoader[] tileLoader = { null }; - public boolean loadTile(MapTile tile) { - mTile = tile; - return super.loadTile(tile); - } - }; - return tileLoader[0]; - }; - }; + TestVectorTileLayer tileLayer = new TestVectorTileLayer(mMap, tileManager); + tileLoader[0] = tileLayer.getTileLoader(); TileSource tileSource = new OSciMap4TileSource(); + //TileSource tileSource = new TestTileSource(); + + tileLayer.setTileSource(tileSource); + + //IRenderTheme theme = ThemeLoader.load(VtmThemes.OSMARENDER); + //tileLayer.setRenderTheme(theme); + //tileLayer.setRenderTheme(new DebugTheme()); - l.setTileSource(tileSource); + /* need to create the labellayer here to get the tileloaded event */ + LabelLayer labelLayer = new LabelLayer(mMap, tileLayer); - //IRenderTheme theme = ThemeLoader.load(VtmThemes.TRONRENDER); - //l.setRenderTheme(theme); - l.setRenderTheme(new DebugTheme()); + //mMap.layers().add(tileLayer); + mMap.setBaseMap(tileLayer); + mMap.setTheme(VtmThemes.DEFAULT); + log.debug("load tiles:"); if (loadOneTile) { + log.debug("load {}", tile); + tileLoader[0].loadTile(tile); tileManager.jobCompleted(tile, true); } else { - MapTile t; - while ((t = tileManager.getTileJob()) != null) { + tileManager.update(mapPosition); + MapTile t = tileManager.getTileJob(); + while (t != null) { + log.debug("load {}", t); + tileLoader[0].loadTile(t); tileManager.jobCompleted(t, true); + + t = tileManager.getTileJob(); } } - mMap.setBaseMap(new BitmapTileLayer(mMap, STAMEN_TONER.build())); + mMap.layers().add(labelLayer); + + MapRenderer.setBackgroundColor(0xff888888); + } + + static class TestTileLoader extends VectorTileLoader { + + public TestTileLoader(VectorTileLayer tileLayer) { + super(tileLayer); + } + + @Override + public boolean loadTile(MapTile tile) { + mTile = tile; + return super.loadTile(tile); + } + + @Override + public void process(MapElement element) { + /* ignore polygons for testing */ + if (element.type != GeometryType.LINE) + return; - mMap.layers().add(l); + if (element.tags.containsKey("name")) + super.process(element); + } + } + + static class TestVectorTileLayer extends VectorTileLayer { + final VectorTileLoader[] tileLoader = { null }; + + public TestVectorTileLayer(Map map, TileManager tileManager) { + super(map, tileManager, new VectorTileRenderer()); + } + + TestTileLoader getTileLoader() { + return (TestTileLoader) mTileLoader[0]; + } + + @Override + protected int getNumLoaders() { + return 1; + } + + @Override + protected void initLoader(int numLoaders) { + mTileLoader = new TileLoader[numLoaders]; + for (int i = 0; i < numLoaders; i++) { + mTileLoader[i] = new TestTileLoader(this); + } + } + + @Override + public void onMapEvent(Event event, MapPosition mapPosition) { + /* ignore map events */ + if (event != Map.CLEAR_EVENT) + return; + + //super.onMapEvent(event, mapPosition); + } + } + + static class TestTileManager extends TileManager { + TileSet fixedTiles; + + public TestTileManager(Map map, TileSet fixedTiles) { + super(map, 0, 30, 100); + this.fixedTiles = fixedTiles; + } + + @Override + public boolean getActiveTiles(TileSet tileSet) { + if (tileSet == null) + tileSet = new TileSet(fixedTiles.cnt); + + tileSet.setTiles(fixedTiles); + return true; + } } public static void main(String[] args) { GdxMapApp.init(); - GdxMapApp.run(new TileRenderTest(), null, 256); + GdxMapApp.run(new TileRenderTest(), null, 512); } } diff --git a/vtm-playground/src/org/oscim/test/gdx/poi3d/GdxModelRenderer.java b/vtm-playground/src/org/oscim/test/gdx/poi3d/GdxModelRenderer.java index 8f0b9272c..a3ea0acf2 100644 --- a/vtm-playground/src/org/oscim/test/gdx/poi3d/GdxModelRenderer.java +++ b/vtm-playground/src/org/oscim/test/gdx/poi3d/GdxModelRenderer.java @@ -46,7 +46,7 @@ public GdxModelRenderer(Map map) { } @Override - protected boolean setup() { + public boolean setup() { modelBatch = new ModelBatch(new DefaultShaderProvider()); @@ -67,7 +67,7 @@ protected boolean setup() { } @Override - protected synchronized void update(GLViewport v) { + public synchronized void update(GLViewport v) { // if (loading && assets.update()) // doneLoading(); @@ -87,7 +87,7 @@ protected synchronized void update(GLViewport v) { Renderable r = new Renderable(); @Override - protected void render(GLViewport v) { + public void render(GLViewport v) { if (instances.size == 0) return; diff --git a/vtm-playground/src/org/oscim/test/gdx/poi3d/GdxRenderer3D.java b/vtm-playground/src/org/oscim/test/gdx/poi3d/GdxRenderer3D.java index 6f743c17f..5e858d068 100644 --- a/vtm-playground/src/org/oscim/test/gdx/poi3d/GdxRenderer3D.java +++ b/vtm-playground/src/org/oscim/test/gdx/poi3d/GdxRenderer3D.java @@ -47,7 +47,7 @@ public GdxRenderer3D(Map map) { } @Override - protected boolean setup() { + public boolean setup() { modelBatch = new ModelBatch(new DefaultShaderProvider()); @@ -68,7 +68,7 @@ protected boolean setup() { } @Override - protected synchronized void update(GLViewport v) { + public synchronized void update(GLViewport v) { // if (loading && assets.update()) // doneLoading(); @@ -88,7 +88,7 @@ protected synchronized void update(GLViewport v) { Renderable r = new Renderable(); @Override - protected void render(GLViewport v) { + public void render(GLViewport v) { if (instances.size == 0) return; diff --git a/vtm-playground/src/org/oscim/test/gdx/poi3d/GdxRenderer3D2.java b/vtm-playground/src/org/oscim/test/gdx/poi3d/GdxRenderer3D2.java index f469ae43c..10ae13baf 100644 --- a/vtm-playground/src/org/oscim/test/gdx/poi3d/GdxRenderer3D2.java +++ b/vtm-playground/src/org/oscim/test/gdx/poi3d/GdxRenderer3D2.java @@ -36,7 +36,7 @@ public GdxRenderer3D2(Map map) { } @Override - protected boolean setup() { + public boolean setup() { // if (assets == null) // assets = new AssetManager(); @@ -60,7 +60,7 @@ protected boolean setup() { } @Override - protected synchronized void update(GLViewport v) { + public synchronized void update(GLViewport v) { // if (loading && assets.update()) // doneLoading(); @@ -78,7 +78,7 @@ protected synchronized void update(GLViewport v) { float[] mBox = new float[8]; @Override - protected void render(GLViewport v) { + public void render(GLViewport v) { if (instances.size == 0) return; diff --git a/vtm-playground/src/org/oscim/test/renderer/AtlasTest.java b/vtm-playground/src/org/oscim/test/renderer/AtlasTest.java index 398fef7ac..f2737eb7d 100644 --- a/vtm-playground/src/org/oscim/test/renderer/AtlasTest.java +++ b/vtm-playground/src/org/oscim/test/renderer/AtlasTest.java @@ -56,7 +56,7 @@ public AtlasRenderLayer() { TextBucket tl = new TextBucket(); TextStyle t = new TextBuilder().setFontSize(20).setColor(Color.BLACK).build(); - buckets.setTextureBuckets(tl); + buckets.set(tl); float[] points = new float[10]; @@ -101,7 +101,6 @@ public AtlasRenderLayer() { TextItem ti = TextItem.pool.get(); ti.set(r.x + r.w / 2, r.y + r.h / 2, "" + i, t); - ti.x1 = 0; ti.y1 = 1; // (short) (size / 2); ti.x2 = 1; // (short) size; @@ -131,7 +130,7 @@ public AtlasRenderLayer() { boolean initial = true; @Override - protected void update(GLViewport v) { + public void update(GLViewport v) { if (initial) { mMapPosition.copy(v.pos); diff --git a/vtm-playground/src/org/oscim/test/renderer/BezierTest.java b/vtm-playground/src/org/oscim/test/renderer/BezierTest.java index d475854f7..0039d10fa 100644 --- a/vtm-playground/src/org/oscim/test/renderer/BezierTest.java +++ b/vtm-playground/src/org/oscim/test/renderer/BezierTest.java @@ -75,7 +75,7 @@ public synchronized void clear() { } @Override - protected synchronized void update(GLViewport v) { + public synchronized void update(GLViewport v) { if (mMapPosition.scale == 0) mMapPosition.copy(v.pos); diff --git a/vtm-playground/src/org/oscim/test/renderer/CustomRenderer.java b/vtm-playground/src/org/oscim/test/renderer/CustomRenderer.java index 770841899..ff99305b0 100644 --- a/vtm-playground/src/org/oscim/test/renderer/CustomRenderer.java +++ b/vtm-playground/src/org/oscim/test/renderer/CustomRenderer.java @@ -61,7 +61,7 @@ public CustomRenderer(Map map) { // ---------- everything below runs in GLRender Thread ---------- @Override - protected void update(GLViewport v) { + public void update(GLViewport v) { if (!mInitialized) { if (!init()) return; @@ -86,7 +86,7 @@ protected void compile() { } @Override - protected void render(GLViewport v) { + public void render(GLViewport v) { // Use the program object GLState.useProgram(mProgramObject); diff --git a/vtm-playground/src/org/oscim/test/renderer/HexagonRenderTest.java b/vtm-playground/src/org/oscim/test/renderer/HexagonRenderTest.java index 603a685ba..67ccf6bd1 100644 --- a/vtm-playground/src/org/oscim/test/renderer/HexagonRenderTest.java +++ b/vtm-playground/src/org/oscim/test/renderer/HexagonRenderTest.java @@ -7,8 +7,8 @@ import org.oscim.gdx.GdxMap; import org.oscim.gdx.GdxMapApp; import org.oscim.layers.GenericLayer; -import org.oscim.renderer.BufferObject; import org.oscim.renderer.BucketRenderer; +import org.oscim.renderer.BufferObject; import org.oscim.renderer.GLShader; import org.oscim.renderer.GLState; import org.oscim.renderer.GLUtils; @@ -51,7 +51,7 @@ static class HexagonRenderer extends BucketRenderer { float mCellScale = 60 * MapRenderer.COORD_SCALE; @Override - protected void update(GLViewport v) { + public void update(GLViewport v) { if (!mInitialized) { if (!init()) { return; @@ -87,7 +87,7 @@ protected void compile() { } @Override - protected void render(GLViewport v) { + public void render(GLViewport v) { // Use the program object GLState.useProgram(mProgramObject); diff --git a/vtm-playground/src/org/oscim/test/renderer/SymbolRenderLayer.java b/vtm-playground/src/org/oscim/test/renderer/SymbolRenderLayer.java index 8288ce689..1730a5cce 100644 --- a/vtm-playground/src/org/oscim/test/renderer/SymbolRenderLayer.java +++ b/vtm-playground/src/org/oscim/test/renderer/SymbolRenderLayer.java @@ -27,7 +27,7 @@ public class SymbolRenderLayer extends BucketRenderer { public SymbolRenderLayer() { SymbolBucket l = new SymbolBucket(); - buckets.setTextureBuckets(l); + buckets.set(l); SymbolItem it = SymbolItem.pool.get(); it.billboard = false; @@ -42,7 +42,7 @@ public SymbolRenderLayer() { } @Override - protected void update(GLViewport v) { + public void update(GLViewport v) { if (initialize) { initialize = false; mMapPosition.copy(v.pos);